/**
 * Modal Layouts CSS - Salnea Review System
 * 4 layouts : Compact, Multi-étapes, Horizontal, Minimaliste
 * Version: 1.0.0
 */

/* ========================================
   BASE STYLES POUR TOUS LES LAYOUTS
   ======================================== */

.review-form-content {
    transition: all 0.3s ease;
    position: relative;
}

/* Bouton de sélection de layout dans la modal */
.layout-toggle-btn {
    position: absolute;
    top: 10px;
    right: 50px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}

.layout-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* ========================================
   LAYOUT 1: COMPACT
   ======================================== */

.modal-layout-compact {
    max-height: 450px !important;
    overflow-y: auto;
}

.modal-layout-compact #new-review-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-layout-compact .mb-3 {
    margin-bottom: 10px !important;
}

.modal-layout-compact textarea[name="comment"] {
    rows: 2;
    min-height: 60px;
    max-height: 80px;
}

.modal-layout-compact .rating-selection {
    padding: 10px 0;
}

.modal-layout-compact h2 {
    font-size: 20px;
    margin-bottom: 15px;
}

/* ========================================
   LAYOUT 2: MULTI-ÉTAPES (STEPS)
   ======================================== */

.modal-layout-steps {
    min-height: 400px;
}

.modal-layout-steps .form-content-wrapper {
    position: relative;
    min-height: 350px;
}

/* Indicateurs de progression */
.modal-layout-steps .step-indicators {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    position: relative;
}

.modal-layout-steps .step-indicators::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 20%;
    right: 20%;
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.modal-layout-steps .step-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    color: #999;
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    cursor: pointer;
}

.modal-layout-steps .step-dot.active {
    background: #333;
    border-color: #333;
    color: white;
    transform: scale(1.1);
}

.modal-layout-steps .step-dot.completed {
    background: #4CAF50;
    border-color: #4CAF50;
    color: white;
}

/* Conteneurs d'étapes */
.modal-layout-steps .step-container {
    display: none;
    animation: slideIn 0.3s ease;
    min-height: 250px;
}

.modal-layout-steps .step-container.active {
    display: block;
}

.modal-layout-steps .step-container h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #333;
    font-weight: 500;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Navigation des étapes */
.modal-layout-steps .step-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.modal-layout-steps .btn-prev,
.modal-layout-steps .btn-next,
.modal-layout-steps .btn-submit {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.modal-layout-steps .btn-prev {
    background: #f5f5f5;
    color: #666;
}

.modal-layout-steps .btn-next,
.modal-layout-steps .btn-submit {
    background: #333;
    color: white;
    margin-left: auto;
}

.modal-layout-steps .btn-prev:hover {
    background: #e8e8e8;
}

.modal-layout-steps .btn-next:hover,
.modal-layout-steps .btn-submit:hover {
    background: #555;
    transform: translateY(-1px);
}

/* ========================================
   LAYOUT 3: HORIZONTAL
   ======================================== */

.modal-layout-horizontal {
    max-width: 900px !important;
    width: 90vw;
}

.modal-layout-horizontal #new-review-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.modal-layout-horizontal .left-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-layout-horizontal .right-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-layout-horizontal .rating-selection {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px 0;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.modal-layout-horizontal .form-row-full {
    grid-column: 1 / -1;
}

.modal-layout-horizontal textarea[name="comment"] {
    min-height: 150px;
}

.modal-layout-horizontal button[type="submit"] {
    grid-column: 1 / -1;
    justify-self: center;
    min-width: 200px;
}

/* Réorganisation pour le layout horizontal */
.modal-layout-horizontal .mb-3:has(input[name="author_name"]),
.modal-layout-horizontal .mb-3:has(input[name="author_email"]) {
    grid-column: 1;
}

.modal-layout-horizontal .mb-3:has(input[name="title"]),
.modal-layout-horizontal .mb-3:has(textarea[name="comment"]) {
    grid-column: 2;
}

