﻿/* ====== Reset ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ====== Color Variables ====== */
:root {
    --primary-yellow: #f5d9b0;
    --primary-green: #6d7a42;
    --secondary-lime: #99a25c;
    --accent-light-yellow: #fff5e6;
    --light-yellow: #f9ecd3;
    --dark-green: #384631;
    --tomato-red: #c4623b;
    --gradient-primary: linear-gradient(135deg, #c4623b 0%, #6d7a42 100%);
    --gradient-secondary: linear-gradient(135deg, #f5d9b0 0%, #fff8ec 100%);
    --gradient-bg: linear-gradient(135deg, #f9ecd3 0%, #dccfb7 45%, #a5b07c 100%);
    --glass-bg: rgba(255, 255, 255, 0.2);
    --glass-border: rgba(255, 255, 255, 0.25);
    --text-light: #fffdf5;
    --text-dark: #2f2a1f;
    --text-readable: #2f2a1f;
    --text-secondary: #5c5443;
    --shadow-yellow: rgba(196, 98, 59, 0.18);
    --shadow-green: rgba(56, 70, 49, 0.2);
}

/* ====== Body Background ====== */
/* Default gradient background for main pages */
body {
    background: #f7f0e3;
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    color: var(--text-readable);
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(160deg, rgba(250, 221, 190, 0.35), rgba(118, 130, 86, 0.55), rgba(156, 170, 110, 0.45));
    filter: blur(120px);
    pointer-events: none;
    z-index: -1;
}

/* ====== Header ====== */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: rgba(247, 236, 215, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(96, 95, 78, 0.15);
    color: var(--text-readable);
    z-index: 1000;
    box-shadow: 0 8px 32px var(--shadow-yellow);
    transition: all 0.3s ease;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: 100%;
    padding: 0 30px;
    gap: 20px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-left: auto;
}

.profile-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(104, 94, 75, 0.15);
    border-radius: 8px;
    color: var(--text-readable);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.profile-link:hover {
    background: rgba(255, 255, 255, 0.65);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.profile-link i {
    font-size: 1.1rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.2rem;
    box-shadow: 0 4px 15px var(--shadow-yellow);
}

.top-header h1 {
    font-size: 1.8rem;
    font-weight: 700;
    transition: all 0.3s ease;
}

.top-header h1 a {
    color: var(--text-readable);
    text-decoration: none;
    transition: all 0.3s ease;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.top-header h1 a:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}


/* ====== Menu Button ====== */
#menuBtn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--primary-yellow);
    cursor: pointer;
    padding: 12px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 1.1rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#menuBtn:hover {
    background: var(--gradient-primary);
    border-color: var(--primary-yellow);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--shadow-yellow);
}

/* ====== Sidebar ====== */
.sidebar {
    position: fixed;
    top: 80px;
    left: 0;
    width: 320px;
    height: calc(100vh - 80px);
    max-height: calc(100vh - 80px);
    background: linear-gradient(140deg,
        rgba(118, 130, 86, 0.92),
        rgba(236, 212, 179, 0.95) 60%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-right: 1px solid rgba(72, 68, 50, 0.2);
    color: var(--text-readable);
    padding: 0;
    padding-bottom: 20px;
    overflow-y: auto !important;
    overflow-x: hidden;
    transition: all 0.3s ease;
    z-index: 900;
    box-shadow: 8px 0 32px var(--shadow-green);
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: rgba(118, 130, 86, 0.3) transparent;
}

/* Ensure sidebar content wrapper allows scrolling to bottom */
.sidebar > * {
    flex-shrink: 0;
}

/* Ensure all nav-sections are visible and not hidden */
.sidebar .nav-section {
    visibility: visible !important;
    opacity: 1 !important;
}

.sidebar.collapsed {
    transform: translateX(-320px);
}


/* ====== Sidebar Scrollbar ====== */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
    margin: 10px 0;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(118, 130, 86, 0.3);
    border-radius: 3px;
    border: none;
    box-shadow: none;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(118, 130, 86, 0.5);
}

/* ====== Sidebar Header ====== */
.sidebar-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 15px var(--shadow-yellow);
}

.user-info h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-readable);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.user-info p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* ====== Sidebar Content ====== */
.nav-section {
    margin: 5px 25px;
    margin-bottom: 5px;
    flex-grow: 0;
    flex-shrink: 0;
    min-height: fit-content;
}

