/* ===== RESET & BASE STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* ===== CSS VARIABLES ===== */
:root {
    /* Light Theme Colors */
    --bg-primary: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-card: rgba(255, 255, 255, 0.8);
    --bg-card-hover: rgba(255, 255, 255, 0.95);
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --text-inverse: #ffffff;
    
    --accent-primary: #3b82f6;
    --accent-secondary: #06b6d4;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-error: #ef4444;
    
    --border-primary: rgba(148, 163, 184, 0.2);
    --border-secondary: rgba(148, 163, 184, 0.1);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --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);
    
    --gradient-primary: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
    --gradient-secondary: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
    
    --blur-sm: blur(4px);
    --blur-md: blur(8px);
    --blur-lg: blur(16px);
}

/* Dark Theme Colors */
[data-theme="dark"] {
    --bg-primary: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: rgba(30, 41, 59, 0.8);
    --bg-card-hover: rgba(30, 41, 59, 0.95);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --text-inverse: #0f172a;
    
    --accent-primary: #60a5fa;
    --accent-secondary: #22d3ee;
    --accent-success: #34d399;
    --accent-warning: #fbbf24;
    --accent-error: #f87171;
    
    --border-primary: rgba(148, 163, 184, 0.2);
    --border-secondary: rgba(148, 163, 184, 0.1);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
    
    --gradient-primary: linear-gradient(135deg, #60a5fa 0%, #22d3ee 100%);
    --gradient-secondary: linear-gradient(135deg, #818cf8 0%, #a78bfa 100%);
}

/* ===== UTILITY CLASSES ===== */
.hidden { display: none !important; }
.visible { display: block !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-inverse);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===== LOADER ===== */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: var(--blur-sm);
}

.loader-content {
    text-align: center;
    color: var(--text-inverse);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loader-text {
    font-size: 1.125rem;
    font-weight: 500;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== HEADER ===== */
.header {
    background: var(--gradient-primary);
    backdrop-filter: var(--blur-md);
    border-bottom: 1px solid var(--border-secondary);
    position: sticky;
    top: 0;
    z-index: 1002;
    box-shadow: var(--shadow-md);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    gap: 1rem;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    min-width: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-inverse);
    font-weight: 700;
    font-size: 1.25rem;
    transition: all var(--transition-normal);
}

.logo:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

.logo-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.logo-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.logo-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-inverse);
    transition: all var(--transition-normal);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Navigation */
.nav-menu {
    display: flex;
    align-items: center;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-inverse);
    text-decoration: none;
    font-weight: 500;
    border-radius: var(--radius-md);
    transition: all var(--transition-normal);
    position: relative;
}

.nav-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--text-inverse);
    transition: all var(--transition-normal);
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 80%;
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-inverse);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    flex-shrink: 0;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.action-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* Theme Toggle */
.theme-toggle .theme-icon {
    transition: all var(--transition-normal);
}

.theme-toggle:hover .theme-icon {
    transform: rotate(180deg);
}

/* Download Button */
.download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-inverse);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.download-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.download-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.download-text {
    white-space: nowrap;
}

/* User Profile */
.user-profile {
    position: relative;
}

.user-avatar-btn {
    display: flex;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 50%;
    padding: 2px;
    transition: all var(--transition-normal);
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.3);
    transition: all var(--transition-normal);
}

.user-avatar-btn:hover .user-avatar {
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.user-status {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid var(--text-inverse);
}

.user-status.online {
    background: var(--accent-success);
}

.user-status.offline {
    background: var(--text-tertiary);
}

/* Profile Dropdown */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--bg-card);
    backdrop-filter: var(--blur-md);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 0.5rem 0;
    min-width: 240px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-normal);
    z-index: 100;
}

.user-profile:hover .profile-dropdown,
.profile-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-secondary);
}

.profile-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.profile-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.profile-divider {
    height: 1px;
    background: var(--border-secondary);
    margin: 0.5rem 0;
}

.profile-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
}

.profile-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.profile-menu-item.logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-error);
}

.profile-menu-item svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.auth-menu {
    padding: 0.5rem;
}

.auth-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
    margin-bottom: 0.5rem;
}

.auth-btn.login {
    background: var(--gradient-primary);
    color: var(--text-inverse);
}

.auth-btn.register {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.auth-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: var(--blur-sm);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.mobile-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 4rem;
    padding: 2rem 0;
}

.hero-content {
    z-index: 2;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.hero-subtitle {
    display: block;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--accent-primary);
    margin-top: 0.5rem;
}

.hero-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.7;
}

.hero-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Hero Visual */
.hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-cards {
    position: relative;
    width: 300px;
    height: 300px;
}

