/**
 * Base Stylesheet — منصة الرحلة التعليمية
 * Clean Architecture - Core Layout & Navigation
 */

@import url('tokens.css');

body {
    font-family: 'Tajawal', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
}

/* ============================================================
   CONTENT & IMAGE PROTECTION (منع حفظ وسحب الصور)
   ============================================================ */
img {
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    user-drag: none;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* ============================================================
   NAVBAR
   ============================================================ */
.pixel-navbar {
    background-color: var(--color-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    height: 80px;
}

/* Logo Area */
.nav-logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.nav-logo-img {
    height: 40px;
    width: auto;
    border-radius: var(--radius-sm);
}

.nav-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.nav-logo-title {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary-light);
}

.nav-logo-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Nav Links */
.nav-links-area {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 10px;
}

.nav-link-custom {
    height: 100%;
    display: flex;
    align-items: center;
    padding: 0 15px;
    color: #4B5563;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    position: relative;
    transition: all var(--transition-smooth);
}

.nav-link-custom:hover {
    color: var(--primary-blue);
}

/* Animated bottom indicator on hover */
.nav-link-custom::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 3px;
    background-color: var(--primary-blue);
    transition: all var(--transition-smooth);
    transform: translateX(-50%);
    border-radius: 3px 3px 0 0;
    opacity: 0;
}

.nav-link-custom:hover::after {
    width: 100%;
    opacity: 1;
}

/* Active State */
.nav-link-custom.active {
    color: var(--primary-blue);
}

.nav-link-custom.active::after {
    width: 100%;
    opacity: 1;
}

/* User Area */
.nav-user-area {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Share Button */
.nav-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-full);
    border: none;
    background: linear-gradient(135deg, var(--primary-light), var(--primary-blue));
    color: white;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.35);
    flex-shrink: 0;
}

.nav-share-btn:hover {
    transform: scale(1.10);
    box-shadow: 0 5px 18px rgba(37, 99, 235, 0.50);
}

.nav-share-btn:active {
    transform: scale(0.95);
}

/* Toast notification */
.share-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1E293B;
    color: white;
    padding: 10px 22px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
    white-space: nowrap;
}

.share-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.nav-icon-btn {
    background: none;
    border: none;
    color: var(--text-dark);
    font-size: 1.2rem;
    position: relative;
    cursor: pointer;
}

.nav-icon-btn .badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background-color: var(--color-danger);
    color: white;
    font-size: 0.6rem;
    border-radius: var(--radius-full);
    padding: 3px 5px;
}

.user-profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: var(--bg-body);
    padding: 6px 12px 6px 16px;
    border-radius: 30px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

.user-profile-btn img,
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background-color: #9CA3AF;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 8px 0;
    text-align: right;
}

.dropdown-item {
    padding: 8px 20px;
    font-weight: 500;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.dropdown-item i {
    color: var(--text-muted);
}

.dropdown-item:hover {
    background-color: var(--bg-body);
    color: var(--primary-light);
}

/* Mobile Toggle */
.mobile-toggle {
    display: none;
    font-size: 1.5rem;
    background: none;
    border: none;
    color: var(--text-dark);
}

@media (max-width: 991px) {
    .nav-links-area {
        display: none;
        position: absolute;
        top: 80px;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        height: auto;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
        padding: 10px 0;
    }
    .nav-links-area.show {
        display: flex;
    }
    .nav-link-custom {
        padding: 12px 24px;
        width: 100%;
        border-bottom: 1px solid #f3f4f6;
    }
    .nav-link-custom.active::after {
        display: none;
    }
    .mobile-toggle {
        display: block;
    }
    .nav-user-area {
        gap: 10px;
    }
    .user-profile-text {
        display: none;
    }
}

/* ============================================================
   MAIN CONTAINER
   ============================================================ */
.app-container {
    max-width: 1400px;
    margin: 30px auto;
    padding: 0 24px;
}

/* ============================================================
   TOAST NOTIFICATIONS (FIXED POP-UP ON RIGHT)
   ============================================================ */
.toast-container-fixed {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100050;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 440px;
    width: calc(100% - 48px);
    pointer-events: none;
}

.toast-item {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px 18px 16px;
    background: #FFFFFF;
    color: var(--text-dark, #1F2937);
    border-radius: 16px;
    box-shadow: 0 12px 35px -4px rgba(0, 0, 0, 0.14),
                0 4px 12px -2px rgba(0, 0, 0, 0.06),
                0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: pan-y;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.35s ease,
                max-height 0.35s ease,
                margin 0.35s ease,
                padding 0.35s ease;
    will-change: transform, opacity;
}

.toast-item.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-item.toast-swiping {
    transition: none !important;
    cursor: grabbing;
}

.toast-item.toast-dismissing {
    opacity: 0 !important;
    pointer-events: none;
    max-height: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    transition: transform 0.3s ease,
                opacity 0.25s ease,
                max-height 0.3s 0.1s ease,
                margin 0.3s 0.1s ease,
                padding 0.3s 0.1s ease !important;
}

/* Side indicator line */
.toast-indicator {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 5px;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
}

/* Toast Icons & Theming */
.toast-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
}

/* Success Type */
.toast-success {
    border: 1px solid rgba(16, 185, 129, 0.3);
}
.toast-success .toast-indicator {
    background: #10B981;
}
.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.14);
    color: #059669;
}
.toast-success .toast-progress-fill {
    background: #10B981;
}