.modal-layout-horizontal .mb-3:has(input[type="file"]) {
    grid-column: 1 / -1;
}

/* ========================================
   LAYOUT 4: MINIMALISTE
   ======================================== */

.modal-layout-minimal {
    max-height: 350px !important;
}

.modal-layout-minimal #new-review-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-layout-minimal h2 {
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 500;
}

.modal-layout-minimal .rating-selection {
    padding: 15px 0;
}

.modal-layout-minimal .rating-selection .star {
    font-size: 32px;
}

.modal-layout-minimal textarea[name="comment"] {
    min-height: 60px;
    max-height: 80px;
    resize: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
}

.modal-layout-minimal input[name="author_name"] {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
}

.modal-layout-minimal button[type="submit"] {
    padding: 12px 30px;
    background: #333;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    align-self: center;
    min-width: 150px;
}

.modal-layout-minimal button[type="submit"]:hover {
    background: #555;
    transform: translateY(-1px);
}

/* Cacher les champs non essentiels en mode minimal */
.modal-layout-minimal .mb-3:has(input[name="author_email"]),
.modal-layout-minimal .mb-3:has(input[name="title"]),
.modal-layout-minimal .mb-3:has(input[type="file"]) {
    display: none !important;
}

/* ========================================
   PANNEAU DE CONTRÔLE DES LAYOUTS
   ======================================== */

#modal-layout-panel {
    position: fixed;
    top: 50%;
    right: -400px;
    transform: translateY(-50%);
    width: 380px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    z-index: 100000;
    transition: right 0.3s ease;
}

#modal-layout-panel.visible {
    right: 20px;
}

#modal-layout-panel .panel-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#modal-layout-panel .panel-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

#modal-layout-panel .panel-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

#modal-layout-panel .panel-close:hover {
    background: #f5f5f5;
    color: #333;
}

/* Tabs */
#modal-layout-panel .panel-tabs {
    display: flex;
    gap: 5px;
    padding: 10px 20px;
    background: #f9f9f9;
}

#modal-layout-panel .tab-btn {
    flex: 1;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

#modal-layout-panel .tab-btn.active {
    background: #333;
    color: white;
    border-color: #333;
}

#modal-layout-panel .tab-btn:hover:not(.active) {
    background: #f5f5f5;
}

/* Contenu des tabs */
#modal-layout-panel .panel-content {
    padding: 20px;
}

#modal-layout-panel .tab-content {
    display: none;
}

#modal-layout-panel .tab-content.active {
    display: block;
}

/* Grille de presets */
.presets-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 15px;
}

.preset-btn {
    padding: 12px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.preset-btn:hover {
    border-color: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.preset-btn.active {
    background: #333;
    color: white;
    border-color: #333;
}

.preset-icon {
    display: block;
    font-size: 16px;
    margin-bottom: 4px;
}

.preset-desc {
    display: block;
    font-size: 11px;
    opacity: 0.7;
}

/* Grille de layouts */
.layout-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.layout-btn {
    padding: 15px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.layout-btn:hover {
    border-color: #666;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.layout-btn.active {
    background: #333;
    color: white;
    border-color: #333;
}

/* Bouton random */
.random-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.random-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* Matrice de combinaisons */
.combo-matrix {
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
}

.combo-matrix p {
    margin: 0 0 10px;
    font-size: 13px;
    color: #666;
}

/* Notification */
.layout-notification {
    position: fixed;
    bottom: -60px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    transition: bottom 0.3s ease;
    z-index: 100001;
}

.layout-notification.visible {
    bottom: 30px;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    .modal-layout-horizontal {
        max-width: 95vw !important;
    }
    
    .modal-layout-horizontal #new-review-form {
        grid-template-columns: 1fr;
    }
    
    .modal-layout-horizontal .mb-3 {
        grid-column: 1 !important;
    }
    
    #modal-layout-panel {
        width: 320px;
    }
    
    .presets-grid,
    .layout-grid {
        grid-template-columns: 1fr;
    }
}