/* ═══════════════════════════════════════════════════════════════════════
   MOBILE COMMON STYLES - Tüm Sayfalar için Ortak Mobil Stiller
   ═══════════════════════════════════════════════════════════════════════ */

/* Prevent horizontal scroll on ALL pages */
html, body {
    max-width: 100vw;
    overflow-x: hidden !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE HEADER - Fixed top bar for mobile
   ═══════════════════════════════════════════════════════════════════════ */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(255, 255, 255, 0.98);
    /* v15.2 PERFORMANCE: backdrop-filter kaldırıldı */
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 1000;
    padding: 0 12px;
    align-items: center;
    justify-content: space-between;
}

html.dark .mobile-header,
[data-theme="dark"] .mobile-header {
    background: rgba(10, 14, 23, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex !important;
    }
    
    /* Add padding to body for fixed header - KALDIRILDI: Her sayfa kendi padding'ine sahip */
    /*
    body {
        padding-top: 60px !important;
    }
    */
    
    /* Hide desktop sidebar on mobile */
    .sidebar,
    .desktop-sidebar,
    aside.hidden {
        display: none !important;
    }
}

/* Logo in mobile header */
.mobile-header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.mobile-header-logo .logo-icon {
    width: 36px;
    height: 36px;
    position: relative;
}

