/* =============================================================================
   UNIFIED STYLES - LAILA Platform
   Consistent, Clean, Streamlined Design
   ============================================================================= */

:root {
    /* Unified Color Palette */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    --accent-gradient: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    
    /* Base Colors */
    --primary-color: #667eea;
    --secondary-color: #4ecdc4;
    --accent-color: #ff6b6b;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --background: #f8f9fa;
    --form-background: #ffffff;
    --label-color: #555555;
    --border-color: #dddddd;
    --shadow-color: rgba(0, 0, 0, 0.1);
    
    /* Consistent Sizing */
    --container-max-width: 800px;  /* Reduced from 1000px */
    --card-padding: 25px;          /* Reduced from 40px */
    --border-radius: 12px;
    --border-radius-large: 15px;
    
    /* Spacing */
    --spacing-xs: 5px;
    --spacing-sm: 10px;
    --spacing-md: 20px;
    --spacing-lg: 30px;
    --spacing-xl: 40px;
    
    /* Shadows */
    --shadow-light: 0 4px 15px rgba(0,0,0,0.1);
    --shadow-medium: 0 8px 25px rgba(0,0,0,0.15);
    --shadow-heavy: 0 12px 35px rgba(0,0,0,0.2);
}

/* =============================================================================
   GLOBAL RESET & BASE
   ============================================================================= */

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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--primary-gradient);
    min-height: 100vh;
    padding-top: 70px; /* Space for navigation */
}

/* =============================================================================
   UNIFIED NAVIGATION BAR
   ============================================================================= */

.unified-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    z-index: 9999; /* Very high z-index to be on top of everything */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-center {
    flex: 1;
    text-align: center;
}

.app-title {
    font-size: 1.5em;
    font-weight: bold;
    color: var(--primary-color);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
}

.nav-button {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid var(--primary-color);
    border-radius: 20px;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9em;
    transition: all 0.3s ease;
    cursor: pointer;
    white-space: nowrap;
}

.nav-button:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

.nav-button.back-home {
    background: var(--primary-color);
    color: white;
}

.nav-button.back-home:hover {
    background: var(--secondary-color);
}

.nav-button.admin-btn {
    border-color: var(--accent-color);
    color: var(--accent-color);
    color: white;
}

.nav-button.admin-btn:hover {
    background: var(--accent-color);
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 12px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    font-size: 0.9em;
    color: white;
    font-weight: 500;
}

.nav-button.logout-btn {
    border-color: #e74c3c;
    color: white;
}

.nav-button.logout-btn:hover {
    background: #e74c3c;
    color: white;
}

/* =============================================================================
   UNIFIED CONTAINER SYSTEM
   ============================================================================= */

.page-container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: var(--spacing-md);
    min-height: calc(100vh - 60px);
}

.content-card {
    background: var(--white);
    /* border-radius: var(--border-radius-large); */
    padding: var(--card-padding);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-medium);
    position: relative;
    overflow: hidden;
}

.content-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
}

/* =============================================================================
   TYPOGRAPHY
   ============================================================================= */

.page-title {
    font-size: 2em;        /* Reduced from 2.5em */
    color: var(--text-color);
    text-align: center;
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

.page-subtitle {
    font-size: 1.1em;      /* Reduced from 1.2em */
    color: var(--text-light);
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.section-title {
    font-size: 1.3em;
    color: var(--text-color);
    margin-bottom: var(--spacing-md);
    font-weight: 600;
}

/* =============================================================================
   FORMS & INPUTS
   ============================================================================= */

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-label {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--text-color);
    font-weight: 500;
}

.form-input, 
.form-textarea, 
.form-select {
    width: 100%;
    padding: 12px 15px;    /* Reduced padding */
    border: 2px solid #e1e5e9;
    border-radius: var(--border-radius);
    font-size: 14px;       /* Reduced from 16px */
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.form-textarea {
    min-height: 100px;     /* Reduced from larger sizes */
    resize: vertical;
}

/* =============================================================================
   BUTTONS
   ============================================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 10px 20px;    /* Reduced padding */
    border: none;
    border-radius: var(--border-radius);
    font-size: 14px;       /* Reduced font size */
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    justify-content: center;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

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

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

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

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

.btn-full {
    width: 100%;
}

.btn-large {
    padding: 15px 25px;
    font-size: 16px;
}

/* =============================================================================
   GRID SYSTEM
   ============================================================================= */

.grid {
    display: grid;
    gap: var(--spacing-md);
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

/* =============================================================================
   UTILITY CLASSES
   ============================================================================= */

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }

.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }

.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }

.hidden { display: none; }
.loading { opacity: 0.6; pointer-events: none; }

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

@media (max-width: 768px) {
    :root {
        --container-max-width: 95%;
        --card-padding: 20px;
    }
    
    .page-container {
        padding: var(--spacing-sm);
    }
    
    .page-title {
        font-size: 1.6em;
    }
    
    .page-subtitle {
        font-size: 1em;
    }
    
    .btn {
        padding: 12px 16px;
        font-size: 14px;
    }
    
    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   SPECIFIC COMPONENTS
   ============================================================================= */

/* Chat Interface */
.chat-container {
    max-height: 400px;     /* Reduced height */
    overflow-y: auto;
    border: 1px solid #e1e5e9;
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    background: #f8f9fa;
}

.chat-message {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
}

.chat-message.user {
    background: var(--primary-color);
    color: var(--white);
    margin-left: 20%;
}

.chat-message.ai {
    background: var(--white);
    border: 1px solid #e1e5e9;
    margin-right: 20%;
}

/* Status Messages */
.status-message {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
}

.status-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.status-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.status-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Loading States */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 