/* Global Reset & Variables */
:root {
    --bg-color: #0f172a;
    --text-color: #e2e8f0;
    --primary-color: #6366f1;
    /* Indigo 500 */
    --secondary-color: #ec4899;
    /* Pink 500 */
    --accent-color: #8b5cf6;
    /* Violet 500 */
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: #1e293b;
    --font-main: 'Inter', sans-serif;
    --transition-speed: 0.3s;
}

[data-theme="light"] {
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --primary-color: #4f46e5;
    --secondary-color: #db2777;
    --accent-color: #7c3aed;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --card-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

a {
    text-decoration: none;
    color: inherit;
    transition: color var(--transition-speed);
}

ul {
    list-style: none;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-bottom: 0.5rem;
    /* prevent clip */
}

/* Utility Classes */
.pt-header {
    padding-top: 100px;
    /* Clears fixed header */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(99, 102, 241, 0.23);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Glassmorphism Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo span {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--secondary-color);
    transition: width 0.3s;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Theme Toggle */
.theme-toggle {
    cursor: pointer;
    font-size: 1.2rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    transition: all 0.3s ease;
    border-radius: 3px;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Navigation Styles */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex !important;
    }

    .nav-links {
        position: fixed !important;
        top: 70px !important;
        right: -100% !important;
        width: 75% !important;
        max-width: 320px !important;
        height: calc(100vh - 70px) !important;
        background: linear-gradient(135deg,
                rgba(17, 24, 39, 0.98) 0%,
                rgba(31, 41, 55, 0.95) 100%) !important;
        backdrop-filter: blur(30px) saturate(180%) !important;
        -webkit-backdrop-filter: blur(30px) saturate(180%) !important;
        flex-direction: column !important;
        padding: 2.5rem 2rem !important;
        gap: 1rem !important;
        transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55) !important;
        border-left: 2px solid rgba(99, 102, 241, 0.3) !important;
        box-shadow: -10px 0 40px rgba(0, 0, 0, 0.5),
            inset 1px 0 0 rgba(255, 255, 255, 0.1) !important;
        z-index: 999 !important;
        display: flex !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        overflow-y: auto !important;
    }

    /* Gradient overlay for depth */
    .nav-links::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 150px;
        background: linear-gradient(180deg,
                rgba(99, 102, 241, 0.1) 0%,
                transparent 100%);
        pointer-events: none;
        z-index: 0;
    }

    .nav-links.active {
        right: 0 !important;
    }

    .nav-links a {
        font-size: 1.15rem !important;
        padding: 1rem 1.5rem !important;
        margin-bottom: 0.5rem !important;
        width: 100% !important;
        display: block !important;
        color: #ffffff !important;
        text-decoration: none !important;
        border-radius: 12px !important;
        transition: all 0.3s ease !important;
        position: relative !important;
        overflow: hidden !important;
        font-weight: 500 !important;
        z-index: 1 !important;
        background: rgba(255, 255, 255, 0.05) !important;
    }

    /* Animated gradient background on hover */
    .nav-links a::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg,
                transparent,
                rgba(99, 102, 241, 0.3),
                transparent);
        transition: left 0.5s;
        z-index: -1;
    }

    .nav-links a:hover::before {
        left: 100%;
    }

    .nav-links a:hover {
        background: rgba(99, 102, 241, 0.2) !important;
        transform: translateX(8px) !important;
        box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3) !important;
        color: #fff !important;
    }

    .nav-links a.active {
        background: linear-gradient(135deg,
                rgba(99, 102, 241, 0.3),
                rgba(236, 72, 153, 0.3)) !important;
        color: var(--primary-color) !important;
        border-left: 3px solid var(--primary-color) !important;
        font-weight: 600 !important;
    }

    .theme-toggle {
        order: -1;
        margin-top: auto !important;
        padding-top: 2rem !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    }
}

/* --- About Section --- */
.about-section {
    padding: 100px 0;
    position: relative;
    overflow: hidden;
}

/* Background blob effect */
.about-section::before {
    content: '';
    position: absolute;
    top: 50%;
    right: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(236, 72, 153, 0.2), transparent 70%);
    z-index: 0;
    pointer-events: none;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.about-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.about-content p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.feature-list {
    margin-bottom: 2rem;
}

