/* Modern Design System for HelpCity */
:root {
    /* Primary Colors */
    --primary: #08a170;
    --primary-light: #10b981;
    --primary-dark: #059669;
    --primary-gradient: linear-gradient(135deg, #08a170 0%, #059669 100%);
    
    /* Secondary Colors */
    --secondary: #f59e0b;
    --secondary-light: #fbbf24;
    --secondary-dark: #d97706;
    
    /* Neutral Colors */
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    /* Status Colors */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --error: #ef4444;
    --error-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* Design System */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
    
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Language Direction Support */
[dir="rtl"] {
    font-family: 'Cairo', 'Tajawal', var(--font-sans);
}

[dir="ltr"] {
    font-family: var(--font-sans);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--gray-900);
    background: var(--gray-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modern Background Patterns */
.modern-bg {
    background: linear-gradient(135deg, #f0fdf4 0%, #fffbeb 100%);
    position: relative;
    overflow: hidden;
}

.modern-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(8, 161, 112, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(245, 158, 11, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

/* Glassmorphism Effects */
.glass {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.glass-dark {
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Enhanced Cards */
.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 24px;
    transition: all var(--transition-normal);
    border: 1px solid var(--gray-200);
    position: relative;
    overflow: hidden;
}

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

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

.card:hover::before {
    transform: scaleX(1);
}

.card-elevated {
    box-shadow: var(--shadow-lg);
}

.card-glass {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Modern Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    line-height: 1;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

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

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

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 2px solid var(--gray-200);
}

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

.btn-ghost {
    background: transparent;
    color: var(--gray-600);
}

.btn-ghost:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
}

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

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 2px solid rgba(34, 197, 94, 0.2);
    padding: 4px;
    transition: all 0.3s ease;
}

.language-switcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border-color: rgba(34, 197, 94, 0.4);
}

[dir="rtl"] .language-switcher {
    right: auto;
    left: 20px;
}

.lang-btn {
    padding: 10px 18px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    border-radius: 20px;
    min-width: 45px;
    text-align: center;
    position: relative;
}

.lang-btn.active {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.lang-btn:not(.active):hover {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    transform: scale(1.05);
}

.lang-btn.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    border-radius: 20px;
}

/* Dropdown Language Switcher */
.language-switcher-dropdown {
    border-top: 1px solid #e5e7eb;
    margin: 8px 0;
    padding-top: 8px;
}

.lang-switcher-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.lang-options {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #374151;
    text-align: left;
    width: 100%;
}

.lang-option:hover {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
}

.lang-option.active {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    font-weight: 600;
}

.lang-option .flag {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

[dir="rtl"] .lang-option {
    text-align: right;
}

[dir="rtl"] .lang-switcher-header {
    text-align: right;
}

/* Login Page Language Switcher */
.language-switcher-login {
    margin-top: 12px;
    text-align: center;
}

.lang-inline-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    user-select: none;
}

.lang-inline-toggle .lang-link {
    color: #6b7280;
    text-decoration: none;
    padding: 6px 4px;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
    background: transparent;
    border: none;
    cursor: pointer;
    font: inherit;
}

.lang-inline-toggle .lang-link:hover {
    color: #111827;
    background: rgba(17, 24, 39, 0.04);
}

.lang-inline-toggle .lang-link.active {
    color: #10b981;
    font-weight: 600;
}

.lang-inline-toggle .lang-sep {
    color: #9ca3af;
}

.lang-divider {
    margin: 20px 0 16px 0;
    position: relative;
    color: #9ca3af;
    font-size: 14px;
}

.lang-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e5e7eb;
}

.lang-divider span {
    background: white;
    padding: 0 16px;
    position: relative;
}

.lang-options-login {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.lang-simple-btn {
    padding: 12px 24px;
    border: 1px solid #e5e7eb;
    background: white;
    color: #6b7280;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 500;
}

.lang-simple-btn:hover {
    border-color: #10b981;
    color: #10b981;
}

.lang-simple-btn.active {
    background: #10b981;
    color: white;
    border-color: #10b981;
}

/* Dashboard Language Menu */
.lang-trigger {
    cursor: pointer !important;
}

.lang-menu {
    margin: 6px 0 10px 0;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-menu-item {
    display: inline-flex;
    width: auto;
    padding: 6px 4px;
    background: transparent;
    border: none;
    text-align: left;
    cursor: pointer;
    color: #6b7280;
    font-size: 14px;
    border-radius: 6px;
}

.lang-menu-item:hover {
    background: rgba(17, 24, 39, 0.04);
    color: #111827;
}

.lang-menu-item.active {
    background: transparent;
    color: #10b981;
    font-weight: 600;
}

[dir="rtl"] .lang-menu-item {
    text-align: right;
}

/* Modern Form Elements */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 16px;
    transition: all var(--transition-normal);
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(8, 161, 112, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--gray-200);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 4px;
}

/* Modern Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    padding: 16px 20px;
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    display: flex;
    align-items: center;
    gap: 12px;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    z-index: 1000;
}

[dir="rtl"] .notification {
    right: auto;
    left: 20px;
    transform: translateX(-100%);
}

.notification.show {
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid var(--success);
}

.notification-error {
    border-left: 4px solid var(--error);
}

.notification-warning {
    border-left: 4px solid var(--warning);
}

.notification-info {
    border-left: 4px solid var(--info);
}

/* Responsive Design */
@media (max-width: 768px) {
    .language-switcher {
        top: 10px;
        right: 10px;
    }
    
    [dir="rtl"] .language-switcher {
        right: auto;
        left: 10px;
    }
    
    .notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .card {
        padding: 16px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* RTL Specific Styles */
[dir="rtl"] .btn {
    direction: rtl;
}

[dir="rtl"] .form-input {
    text-align: right;
}

[dir="rtl"] .card {
    direction: rtl;
}

[dir="rtl"] .sidebar-nav {
    direction: rtl;
}

[dir="rtl"] .nav-btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .logo-horizontal-sidebar {
    flex-direction: row-reverse;
}

[dir="rtl"] .user-info {
    flex-direction: row-reverse;
}

[dir="rtl"] .modal-actions {
    flex-direction: row-reverse;
}

[dir="rtl"] .photo-preview-container {
    direction: rtl;
}

[dir="rtl"] .notes-content {
    text-align: right;
}

/* Additional Utility Classes */
.photo-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
}

.notes-content {
    margin: 20px 0;
    padding: 15px;
    background: var(--gray-50);
    border-radius: var(--radius-md);
    line-height: 1.6;
    color: var(--gray-700);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.btn-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    border: none;
    background: var(--gray-100);
    color: var(--gray-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
}

.btn-icon:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius-md);
    margin: 10px 0;
    font-size: 14px;
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-error {
    background: var(--error-light);
    color: var(--error);
    border: 1px solid var(--error);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
    border: 1px solid var(--warning);
}

.btn-success {
    background: var(--success);
    color: white;
    box-shadow: 0 4px 6px rgba(16, 185, 129, 0.2);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(16, 185, 129, 0.3);
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --gray-50: #111827;
        --gray-100: #1f2937;
        --gray-200: #374151;
        --gray-300: #4b5563;
        --gray-700: #f3f4f6;
        --gray-800: #f9fafb;
        --gray-900: #ffffff;
    }
    
    .card {
        background: var(--gray-100);
        border-color: var(--gray-200);
    }
    
    .glass {
        background: rgba(17, 24, 39, 0.8);
    }
}
