/**
 * RaphSEO Hub - Styles
 * Centre de pilotage des projets
 */

/* ========================================
   VARIABLES & RESET
======================================== */
:root {
    --primary-dark: #0d1b2a;
    --primary-gradient-start: #1e3a5f;
    --primary-gradient-end: #0d1b2a;
    --accent: #6c5ce7;
    --accent-hover: #5b4cdb;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #d63031;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --text-dark: #2d3436;
    --text-muted: #636e72;
    --border-color: #dfe6e9;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.15);
    --radius: 12px;
    --radius-lg: 20px;
    --header-height: 70px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========================================
   HEADER
======================================== */
.header {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: var(--white);
    padding: 0 30px;
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    font-size: 32px;
    line-height: 1;
}

.header-back {
    color: var(--white);
    text-decoration: none;
    opacity: 0.8;
    transition: var(--transition);
    font-size: 14px;
}

.header-back:hover {
    opacity: 1;
}

.header h1 {
    font-size: 22px;
    font-weight: 700;
}

.header h1 span {
    color: var(--accent);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-info {
    font-size: 14px;
}

.user-greeting strong {
    color: var(--accent);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn-icon {
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-size: 18px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-primary {
    background: var(--accent);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--light-bg);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

.btn-sm {
    padding: 6px 10px;
    font-size: 16px;
    border-radius: 8px;
    background: var(--light-bg);
}

.btn-sm:hover {
    background: var(--border-color);
}

.btn-delete:hover {
    background: rgba(214, 48, 49, 0.1);
}

/* ========================================
   MAIN CONTENT
======================================== */
.main-content {
    padding-top: calc(var(--header-height) + 30px);
    padding-bottom: 80px;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========================================
   WELCOME SECTION
======================================== */
.welcome-section {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 20px;
}

.welcome-section h2 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.welcome-section p {
    color: var(--text-muted);
    font-size: 16px;
}

/* ========================================
   PROJECTS SECTION
======================================== */
.projects-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
}

.section-icon {
    font-size: 24px;
}

.section-header h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-dark);
}

.section-count {
    margin-left: auto;
    background: var(--light-bg);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-muted);
}

/* ========================================
   PROJECTS GRID
======================================== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.project-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--white);
    padding: 24px;
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-dark);
    box-shadow: var(--shadow);
    transition: var(--transition);
    border-left: 4px solid var(--card-color, var(--accent));
    position: relative;
    overflow: hidden;
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--card-color) 0%, transparent 100%);
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.project-card:hover::before {
    opacity: 0.05;
}

.project-icon {
    font-size: 40px;
    line-height: 1;
    z-index: 1;
}

.project-info {
    flex: 1;
    z-index: 1;
}

.project-info h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-dark);
}

.project-info p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

.project-arrow {
    font-size: 24px;
    color: var(--card-color, var(--accent));
    opacity: 0.5;
    transition: var(--transition);
    z-index: 1;
}

.project-card:hover .project-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* ========================================
   EDIT PROJECTS PAGE
======================================== */
.edit-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
}

.add-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group-small {
    flex: 0 0 100px;
    min-width: 100px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 14px;
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.15);
}

.form-group input[type="color"] {
    padding: 4px;
    height: 44px;
    cursor: pointer;
}

/* Projects List */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-edit-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--light-bg);
    border-radius: var(--radius);
    border-left: 4px solid var(--card-color, var(--accent));
    transition: var(--transition);
}

.project-edit-item.inactive {
    opacity: 0.5;
    border-left-style: dashed;
}

.project-edit-icon {
    font-size: 28px;
}

.project-edit-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.project-edit-info strong {
    font-size: 15px;
}

.project-edit-info span {
    font-size: 13px;
    color: var(--accent);
}

.project-edit-info small {
    font-size: 12px;
    color: var(--text-muted);
}

.project-edit-actions {
    display: flex;
    gap: 8px;
}

.empty-message {
    text-align: center;
    color: var(--text-muted);
    padding: 20px;
    font-style: italic;
}

/* ========================================
   ALERTS
======================================== */
.alert {
    padding: 14px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.alert-success {
    background: rgba(0, 184, 148, 0.1);
    border: 1px solid var(--success);
    color: var(--success);
}

.alert-error {
    background: rgba(214, 48, 49, 0.1);
    border: 1px solid var(--danger);
    color: var(--danger);
}

/* ========================================
   MODAL
======================================== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: var(--white);
    padding: 18px 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header .icon {
    font-size: 24px;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
}

.modal-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 28px;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
    line-height: 1;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 15px 25px 25px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* ========================================
   LOGIN PAGE
======================================== */
.login-page {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
}

.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, var(--primary-gradient-start) 0%, var(--primary-gradient-end) 100%);
    color: var(--white);
    padding: 40px 30px;
    text-align: center;
}

.login-logo {
    font-size: 60px;
    margin-bottom: 15px;
    line-height: 1;
}

.login-header h1 {
    font-size: 28px;
    margin-bottom: 8px;
}

.login-header h1 span {
    color: var(--accent);
}

.login-header p {
    font-size: 14px;
    opacity: 0.8;
}

.login-body {
    padding: 35px;
}

.login-error {
    background: rgba(214, 48, 49, 0.1);
    border: 1px solid var(--danger);
    border-radius: var(--radius);
    padding: 12px 15px;
    margin-bottom: 20px;
    color: var(--danger);
    font-size: 14px;
    text-align: center;
}

.login-body .form-group {
    margin-bottom: 20px;
}

.btn-login {
    width: 100%;
    padding: 14px;
    font-size: 16px;
}

/* ========================================
   FOOTER
======================================== */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
    font-size: 13px;
}

/* ========================================
   RESPONSIVE
======================================== */
@media (max-width: 768px) {
    .header {
        padding: 0 15px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .user-greeting {
        display: none;
    }
    
    .welcome-section {
        padding: 30px 15px;
    }
    
    .welcome-section h2 {
        font-size: 24px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .project-card {
        padding: 18px;
    }
    
    .project-icon {
        font-size: 32px;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group,
    .form-group-small {
        min-width: 100%;
    }
    
    .project-edit-item {
        flex-wrap: wrap;
    }
    
    .project-edit-actions {
        width: 100%;
        justify-content: flex-end;
        margin-top: 10px;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-footer .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-logo {
        display: none;
    }
    
    .btn-icon {
        padding: 8px;
    }
    
    .section-header {
        flex-wrap: wrap;
    }
    
    .section-count {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
}