.feature-list li {
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.feature-list li i {
    color: var(--secondary-color);
}

.developer-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 3rem 2rem;
    border-radius: 24px;
    text-align: center;
    transition: transform 0.3s;
    position: relative;
    backdrop-filter: blur(10px);
}

.developer-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    border-color: var(--primary-color);
}

.connect-highlight {
    color: #ffd700;
    /* Gold/Yellow */
    font-weight: 700;
    margin-top: 1rem;
    display: block;
    font-size: 1.05rem;
}

.text-highlight {
    color: #ffd700;
    font-weight: 700;
}

h1 .text-highlight {
    -webkit-text-fill-color: #ffd700;
}

.dev-avatar {
    width: 150px;
    /* Made slightly larger for better visibility */
    height: 150px;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    box-shadow: 0 10px 20px rgba(236, 72, 153, 0.3);
    overflow: hidden;
    /* Ensure image stays in circle */
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    /* Bouncy pop effect */
    border: 4px solid rgba(255, 255, 255, 0.1);
}

.dev-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dev-avatar:hover {
    transform: scale(1.15) rotate(2deg);
    /* Pop out and slight tilt */
    box-shadow: 0 15px 30px rgba(236, 72, 153, 0.5);
    border-color: var(--primary-color);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 2rem;
}

.social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.3s;
    color: var(--text-color);
}

.social-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.1);
    border-color: var(--primary-color);
}

@media (max-width: 768px) {
    .about-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .feature-list li {
        justify-content: center;
    }
}


/* Search & Filter Section */
.filters-section {
    background: #0f172a;
    /* Solid background to prevent transparency overlap issues */
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 70px;
    /* Aligns below fixed header */
    z-index: 900;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.search-container {
    max-width: 600px;
    margin: 0 auto 1.5rem;
    position: relative;
}

.search-bar {
    width: 100%;
    padding: 16px 24px;
    padding-left: 50px;
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-color);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.search-bar:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.4);
    font-size: 1.2rem;
}

/* Branch & Sem Filters */
.filters-row {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.filter-pills {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding-bottom: 5px;
    /* Scrollbar space */
    scrollbar-width: none;
    /* Firefox */
}

.filter-pills::-webkit-scrollbar {
    display: none;
}

.filter-pill {
    padding: 8px 20px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.filter-pill:hover,
.filter-pill.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* Mobile: Ensure filter pills scroll horizontally */
@media (max-width: 768px) {
    .filter-pills {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        -webkit-overflow-scrolling: touch;
    }

    .filter-pill {
        flex-shrink: 0 !important;
        min-width: fit-content !important;
    }
}

/* Redesigned Note Cards */
.notes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 3rem 0;
}

.note-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s ease;
    position: relative;
    display: flex;
    flex-direction: column;
}

.note-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.4);
    border-color: rgba(99, 102, 241, 0.3);
}

.note-card-header {
    height: 120px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.8), rgba(139, 92, 246, 0.8)),
        url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZmZmIiBmaWxsLW9wYWNpdHk9IjAuMDUiLz4KPC9zdmc+');
    /* Pattern */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Icon Bubble */
.note-icon-bubble {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: white;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.note-card-body {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.note-tags {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.badge {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 8px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.note-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.note-card p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 1.5rem;
}

.card-footer {
    margin-top: auto;
}

.download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 12px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    color: white;
    border-radius: 12px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    /* Color shift on hover */
}

/* Hero Section */
.hero {
    padding: 160px 0 100px;
    text-align: center;
    position: relative;
}

.hero p {
    font-size: 1.2rem;
    color: rgba(226, 232, 240, 0.8);
    max-width: 600px;
    margin: 0 auto 2rem;
}

[data-theme="light"] .hero p {
    color: rgba(30, 41, 59, 0.8);
}

/* Features Section */
.features {
    padding: 80px 0;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 16px;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: inline-block;
    padding: 10px;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

/* Calculator Section */
.calculator-section {
    padding: 100px 0;
    min-height: 80vh;
}

.calculator-container {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    max-width: 800px;
    margin: 0 auto;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-control,
select {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    background: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
}

.results-display {
    margin-top: 2rem;
    padding: 2rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 12px;
    text-align: center;
    display: none;
}

.results-display.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Footer */
footer {
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    margin-top: 4rem;
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="light"] footer {
    color: rgba(0, 0, 0, 0.5);
}

/* Responsive */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .nav-links {
        display: none;
    }

    /* Mobile menu implementation later */
}