/* Specifically ensure minicapstone link is visible */
.sidebar .nav-link[data-page="minicapstone.html"],
.sidebar .minicapstone-link,
.sidebar #minicapstone-nav-link {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 2 !important;
    background: rgba(196, 98, 59, 0.18) !important;
    border: 2px solid rgba(196, 98, 59, 0.55) !important;
    margin-bottom: 8px !important;
    height: auto !important;
    min-height: 40px !important;
    width: 100% !important;
    color: var(--text-readable) !important;
}

/* Ensure the last nav-section is visible */
.sidebar .nav-section:last-of-type {
    margin-bottom: 5px;
}

.nav-section strong {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-readable);
    padding: 2px 0;
    background: none;
    border: none;
    cursor: default;
    pointer-events: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.nav-section strong i {
    color: #ffffff;
    font-size: 1rem;
    opacity: 1;
}

.nav-section a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    color: var(--text-readable);
    text-decoration: none;
    border-radius: 12px;
    margin-bottom: 6px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(94, 90, 70, 0.18);
    backdrop-filter: blur(6px);
    font-weight: 600;
    font-size: 0.95rem;
    text-shadow: none;
    position: relative;
    overflow: hidden;
}

.nav-section a:nth-of-type(2n) {
    background: rgba(247, 232, 205, 0.75);
    border-color: rgba(149, 138, 107, 0.25);
}

.nav-section a::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: border-color 0.3s ease;
    pointer-events: none;
}

.nav-section a i {
    color: var(--tomato-red);
    font-size: 1rem;
    width: 16px;
    text-align: center;
}

.nav-section a:hover {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(196, 98, 59, 0.45);
    color: var(--text-readable);
    transform: translateX(8px);
    box-shadow: 0 10px 28px rgba(255, 215, 0, 0.35);
}

.nav-section a:hover i {
    color: var(--tomato-red);
}

.nav-section a:active {
    transform: translateX(4px) scale(0.98);
}

/* Active navigation state */
.nav-section a.active {
    background: rgba(196, 98, 59, 0.2);
    border-color: rgba(196, 98, 59, 0.65);
    color: var(--text-readable);
    box-shadow: 0 12px 32px rgba(196, 98, 59, 0.25);
}

.nav-section a.active i {
    color: var(--tomato-red);
}

/* ====== Main Content ====== */
.main-content {
    margin-left: 320px;
    transition: margin-left 0.3s ease;
    padding-top: 80px;
    min-height: calc(100vh - 80px);
    position: relative;
}   

/* Adjust main content when sidebar collapsed */
.sidebar.collapsed ~ .main-content,
.main-content.collapsed {
    margin-left: 0;
}

/* ====== Welcome Panel ====== */
.welcome-panel {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 80px);
    padding: 40px 20px;
    position: relative;
}

.welcome-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    max-width: 1200px;
    width: 100%;
}

.welcome-text {
    color: #1f2937;
}

.welcome-text h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 30px;
    color: #1f2937;
    text-shadow: none;
    line-height: 1.1;
}

.welcome-text p {
    font-size: 1.2rem;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 40px;
    font-weight: 500;
    text-shadow: none;
}

.welcome-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.primary-btn, .secondary-btn {
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.primary-btn {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 6px 20px var(--shadow-yellow);
}

.primary-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--shadow-yellow);
}

.secondary-btn {
    background: var(--glass-bg);
    color: var(--text-readable);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
}

.secondary-btn:hover {
    background: var(--gradient-secondary);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px var(--shadow-green);
}

