/* ===============================================
   God's Desire - Modern Clean Interface
   =============================================== */

:root {
    /* Primary Colors */
    --primary: #4A90E2;
    --primary-hover: #357ABD;
    --primary-light: #E3F2FD;
    
    /* Legacy colors (for login page) */
    --gold: #d4af37;
    --dark: #1a1a2e;
    --text: #ffffff;
    
    /* Neutral Colors */
    --white: #FFFFFF;
    --bg-page: #F5F7FA;
    --bg-card: #FFFFFF;
    --text-primary: #2C3E50;
    --text-secondary: #7F8C9A;
    --text-muted: #95A5A6;
    
    /* Border & Lines */
    --border-light: #E1E8ED;
    --border-medium: #CBD5E0;
    --border-dark: #A0AEC0;
    
    /* Accent Colors */
    --accent-blue: #4A90E2;
    --accent-green: #4CAF50;
    --accent-orange: #FFB74D;
    --accent-red: #E57373;
    --accent-purple: #9C27B0;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 50%;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}

/* ===============================================
   Reset & Base
   =============================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 14px;
}

/* ===============================================
   Layout Structure
   =============================================== */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Navigation */
.app-sidebar {
    width: 240px;
    background: var(--white);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
}

.app-logo {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.app-logo h1 {
    font-size: 18px;
    color: var(--primary);
    font-weight: 600;
}

.app-nav {
    flex: 1;
    padding: var(--space-md);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: var(--space-md);
    margin-bottom: var(--space-xs);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all 0.2s;
    cursor: pointer;
    font-size: 14px;
}

.nav-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.nav-item.active {
    background: var(--primary);
    color: var(--white);
    font-weight: 500;
}

.nav-item-icon {
    margin-right: var(--space-md);
    font-size: 18px;
}

/* Main Content */
.app-main {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: var(--white);
    border-bottom: 1px solid var(--border-light);
    padding: var(--space-lg) var(--space-xl);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
}

.user-name {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

/* Content Area */
.app-content {
    flex: 1;
    padding: var(--space-xl);
}

/* Modules - Affichage conditionnel */
.module {
    display: none;
}

.module.active {
    display: block;
}

/* ===============================================
   Two-Column Layout (List + Detail)
   =============================================== */
.layout-split {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: var(--space-xl);
    height: calc(100vh - 160px);
}

/* Left Panel - List */
.panel-list {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.panel-header {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.panel-controls {
    display: flex;
    gap: var(--space-sm);
}

.panel-search {
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border-light);
}

.search-input {
    width: 100%;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.panel-body {
    flex: 1;
    overflow-y: auto;
}

/* List Items */
.list-item {
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: start;
    gap: var(--space-md);
}

.list-item:hover {
    background: var(--bg-page);
}

.list-item.active {
    background: var(--primary-light);
    border-left: 3px solid var(--primary);
}

.list-item-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
    overflow: hidden;
}

.list-item-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.list-item-content {
    flex: 1;
    min-width: 0;
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: var(--space-xs);
}

.list-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.list-item-meta {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}

.list-item-preview {
    font-size: 13px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Right Panel - Detail */
.panel-detail {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.detail-header {
    padding: var(--space-xl);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.detail-hero {
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.detail-avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
    border: 4px solid var(--white);
    box-shadow: var(--shadow-md);
}

.detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.detail-identity {
    flex: 1;
}

.detail-name {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.detail-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.detail-actions {
    display: flex;
    gap: var(--space-sm);
}

.detail-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-xl);
}

/* ===============================================
   Cards & Sections
   =============================================== */
.card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-collapsible {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    margin-bottom: var(--space-md);
    overflow: hidden;
}

.section-header {
    padding: var(--space-lg);
    background: var(--bg-page);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
}

.section-header:hover {
    background: #EDF2F7;
}

.section-header-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.section-header-icon {
    transition: transform 0.2s;
}

.section-header-icon.collapsed {
    transform: rotate(-90deg);
}

.section-body {
    padding: var(--space-lg);
    display: none;
}

.section-body.expanded {
    display: block;
}

/* ===============================================
   Forms
   =============================================== */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.form-group {
    margin-bottom: var(--space-lg);
}

.form-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: var(--space-md);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary);
    transition: all 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
}

.form-input-large {
    font-size: 18px;
    font-weight: 600;
    padding: var(--space-lg);
}

/* Radio Group */
.radio-group {
    display: flex;
    gap: var(--space-lg);
}

.radio-option {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    cursor: pointer;
}

.radio-option input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.radio-option label {
    font-size: 14px;
    color: var(--text-primary);
    cursor: pointer;
}

/* Rating Stars */
.rating-stars {
    display: flex;
    gap: var(--space-xs);
}

.star {
    font-size: 20px;
    color: var(--border-light);
    cursor: pointer;
    transition: color 0.2s;
}

.star.active,
.star:hover {
    color: #FFB74D;
}

/* ===============================================
   Buttons
   =============================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-sm) var(--space-lg);
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    gap: var(--space-sm);
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    box-shadow: var(--shadow-sm);
}

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

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

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}

.btn-ghost:hover {
    background: var(--bg-page);
}

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

.btn-danger:hover {
    background: #D32F2F;
}

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border-radius: var(--radius-md);
}

.btn-sm {
    padding: var(--space-xs) var(--space-md);
    font-size: 13px;
}

.btn-lg {
    padding: var(--space-md) var(--space-xl);
    font-size: 16px;
}

/* ===============================================
   Badges & Tags
   =============================================== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 500;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: #E8F5E9;
    color: var(--accent-green);
}

.badge-warning {
    background: #FFF3E0;
    color: var(--accent-orange);
}

.badge-danger {
    background: #FFEBEE;
    color: var(--accent-red);
}

/* ===============================================
   Utilities
   =============================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }

.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.hidden { display: none !important; }

/* ===============================================
   Empty States
   =============================================== */
.empty-state {
    text-align: center;
    padding: var(--space-2xl);
    color: var(--text-muted);
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.empty-state-text {
    font-size: 14px;
    margin-bottom: var(--space-lg);
}

/* ===============================================
   Dashboard
   =============================================== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
    transition: all 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card-primary {
    border-left: 4px solid var(--accent-blue);
}

.stat-card-success {
    border-left: 4px solid var(--accent-green);
}

.stat-card-info {
    border-left: 4px solid var(--accent-purple);
}

.stat-card-warning {
    border-left: 4px solid var(--accent-orange);
}

.stat-icon {
    font-size: 48px;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: var(--space-xs);
}

.stat-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: var(--space-xs);
}

.stat-detail {
    font-size: 13px;
    color: var(--text-muted);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

/* Quick Actions */
.quick-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-lg);
    background: var(--bg-page);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}

.quick-action-btn:hover {
    background: var(--primary-light);
    border-color: var(--primary);
    transform: translateX(4px);
}

.quick-action-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.quick-action-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Progress */
.progress-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.progress-item {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.progress-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.progress-value {
    font-size: 13px;
    color: var(--text-secondary);
}

.progress-bar {
    height: 8px;
    background: var(--bg-page);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    border-radius: var(--radius-full);
    transition: width 0.3s ease;
}

.progress-fill-success {
    background: var(--accent-green);
}

/* Recent Items */
.recent-item {
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    cursor: pointer;
    transition: background 0.2s;
}

.recent-item:last-child {
    border-bottom: none;
}

.recent-item:hover {
    background: var(--bg-page);
}

.recent-item-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.recent-item-content {
    flex: 1;
    min-width: 0;
}

.recent-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.recent-item-meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* Character Card */
.character-card {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-md);
    border-bottom: 1px solid var(--border-light);
    cursor: pointer;
    transition: background 0.2s;
}

.character-card:last-child {
    border-bottom: none;
}

.character-card:hover {
    background: var(--bg-page);
}

.character-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.character-card-info {
    flex: 1;
    min-width: 0;
}

.character-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.character-card-role {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ===============================================
   Google Drive Sync Styles
   =============================================== */

.gdrive-connected {
    color: var(--accent-green);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gdrive-disconnected {
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gdrive-sync-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
    padding: 4px 0;
}

.gdrive-sync-indicator i {
    font-size: 0.875rem;
}

.gdrive-sync-indicator small {
    color: var(--text-muted);
}

/* ===============================================
   Responsive
   =============================================== */
@media (max-width: 1024px) {
    .layout-split {
        grid-template-columns: 1fr;
    }
    
    .panel-list {
        height: auto;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .app-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .app-sidebar.open {
        transform: translateX(0);
    }
    
    .app-main {
        margin-left: 0;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}