/* Danger / Error Type */
.toast-danger, .toast-error {
    border: 1px solid rgba(239, 68, 68, 0.3);
}
.toast-danger .toast-indicator, .toast-error .toast-indicator {
    background: #EF4444;
}
.toast-danger .toast-icon, .toast-error .toast-icon {
    background: rgba(239, 68, 68, 0.14);
    color: #DC2626;
}
.toast-danger .toast-progress-fill, .toast-error .toast-progress-fill {
    background: #EF4444;
}

/* Warning Type */
.toast-warning {
    border: 1px solid rgba(245, 158, 11, 0.3);
}
.toast-warning .toast-indicator {
    background: #F59E0B;
}
.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.14);
    color: #D97706;
}
.toast-warning .toast-progress-fill {
    background: #F59E0B;
}

/* Info Type */
.toast-info {
    border: 1px solid rgba(37, 99, 235, 0.3);
}
.toast-info .toast-indicator {
    background: #2563EB;
}
.toast-info .toast-icon {
    background: rgba(37, 99, 235, 0.14);
    color: #1D4ED8;
}
.toast-info .toast-progress-fill {
    background: #2563EB;
}

/* Toast Body */
.toast-body {
    flex: 1;
    min-width: 0;
    padding-left: 6px;
}

.toast-text {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    color: #1F2937;
    word-break: break-word;
}

/* Toast Close Button */
.toast-close-btn {
    flex-shrink: 0;
    background: transparent;
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    color: #9CA3AF;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-left: -4px;
}

.toast-close-btn:hover {
    color: #1F2937;
    background: rgba(0, 0, 0, 0.06);
}

/* Toast Progress Bar */
.toast-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3.5px;
    background: rgba(0, 0, 0, 0.06);
}

.toast-progress-fill {
    height: 100%;
    width: 100%;
    transform-origin: right;
}

/* Responsive across all screen sizes */
@media (max-width: 576px) {
    .toast-container-fixed {
        top: 14px;
        right: 14px;
        left: 14px;
        width: auto;
        max-width: none;
        gap: 10px;
    }
    .toast-item {
        padding: 12px 14px 15px 14px;
        border-radius: 14px;
    }
    .toast-icon {
        width: 36px;
        height: 36px;
        font-size: 1.15rem;
    }
    .toast-text {
        font-size: 0.88rem;
    }
}

/* ============================================================
   FOOTER & FEATURES BAR
   ============================================================ */
.features-bar {
    background-color: var(--color-white);
    margin-top: 40px;
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
}

.feature-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-dark);
}

.feature-icon {
    color: var(--primary-light);
    font-size: 1.5rem;
}

.feature-text h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
}

.feature-text p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

/* ============================================================
   RESPONSIVE ENHANCEMENTS (Mobile to 4K Screens)
   ============================================================ */
@media (max-width: 480px) {
    .navbar-container {
        padding: 0 14px;
        height: 70px;
    }
    .nav-logo-subtitle {
        display: none;
    }
    .nav-logo-title {
        font-size: 1.05rem;
    }
    .nav-logo-img {
        height: 34px;
    }
    .app-container {
        margin: 16px auto;
        padding: 0 14px;
    }
    .features-bar {
        padding: 16px 0;
    }
}

@media (min-width: 2000px) {
    .navbar-container,
    .app-container {
        max-width: 1700px;
    }
}