/* ====== Welcome Visual ====== */
.welcome-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-cards {
    position: relative;
    width: 300px;
    height: 300px;
}

.floating-cards .card {
    position: absolute;
    width: 80px;
    height: 80px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-readable);
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 8px 32px var(--shadow-yellow);
    transition: all 0.3s ease;
    cursor: pointer;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.floating-cards .card i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: var(--tomato-red);
}

.floating-cards .card:hover {
    transform: translateY(-10px) scale(1.1);
    box-shadow: 0 15px 40px var(--shadow-yellow);
    background: var(--gradient-primary);
}

.floating-cards .card:hover i {
    color: white;
}

.card-1 {
    top: 20px;
    left: 50px;
    animation: float 3s ease-in-out infinite;
}

.card-2 {
    top: 120px;
    right: 20px;
    animation: float 3s ease-in-out infinite 1s;
}

.card-3 {
    bottom: 20px;
    left: 20px;
    animation: float 3s ease-in-out infinite 2s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* ====== Logout Button ====== */
.logout-btn {
    margin-top: auto;
    margin: 10px 25px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: rgba(196, 98, 59, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(196, 98, 59, 0.35);
    color: var(--text-light);
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.logout-btn i {
    font-size: 1.1rem;
}

.logout-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.logout-btn:hover {
    background: rgba(173, 80, 47, 0.95);
    border-color: rgba(196, 98, 59, 0.6);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(196, 98, 59, 0.35);
}

.logout-btn:hover::before {
    left: 100%;
}

.logout-btn:active {
    transform: translateY(0) scale(0.98);
}

/* ====== Notifications ====== */
.notification {
    position: fixed;
    top: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    padding: 16px 20px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 2000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.notification.show {
    top: 20px;
    opacity: 1;
}

.notification.success {
    background: rgba(16, 185, 129, 0.9);
    color: white;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.notification.error {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.notification.warning {
    background: rgba(245, 158, 11, 0.9);
    color: white;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.notification.info {
    background: rgba(59, 130, 246, 0.9);
    color: white;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* ====== Responsive ====== */
@media screen and (max-width: 1200px) {
    .welcome-content {
        grid-template-columns: 1fr;
        gap: 40px;
        text-align: center;
    }
    
    .welcome-text h1 {
        font-size: 3.5rem;
    }
    
    .floating-cards {
        width: 250px;
        height: 250px;
    }
}

@media screen and (max-width: 992px) {
    .header-content {
        padding: 0 20px;
    }
    
    .sidebar {
        width: 280px;
    }

    .sidebar.collapsed {
        transform: translateX(-280px);
    }

    .main-content {
        margin-left: 280px;
    }
    
    .welcome-text h1 {
        font-size: 3rem;
    }
    
    .welcome-text p {
        font-size: 1.1rem;
    }
    
    .welcome-actions {
        justify-content: center;
    }
}

@media screen and (max-width: 768px) {
    .welcome-panel {
        padding: 20px 15px;
    }
    
    .welcome-content {
        gap: 30px;
    }
    
    .welcome-text h1 {
        font-size: 2.5rem;
    }
    
    .welcome-text p {
        font-size: 1rem;
    }
    
    .primary-btn, .secondary-btn {
        padding: 14px 24px;
        font-size: 0.95rem;
    }
    
    .floating-cards {
        width: 200px;
        height: 200px;
    }
    
    .floating-cards .card {
        width: 60px;
        height: 60px;
        font-size: 0.75rem;
    }
    
    .floating-cards .card i {
        font-size: 1.2rem;
        margin-bottom: 4px;
    }
}

@media screen and (max-width: 600px) {
    .sidebar {
        width: 260px;
    }

    .sidebar.collapsed {
        transform: translateX(-260px);
    }

    .main-content {
        margin-left: 260px;
    }
    
    .welcome-text h1 {
        font-size: 2rem;
    }
    
    .welcome-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .primary-btn, .secondary-btn {
        width: 100%;
        max-width: 280px;
        justify-content: center;
    }
}