.floating-card {
    position: absolute;
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-inverse);
    box-shadow: var(--shadow-lg);
    animation: float 6s ease-in-out infinite;
}

.floating-card svg {
    width: 40px;
    height: 40px;
}

.floating-card.card-1 {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-card.card-2 {
    top: 60%;
    right: 20%;
    animation-delay: 2s;
    background: var(--gradient-secondary);
}

.floating-card.card-3 {
    bottom: 20%;
    left: 30%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* ===== AD BANNERS ===== */
.ad-banner {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
    padding: 1rem;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-secondary);
}

.ad-banner.native {
    background: transparent;
    border: none;
}

/* ===== SERVICES SECTIONS ===== */
.services-section {
    margin-bottom: 4rem;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.section-icon {
    width: 32px;
    height: 32px;
    stroke: var(--accent-primary);
}

.section-description {
    font-size: 1.125rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.institutions-grid {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.service-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-card);
    backdrop-filter: var(--blur-sm);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.service-card:hover::before {
    left: 100%;
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.service-icon {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    transition: all var(--transition-normal);
}

.service-card:hover .service-icon {
    background: var(--accent-primary);
    transform: scale(1.1);
}

.service-icon img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.service-content {
    flex: 1;
}

.service-content h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.service-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.service-arrow {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--text-tertiary);
    transition: all var(--transition-normal);
}

.service-card:hover .service-arrow {
    color: var(--accent-primary);
    transform: translateX(4px);
}

.service-arrow svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

/* Featured Cards */
.service-card.featured {
    border: 2px solid var(--accent-primary);
    background: linear-gradient(135deg, var(--bg-card), var(--bg-card-hover));
}

.service-card.featured .service-icon {
    background: var(--accent-primary);
    color: var(--text-inverse);
}

/* Institution Cards */
.institution-card .service-content h3 {
    font-size: 0.875rem;
}

/* View All Button */
.view-all-container {
    text-align: center;
    margin-top: 2rem;
}

.view-all-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    color: var(--text-inverse);
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-weight: 500;
    transition: all var(--transition-normal);
}

.view-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.view-all-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    transition: transform var(--transition-normal);
}

.view-all-btn:hover svg {
    transform: translateX(4px);
}

/* ===== HISTORY PANEL ===== */
.history-panel {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-card);
    backdrop-filter: var(--blur-md);
    border-left: 1px solid var(--border-primary);
    box-shadow: var(--shadow-xl);
    z-index: 2000;
    transition: right var(--transition-slow);
    overflow: hidden;
}

.history-panel.active {
    right: 0;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-secondary);
    background: var(--bg-secondary);
}

.history-header h3 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.history-header svg {
    width: 20px;
    height: 20px;
    stroke: var(--accent-primary);
}

.close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.close-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.history-content {
    padding: 1.5rem;
    height: calc(100vh - 80px);
    overflow-y: auto;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-secondary);
    transition: all var(--transition-normal);
}

.history-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
    transform: translateX(4px);
}

.history-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    border-radius: var(--radius-md);
    color: var(--text-inverse);
}

.history-icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.history-details h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.history-details p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 2rem 0;
}

.empty-state svg {
    width: 64px;
    height: 64px;
    stroke: var(--text-tertiary);
    margin-bottom: 1rem;
}

.empty-state h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--gradient-primary);
    color: var(--text-inverse);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ===== MODALS ===== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: var(--blur-sm);
}

.modal-content {
    position: relative;
    background: var(--bg-card);
    backdrop-filter: var(--blur-md);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 400px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform var(--transition-normal);
}

.modal.active .modal-content {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-secondary);
    background: var(--bg-secondary);
}

.modal-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    text-align: center;
}

.modal-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary);
    border-radius: 50%;
    color: var(--text-inverse);
}

.modal-icon svg {
    width: 32px;
    height: 32px;
    stroke: currentColor;
}

.modal-body p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-secondary);
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr;
    gap: 2rem;
    padding: 3rem 0;
}

.footer-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.footer-logo .logo-icon {
    width: 32px;
    height: 32px;
    color: var(--accent-primary);
}

.footer-logo .logo-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.footer-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-stats {
    display: flex;
    gap: 1.5rem;
}

.footer-stat {
    display: flex;
    flex-direction: column;
}

.footer-stat .stat-number {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.footer-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: color var(--transition-normal);
}

.footer-links a:hover {
    color: var(--accent-primary);
}

.download-app-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--gradient-primary);
    color: var(--text-inverse);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
    margin-bottom: 1rem;
}

