/* ===========================================
   BASE.CSS - ITU UltiMate Shared Styles
   Consolidated from all page-specific CSS files
   =========================================== */

/* --- CSS Variables for Theme --- */
:root {
    --primary-color: #062a54;
    --primary-color-light: #0a3d6f;
    --secondary-color: #00a8cc;
    --text-color-light: #f4f4f4;
    --text-color-dark: #333;
    --text-muted: #666;
    --bg-color-light: #ffffff;
    --bg-color-grey: #f8f9fa;
    --border-color: #e9ecef;
    --card-shadow: 0 4px 15px rgba(6, 42, 84, 0.1);
    --transition: all 0.3s ease-in-out;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --danger-hover: #c82333;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color-light);
    color: var(--text-color-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

h1,
h2,
h3 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

/* --- Buttons --- */
.btn {
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    display: inline-block;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--text-color-light);
}

.btn-primary:hover {
    background-color: var(--primary-color-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(6, 42, 84, 0.3);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--bg-color-light);
}

.btn-secondary:hover {
    background-color: #0096b3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 168, 204, 0.3);
}

/* --- Header & Navigation --- */
.header {
    background-color: var(--bg-color-light);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding: 0 20px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.1;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-logo img {
    height: 40px;
    width: auto;
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
    height: 100%;
}

.nav-link {
    color: var(--text-color-dark);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    display: flex;
    align-items: center;
}

.nav-link:hover {
    color: var(--secondary-color);
}

.nav-link::after {
    content: '';
    width: 0;
    height: 2px;
    background: var(--secondary-color);
    position: absolute;
    bottom: -5px;
    left: 0;
    transition: width 0.3s ease;
}

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

/* Navbar Button Override */
.nav-menu .btn-primary {
    width: auto !important;
    margin-top: 0 !important;
    padding: 8px 20px !important;
    display: inline-block;
}

/* --- Hamburger Menu --- */
.hamburger {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--primary-color);
    transition: var(--transition);
}

/* --- Footer --- */
.footer {
    background-color: var(--primary-color);
    color: var(--text-color-light);
    text-align: center;
    padding: 2rem 0;
    font-size: 0.9rem;
}

.footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.footer-link {
    color: var(--text-color-light);
    text-decoration: none;
    font-size: 0.85rem;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-link:hover {
    opacity: 1;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icon {
    color: white;
    font-size: 1.1rem;
    opacity: 0.8;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.social-icon:hover {
    opacity: 1;
    transform: scale(1.1);
}

.footer-right p {
    margin: 0;
}

/* --- Navigation Dropdown Menu (Not Defteri, etc.) --- */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-dropdown-trigger {
    color: var(--text-color-dark);
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    padding: 8px 0;
}

.nav-dropdown-trigger:hover {
    color: var(--secondary-color);
}

.nav-dropdown-trigger i.fa-chevron-down {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-trigger i.fa-chevron-down {
    transform: rotate(180deg);
}

.nav-dropdown-content {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    background-color: var(--bg-color-light);
    min-width: 200px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    z-index: 1001;
    border: 1px solid var(--border-color);
    overflow: hidden;
    padding: 8px 0;
}

.nav-dropdown-content a {
    color: var(--text-color-dark);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.nav-dropdown-content a:hover {
    background-color: var(--bg-color-grey);
    color: var(--secondary-color);
}

.nav-dropdown-content a i {
    width: 18px;
    text-align: center;
    color: var(--secondary-color);
}

.nav-dropdown:hover .nav-dropdown-content {
    display: block;
}

/* --- User Dropdown Menu --- */
.user-dropdown {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 0;
}

.user-email {
    font-weight: 600;
    color: var(--secondary-color) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* User Avatar in Navbar */
.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--secondary-color);
    flex-shrink: 0;
}

/* Fallback Avatar */
.avatar-fallback {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.dropdown-content {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: var(--bg-color-light);
    min-width: 180px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    z-index: 1001;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.dropdown-content a {
    color: var(--text-color-dark);
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.dropdown-content a:hover {
    background-color: var(--bg-color-grey);
    color: var(--secondary-color);
}

.dropdown-content a.logout {
    border-top: 1px solid var(--border-color);
    color: var(--danger-color);
}

.dropdown-content a.logout:hover {
    background-color: #fef2f2;
}

.user-dropdown:hover .dropdown-content {
    display: block;
}

/* --- Loading Overlay & Spinner --- */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color-light);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* --- Page Title (Shared) --- */
.page-title {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
}

/* --- Responsive Navigation --- */
@media (max-width: 768px),
(max-height: 500px) and (orientation: landscape) {
    .hamburger {
        display: block;
        z-index: 10003;
        cursor: pointer;
        transition: all 0.3s ease;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Full-screen overlay menu */
    .nav-menu {
        position: fixed;
        left: 0;
        top: 0;
        width: 100%;
        flex-direction: column;
        background: #062a54;
        text-align: center;
        justify-content: center;
        align-items: center;
        z-index: 10002;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-100%);
        transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-menu.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        display: flex !important;
    }

    /* Navigation items styling - compact and centered */
    .nav-item {
        width: 100%;
        margin: 0;
        padding: 4px 0;
        opacity: 0;
        transform: translateY(10px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-menu.active .nav-item {
        opacity: 1;
        transform: translateY(0);
    }

    /* Stagger animation for nav items */
    .nav-menu.active .nav-item:nth-child(1) {
        transition-delay: 0.05s;
    }

    .nav-menu.active .nav-item:nth-child(2) {
        transition-delay: 0.1s;
    }

    .nav-menu.active .nav-item:nth-child(3) {
        transition-delay: 0.15s;
    }

    .nav-menu.active .nav-item:nth-child(4) {
        transition-delay: 0.2s;
    }

    .nav-menu.active .nav-item:nth-child(5) {
        transition-delay: 0.25s;
    }

    .nav-link {
        display: inline-block;
        padding: 8px 30px;
        font-size: 1.3rem;
        font-weight: 600;
        color: var(--text-color-light);
        width: auto;
        transition: all 0.3s ease;
        border-radius: 8px;
        position: relative;
        white-space: nowrap;
    }

    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 3px;
        left: 50%;
        width: 0;
        height: 2px;
        background: var(--secondary-color);
        transition: all 0.3s ease;
        transform: translateX(-50%);
        border-radius: 2px;
    }

    .nav-link:hover {
        color: var(--secondary-color);
        background: rgba(0, 168, 204, 0.1);
    }

    .nav-link:hover::after {
        width: 50%;
    }

    /* Adjust nav dropdown for mobile */
    .nav-dropdown {
        width: 100%;
        flex-direction: column;
    }

    .nav-dropdown-trigger {
        color: var(--text-color-light);
        font-size: 1.3rem;
        font-weight: 600;
        padding: 8px 30px;
    }

    .nav-dropdown-content {
        position: static;
        box-shadow: none;
        border: 2px solid rgba(0, 168, 204, 0.3);
        background-color: rgba(255, 255, 255, 0.95);
        display: none;
        margin-top: 5px;
        border-radius: 8px;
        max-width: 260px;
        padding: 8px 0;
    }

    .nav-dropdown:hover .nav-dropdown-content {
        display: none;
    }

    .nav-dropdown.active .nav-dropdown-content {
        display: block;
        animation: slideDown 0.3s ease;
    }

    .nav-dropdown-content a {
        color: var(--text-color-dark);
        padding: 12px 20px;
        font-size: 1rem;
    }

    /* Adjust user dropdown for mobile */
    .dropdown-content {
        position: static;
        box-shadow: none;
        border: 2px solid rgba(0, 168, 204, 0.3);
        background-color: rgba(255, 255, 255, 0.95);
        display: none;
        padding-top: 0;
        margin-top: 5px;
        border-radius: 8px;
        max-width: 260px;
        margin-left: auto;
        margin-right: auto;
    }

    .user-dropdown:hover .dropdown-content {
        display: none;
    }

    .user-dropdown.active .dropdown-content {
        display: block;
        padding: 10px 0;
        animation: slideDown 0.3s ease;
    }

    .dropdown-content a {
        color: var(--text-color-dark);
        padding: 12px 20px;
        font-size: 1rem;
    }

    .dropdown-content a:hover {
        background-color: var(--bg-color-grey);
        color: var(--secondary-color);
    }

    .dropdown-content a.logout {
        border-top: 2px solid var(--border-color);
        color: var(--danger-color);
        font-weight: 700;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-5px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Add close button for mobile menu */
    .menu-close-btn {
        position: fixed;
        top: 20px;
        right: 20px;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.1);
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 10004;
        transition: all 0.3s ease;
    }

    .menu-close-btn:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: var(--secondary-color);
        transform: rotate(90deg);
    }

    .menu-close-btn::before,
    .menu-close-btn::after {
        content: '';
        position: absolute;
        width: 20px;
        height: 2px;
        background: var(--text-color-light);
        border-radius: 2px;
    }

    .menu-close-btn::before {
        transform: rotate(45deg);
    }

    .menu-close-btn::after {
        transform: rotate(-45deg);
    }

    /* Landscape adjustments for mobile */
    @media (orientation: landscape) {
        .nav-menu {
            flex-direction: row;
            justify-content: center;
            align-items: center;
            gap: 15px;
        }

        .nav-item {
            width: auto;
            margin: 0;
            padding: 4px 0;
        }

        .nav-link {
            padding: 6px 20px;
            font-size: 1.1rem;
        }

        .menu-close-btn {
            top: 15px;
            right: 15px;
            width: 38px;
            height: 38px;
        }
    }
}

/* Force mobile menu on all small devices regardless of orientation */
@media (max-width: 1024px) and (max-height: 600px) {
    .hamburger {
        display: block;
    }

    .navbar .nav-menu {
        display: none;
    }

    .navbar .nav-menu.active {
        display: flex !important;
    }
}

/* --- Ultra-Small Screen Responsive (<400px) --- */
@media (max-width: 400px) {
    .page-title {
        font-size: 1.8rem;
    }

    .container {
        padding: 0 12px;
    }

    .navbar {
        height: 65px;
    }

    .nav-logo {
        font-size: 1.4rem;
    }

    .footer {
        padding: 1.5rem 0;
    }

    .footer .container {
        flex-direction: column;
        text-align: center;
    }

    .footer-left {
        align-items: center;
    }
}

/* ===========================================
   AUTH MODAL - Soft Access Restriction
   =========================================== */

/* Modal Overlay */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(6, 42, 84, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    animation: authModalFadeIn 0.3s ease forwards;
}

@keyframes authModalFadeIn {
    to {
        opacity: 1;
    }
}

/* Modal Card */
.auth-modal {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    padding: 2.5rem;
    max-width: 480px;
    width: 90%;
    position: relative;
    box-shadow:
        0 20px 60px rgba(6, 42, 84, 0.25),
        0 8px 24px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(233, 236, 239, 0.8);
    transform: translateY(20px);
    animation: authModalSlideUp 0.4s ease forwards;
}

@keyframes authModalSlideUp {
    to {
        transform: translateY(0);
    }
}

/* Close Button */
.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-color-grey);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--text-muted);
    font-size: 1.2rem;
}

.auth-modal-close:hover {
    background: var(--border-color);
    color: var(--text-color-dark);
    transform: rotate(90deg);
}

/* Modal Icon */
.auth-modal-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    box-shadow: 0 8px 24px rgba(6, 42, 84, 0.2);
}

/* Modal Content */
.auth-modal-title {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 1rem;
}

.auth-modal-message {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 2rem;
}

/* Modal CTA Button */
.auth-modal-cta {
    display: block;
    width: 100%;
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-color-light));
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(6, 42, 84, 0.3);
}

.auth-modal-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(6, 42, 84, 0.4);
}

.auth-modal-cta:active {
    transform: translateY(0);
}

/* Modal Dismiss Text */
.auth-modal-dismiss {
    display: block;
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s ease;
}

.auth-modal-dismiss:hover {
    color: var(--secondary-color);
}

/* Responsive Modal */
@media (max-width: 480px) {
    .auth-modal {
        padding: 2rem 1.5rem;
        margin: 0 15px;
        border-radius: 16px;
    }

    .auth-modal-icon {
        width: 60px;
        height: 60px;
        font-size: 1.6rem;
    }

    .auth-modal-title {
        font-size: 1.25rem;
    }

    .auth-modal-message {
        font-size: 0.95rem;
    }

    .auth-modal-cta {
        padding: 12px 24px;
    }
}