.mobile-header-logo .logo-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
    background: linear-gradient(#0a0e17, #0a0e17) padding-box, 
                linear-gradient(135deg, #00f2fe, #4facfe, #bf00ff) border-box;
    animation: none; /* v15.2 PERFORMANCE: logoSpin kaldırıldı */
}

html:not(.dark) .mobile-header-logo .logo-ring,
[data-theme="light"] .mobile-header-logo .logo-ring {
    background: linear-gradient(#f8fafc, #f8fafc) padding-box, 
                linear-gradient(135deg, #00f2fe, #4facfe, #bf00ff) border-box;
}

.mobile-header-logo .logo-core {
    position: absolute;
    inset: 3px;
    background: #0a0e17;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

html:not(.dark) .mobile-header-logo .logo-core,
[data-theme="light"] .mobile-header-logo .logo-core {
    background: #f8fafc;
}

.mobile-header-logo .logo-core svg {
    width: 18px;
    height: 18px;
}

.mobile-header-logo .brand-text {
    display: flex;
    flex-direction: column;
}

.mobile-header-logo .brand-name {
    font-size: 0.875rem;
    font-weight: 700;
    background: linear-gradient(to right, #22d3ee, #3b82f6, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.03em;
    line-height: 1.2;
}

.mobile-header-logo .brand-sub {
    font-size: 0.625rem;
    color: #64748b;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Menu button */
.mobile-menu-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

html.dark .mobile-menu-btn,
[data-theme="dark"] .mobile-menu-btn {
    background: rgba(255, 255, 255, 0.08);
}

.mobile-menu-btn:active {
    transform: scale(0.95);
}

.mobile-menu-btn svg {
    width: 24px;
    height: 24px;
    stroke: #374151;
}

html.dark .mobile-menu-btn svg,
[data-theme="dark"] .mobile-menu-btn svg {
    stroke: #e5e7eb;
}

/* ═══════════════════════════════════════════════════════════════════════
   MOBILE MENU OVERLAY & PANEL
   ═══════════════════════════════════════════════════════════════════════ */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    /* v15.2 PERFORMANCE: backdrop-filter kaldırıldı */
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 300px;
    max-width: 85vw;
    background: #ffffff;
    z-index: 1060;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
}

html.dark .mobile-menu-panel,
[data-theme="dark"] .mobile-menu-panel {
    background: #0f172a;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.4);
}

.mobile-menu-panel.active {
    transform: translateX(0);
}

/* Menu Header */
.mobile-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

html.dark .mobile-menu-header,
[data-theme="dark"] .mobile-menu-header {
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

.mobile-menu-header h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

html.dark .mobile-menu-header h3,
[data-theme="dark"] .mobile-menu-header h3 {
    color: #f1f5f9;
}

.mobile-menu-close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

html.dark .mobile-menu-close,
[data-theme="dark"] .mobile-menu-close {
    background: rgba(255, 255, 255, 0.08);
}

.mobile-menu-close svg {
    width: 20px;
    height: 20px;
    stroke: #64748b;
}

/* Settings Bar */
.mobile-menu-settings {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.02);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

html.dark .mobile-menu-settings,
[data-theme="dark"] .mobile-menu-settings {
    background: rgba(255, 255, 255, 0.02);
    border-bottom-color: rgba(255, 255, 255, 0.05);
}

.mobile-menu-settings .setting-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-menu-settings .setting-label {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
}

/* Theme Toggle in Menu */
.mobile-theme-toggle {
    width: 44px;
    height: 24px;
    background: #e2e8f0;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s ease;
    border: none;
}

html.dark .mobile-theme-toggle,
[data-theme="dark"] .mobile-theme-toggle {
    background: #6366f1;
}

.mobile-theme-toggle .toggle-knob {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

html.dark .mobile-theme-toggle .toggle-knob,
[data-theme="dark"] .mobile-theme-toggle .toggle-knob {
    transform: translateX(20px);
}

.mobile-theme-toggle .toggle-knob svg {
    width: 12px;
    height: 12px;
}

.mobile-theme-toggle .sun-icon {
    color: #f59e0b;
}

.mobile-theme-toggle .moon-icon {
    color: #6366f1;
    display: none;
}

html.dark .mobile-theme-toggle .sun-icon,
[data-theme="dark"] .mobile-theme-toggle .sun-icon {
    display: none;
}

html.dark .mobile-theme-toggle .moon-icon,
[data-theme="dark"] .mobile-theme-toggle .moon-icon {
    display: block;
}

/* Language Select */
.mobile-lang-select {
    padding: 6px 10px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    font-size: 0.8125rem;
    color: #374151;
    cursor: pointer;
    outline: none;
}

html.dark .mobile-lang-select,
[data-theme="dark"] .mobile-lang-select {
    background: #1e293b;
    border-color: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
}

/* Navigation Links */
.mobile-menu-nav {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.mobile-nav-section {
    margin-bottom: 16px;
}

.mobile-nav-section-title {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 8px 12px 4px;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    color: #475569;
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

html.dark .mobile-nav-link,
[data-theme="dark"] .mobile-nav-link {
    color: #cbd5e1;
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
    background: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}

.mobile-nav-link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.mobile-nav-link.highlight {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    color: white !important;
}

/* Expandable submenu */
.mobile-nav-submenu {
    padding-left: 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.mobile-nav-submenu.expanded {
    max-height: 500px;
}

.mobile-nav-submenu .mobile-nav-link {
    font-size: 0.875rem;
    padding: 10px 12px;
}

/* Footer Actions */
.mobile-menu-footer {
    padding: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

html.dark .mobile-menu-footer,
[data-theme="dark"] .mobile-menu-footer {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.mobile-menu-footer .btn-login,
.mobile-menu-footer .btn-signup {
    display: block;
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.mobile-menu-footer .btn-login {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: #374151;
}

html.dark .mobile-menu-footer .btn-login,
[data-theme="dark"] .mobile-menu-footer .btn-login {
    border-color: rgba(255, 255, 255, 0.15);
    color: #e5e7eb;
}

.mobile-menu-footer .btn-signup {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    border: none;
    color: white;
}

/* User profile in menu */
.mobile-user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(0, 0, 0, 0.03);
    border-radius: 12px;
    margin-bottom: 12px;
}

html.dark .mobile-user-profile,
[data-theme="dark"] .mobile-user-profile {
    background: rgba(255, 255, 255, 0.03);
}

.mobile-user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.125rem;
}

.mobile-user-info {
    flex: 1;
}

.mobile-user-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9375rem;
}

html.dark .mobile-user-name,
[data-theme="dark"] .mobile-user-name {
    color: #f1f5f9;
}

.mobile-user-email {
    font-size: 0.75rem;
    color: #64748b;
}

/* Logout button */
.mobile-logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #ef4444;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE FIXES FOR ALL PAGES
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* Dashboard content area */
    .main-content,
    .dashboard-content,
    .content-area {
        padding: 12px !important;
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100vw !important;
    }
    
    /* Cards should be full width */
    .card,
    .glass-card,
    .stat-card,
    .analytics-card {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    /* Grid fixes */
    .grid {
        grid-template-columns: 1fr !important;
    }
    
    .grid-cols-2,
    .grid-cols-3,
    .grid-cols-4 {
        grid-template-columns: 1fr !important;
    }
    
    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table {
        min-width: 600px;
    }
    
    /* Charts */
    .chart-container {
        width: 100% !important;
        overflow-x: auto;
    }
}

@keyframes logoSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