.download-app-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.download-app-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.app-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.app-version {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.app-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stars {
    color: var(--accent-warning);
    font-size: 0.875rem;
}

.rating {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.footer-bottom {
    border-top: 1px solid var(--border-secondary);
    padding: 1.5rem 0;
}

.footer-bottom-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-bottom p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    color: var(--text-secondary);
    transition: all var(--transition-normal);
}

.footer-social a:hover {
    background: var(--accent-primary);
    color: var(--text-inverse);
    transform: translateY(-2px);
}

.footer-social svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ===== FLOATING ACTION BUTTON ===== */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.fab {
    width: 56px;
    height: 56px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: var(--text-inverse);
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

.fab svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

.fab-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: var(--text-primary);
    color: var(--text-inverse);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-normal);
    margin-bottom: 0.5rem;
}

.fab:hover .fab-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    width: 48px;
    height: 48px;
    background: var(--bg-card);
    backdrop-filter: var(--blur-md);
    border: 1px solid var(--border-primary);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--accent-primary);
    color: var(--text-inverse);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.back-to-top svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablets y dispositivos medianos */
@media (min-width: 769px) and (max-width: 1024px) {
    .hero-visual {
        display: none;
    }
    
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
    
    .footer-content {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }
    
    .download-text {
        display: none;
    }
    
    .header-actions {
        gap: 0.375rem;
    }
    
    .nav-links {
        gap: 0.25rem;
    }
    
    .nav-link {
        padding: 0.625rem 0.875rem;
        font-size: 0.875rem;
    }
}

/* Móviles */
@media (max-width: 768px) {
    .header-content {
        padding: 0.75rem 0;
        gap: 0.5rem;
    }
    
    .header-left {
        flex: 1;
        min-width: 0;
    }
    
    .logo {
        font-size: 1rem;
        gap: 0.5rem;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
        flex-shrink: 0;
    }
    
    .logo-text {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Mobile menu toggle */
    .mobile-menu-toggle {
        display: flex;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.15);
        border-radius: var(--radius-md);
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.25);
    }
    
    /* Navigation móvil */
    .nav-menu {
        position: fixed;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-card);
        backdrop-filter: var(--blur-md);
        border-top: 1px solid var(--border-primary);
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all var(--transition-normal);
        z-index: 1001;
        max-height: calc(100vh - 80px);
        overflow-y: auto;
    }
    
    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .nav-links {
        flex-direction: column;
        padding: 1rem;
        gap: 0.25rem;
    }
    
    .nav-link {
        width: 100%;
        justify-content: flex-start;
        padding: 1rem 1.25rem;
        color: var(--text-primary);
        border-radius: var(--radius-lg);
        font-weight: 500;
        background: transparent;
        margin-bottom: 0.25rem;
    }
    
    .nav-link::after {
        display: none;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background: var(--bg-tertiary);
        color: var(--accent-primary);
        transform: none;
    }
    
    /* Header actions optimizadas */
    .header-actions {
        gap: 0.25rem;
        flex-shrink: 0;
    }
    
    .action-btn {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
        background: rgba(255, 255, 255, 0.15);
        backdrop-filter: blur(8px);
        border: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .action-btn:hover {
        background: rgba(255, 255, 255, 0.25);
    }
    
    .action-btn svg {
        width: 18px;
        height: 18px;
    }
    
    /* Download button responsive */
    .download-btn {
        display: none;
    }
    
    .download-btn.mobile {
        display: flex;
        width: 36px;
        height: 36px;
        padding: 0;
        justify-content: center;
        align-items: center;
        border-radius: 50%;
    }
    
    .download-btn .download-text {
        display: none;
    }
    
    /* User profile responsive */
    .user-avatar {
        width: 32px;
        height: 32px;
        border-width: 1px;
    }
    
    .user-status {
        width: 10px;
        height: 10px;
        border-width: 1px;
    }
    
    /* Profile dropdown responsive */
    .profile-dropdown {
        right: -0.5rem;
        min-width: 280px;
        max-width: calc(100vw - 2rem);
    }
    
    .profile-header {
        padding: 0.75rem;
    }
    
    .profile-avatar {
        width: 40px;
        height: 40px;
    }
    
    .profile-info h3 {
        font-size: 0.875rem;
    }
    
    .profile-info p {
        font-size: 0.75rem;
    }
    
    .profile-menu-item {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    .auth-menu {
        padding: 0.75rem;
    }
    
    .auth-btn {
        padding: 0.875rem 1rem;
        font-size: 0.875rem;
    }
    
    /* Hero Section móvil */
    .hero-visual,
    .floating-cards,
    .floating-card {
        display: none !important;
        visibility: hidden !important;
    }
    
    .hero-section {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 1rem 0 2rem 0;
        margin-bottom: 2rem;
    }
    
    .hero-content {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .hero-title {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
        margin-top: 0.25rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    .hero-stats {
        flex-direction: row;
        gap: 1rem;
        margin-top: 1rem;
        justify-content: center;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .stat {
        min-width: 0;
        flex: 1;
    }
    
    .stat-number {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
        line-height: 1.2;
    }
    
    /* Contenido principal móvil */
    .main-content {
        padding: 1rem 0;
    }
    
    .services-section {
        margin-bottom: 2rem;
    }
    
    .section-header {
        margin-bottom: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
        margin-bottom: 0.5rem;
    }
    
    .section-description {
        font-size: 1rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .service-card {
        padding: 1rem;
        border-radius: var(--radius-md);
    }
    
    .service-icon {
        width: 48px;
        height: 48px;
    }
    
    .service-icon img {
        width: 32px;
        height: 32px;
    }
    
    /* History panel móvil */
    .history-panel {
        width: 100%;
        right: -100%;
    }
    
    /* Ad banners móvil */
    .ad-banner {
        margin: 1rem 0;
        padding: 0.5rem;
        border-radius: var(--radius-md);
        overflow: hidden;
    }
    
    .ad-banner.native {
        padding: 0;
    }
    
    /* Footer móvil */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 2rem;
    }
    
    .footer-stats {
        justify-content: center;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    /* Elementos flotantes móvil */
    .fab-container {
        bottom: 1rem;
        right: 1rem;
    }
    
    .back-to-top {
        bottom: 1rem;
        left: 1rem;
        width: 44px;
        height: 44px;
    }
}

/* Teléfonos muy pequeños */
@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .header-content {
        padding: 0.5rem 0;
    }
    
    .logo {
        font-size: 0.875rem;
    }
    
    .logo-icon {
        width: 24px;
        height: 24px;
    }
    
    .header-actions {
        gap: 0.125rem;
    }
    
    .action-btn {
        width: 32px;
        height: 32px;
    }
    
    .action-btn svg {
        width: 16px;
        height: 16px;
    }
    
    .mobile-menu-toggle {
        width: 36px;
        height: 36px;
    }
    
    .mobile-menu-toggle span {
        width: 20px;
    }
    
    .user-avatar {
        width: 28px;
        height: 28px;
    }
    
    .profile-dropdown {
        right: -1rem;
        min-width: calc(100vw - 2rem);
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .stat-number {
        font-size: 1.125rem;
    }
    
    .service-card {
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .service-content h3 {
        font-size: 0.875rem;
    }
    
    .service-content p {
        font-size: 0.8rem;
    }
    
    .modal-content {
        width: 95%;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .fab {
        width: 48px;
        height: 48px;
    }
    
    .fab svg {
        width: 20px;
        height: 20px;
    }
}

/* Mejoras para dispositivos con notch */
@supports (padding: max(0px)) {
    .header-container {
        padding-left: max(1rem, env(safe-area-inset-left));
        padding-right: max(1rem, env(safe-area-inset-right));
    }
    
    .nav-menu {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}

/* ===== OPTIMIZACIONES ADICIONALES ===== */

/* Prevenir overflow horizontal */
* {
    max-width: 100%;
}

img {
    height: auto;
    max-width: 100%;
}

/* Optimizaciones para dispositivos lentos */
.low-end-device * {
    animation-duration: 0.1s !important;
    transition-duration: 0.1s !important;
}

.low-end-device .floating-card {
    animation: none !important;
}

.low-end-device .backdrop-filter,
.low-end-device [style*="backdrop-filter"] {
    backdrop-filter: none !important;
}

/* Optimizaciones para conexión lenta */
.slow-connection * {
    animation-duration: 0.1s !important;
    transition-duration: 0.1s !important;
}

.slow-connection .backdrop-filter,
.slow-connection [style*="backdrop-filter"] {
    backdrop-filter: none !important;
}

/* Reducir movimiento para accesibilidad */
.reduced-motion * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
}

/* Navegación con teclado */
.using-keyboard *:focus {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* ===== SCROLLBAR STYLING ===== */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--text-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInFromRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Animation classes */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-in-right {
    animation: slideInFromRight 0.6s ease-out;
}

.animate-slide-in-left {
    animation: slideInFromLeft 0.6s ease-out;
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* ===== PRINT STYLES ===== */
@media print {
    .header,
    .footer,
    .fab-container,
    .back-to-top,
    .history-panel,
    .modal,
    .ad-banner {
        display: none !important;
    }
    
    .main-content {
        padding: 0;
    }
    
    .service-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}