/* ==========================================================================
   LPU TOOLS - "Playful Geometric Sunshine" Design System
   Mobile-First Implementation
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS & VARIABLES
   -------------------------------------------------------------------------- */
:root {
    /* === COLORS === */
    --color-primary: #FF6B35;
    --color-primary-light: #FF8A5C;
    --color-primary-dark: #E55A2B;
    --color-primary-rgb: 255, 107, 53;

    --color-secondary: #FFAB40;
    --color-secondary-light: #FFBF69;
    --color-secondary-rgb: 255, 171, 64;

    --color-accent: #FFE066;
    --color-accent-rgb: 255, 224, 102;
    --color-success: #10B981;
    --color-error: #EF4444;

    /* Backgrounds & Surfaces */
    --color-bg: #FFFBF5;
    --color-bg-secondary: #FFF7ED;
    --color-surface: #FFFFFF;
    --color-surface-border: rgba(255, 107, 53, 0.1);

    /* Text */
    --color-text: #1F1006;
    --color-text-secondary: #6B5344;
    --color-text-tertiary: #9C8678;
    --color-text-inverse: #FFFFFF;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    --gradient-warm: linear-gradient(135deg, #FF6B35, #FFAB40, #FFE066);
    --gradient-mesh: radial-gradient(at 40% 20%, #FFE5D0 0px, transparent 50%),
        radial-gradient(at 80% 0%, #FFF4E6 0px, transparent 50%),
        radial-gradient(at 0% 50%, #FFEDD5 0px, transparent 50%);

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(31, 16, 6, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(31, 16, 6, 0.07), 0 2px 4px -2px rgba(31, 16, 6, 0.05);
    --shadow-lg: 0 10px 15px -3px rgba(31, 16, 6, 0.08), 0 4px 6px -4px rgba(31, 16, 6, 0.05);
    --shadow-card-hover: 0 20px 40px -15px rgba(255, 107, 53, 0.25);

    /* === TYPOGRAPHY === */
    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'DM Sans', sans-serif;

    /* Fluid Typography (Mobile Base) */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;

    /* Layout */
    --container-max: 1200px;
    --header-height: 70px;
    /* Smaller for mobile default */
    --border-radius-md: 12px;
    --border-radius-lg: 16px;
    --border-radius-xl: 24px;
    --border-radius-full: 9999px;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-12: 3rem;
    --space-16: 4rem;

    /* Transitions */
    --transition-base: 250ms ease;
    --transition-bounce: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

    /* Z-Index */
    --z-fixed: 300;
    --z-dropdown: 100;
}

/* Dark Mode Overrides */
body.dark-mode {
    --color-bg: #0F0A06;
    --color-bg-secondary: #1A120B;
    --color-surface: #1E1510;
    --color-surface-border: rgba(255, 171, 64, 0.15);
    --color-text: #FFF8F3;
    --color-text-secondary: #C9B5A5;
    --color-text-tertiary: #8D7A6A;
    --gradient-mesh: radial-gradient(at 40% 20%, rgba(255, 107, 53, 0.1) 0px, transparent 50%),
        radial-gradient(at 80% 0%, rgba(255, 171, 64, 0.08) 0px, transparent 50%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------------------------------
   2. RESET & BASE
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.6;
    color: var(--color-text);
    background-color: var(--color-bg);
    background-image: var(--gradient-mesh);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
}

img,
svg {
    display: block;
    max-width: 100%;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-base);
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* --------------------------------------------------------------------------
   3. TYPOGRAPHY
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.1;
    margin-bottom: var(--space-4);
}

h1 {
    font-size: clamp(2rem, 5vw + 1rem, 3.5rem);
}

/* Fluid h1 */
h2 {
    font-size: clamp(1.5rem, 4vw + 1rem, 2.5rem);
}

h3 {
    font-size: clamp(1.25rem, 3vw + 1rem, 2rem);
}

h4 {
    font-size: 1.25rem;
}

.subtitle {
    font-size: clamp(1rem, 2vw + 1rem, 1.25rem);
    color: var(--color-text-secondary);
    max-width: 600px;
    margin: 0 auto var(--space-6);
}

.highlight {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* --------------------------------------------------------------------------
   4. LAYOUT UTILITIES
   -------------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
    /* Mobile padding */
    position: relative;
    z-index: 1;
}

.main-content {
    padding-top: var(--header-height);
    min-height: calc(100vh - 300px);
    /* Approx footer height */
}

/* --------------------------------------------------------------------------
   5. HEADER & NAVIGATION (Mobile First)
   -------------------------------------------------------------------------- */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: var(--z-fixed);
    background: rgba(255, 251, 245, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--color-surface-border);
    transition: all var(--transition-base);
}

body.dark-mode .header {
    background: rgba(15, 10, 6, 0.9);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: var(--shadow-sm);
}

.logo-text {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-text);
}

/* Mobile Menu - Default State */
/* Mobile Menu - Side Drawer Premium */
.nav-links {
    position: fixed;
    top: 0;
    right: 0;
    width: 300px;
    height: 100vh;
    background: rgba(255, 251, 245, 0.98);
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    z-index: 1000;
}

body.dark-mode .nav-links {
    background: #1A120B;
    border-left: 1px solid var(--color-surface-border);
}

.nav-links.active {
    transform: translateX(0);
}

/* Menu Header */
.nav-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-4) var(--space-6);
    border-bottom: 1px solid var(--color-surface-border);
    height: var(--header-height);
}

.nav-menu-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-text);
}

.nav-close-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-md);
    color: var(--color-text-secondary);
    background: transparent;
    transition: all 0.2s ease;
    font-size: 1.25rem;
}

.nav-close-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--color-error);
}

/* Menu List */
.nav-list {
    list-style: none;
    padding: var(--space-6);
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    overflow-y: auto;
}

.nav-link {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--color-text-secondary);
    padding: var(--space-3) var(--space-4);
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    gap: var(--space-4);
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.nav-link i {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.nav-links.active .nav-link {
    opacity: 1;
    transform: translateX(0);
}

/* Staggered Delay */
.nav-links.active li:nth-child(1) .nav-link {
    transition-delay: 0.1s;
}

.nav-links.active li:nth-child(2) .nav-link {
    transition-delay: 0.15s;
}

.nav-links.active li:nth-child(3) .nav-link {
    transition-delay: 0.2s;
}

.nav-links.active li:nth-child(4) .nav-link {
    transition-delay: 0.25s;
}

.nav-links.active li:nth-child(5) .nav-link {
    transition-delay: 0.3s;
}

.nav-link:hover {
    background: rgba(255, 107, 53, 0.05);
    color: var(--color-primary);
    transform: translateX(5px);
}

.nav-link.active {
    color: var(--color-primary);
    background: rgba(255, 107, 53, 0.1);
}

.nav-link.active i {
    opacity: 1;
    color: var(--color-primary);
}

.nav-link-external {
    margin-top: var(--space-4);
    border-top: 1px dashed var(--color-surface-border);
    padding-top: var(--space-4);
}

/* Backdrop Overlay */
.nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    /* Slightly darker, no blur */
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.nav-link i {
    font-size: 1.5rem;
    opacity: 0.7;
    transition: transform 0.2s ease;
}

.nav-links.active .nav-link {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered Delay for Menu Items */
.nav-links.active li:nth-child(1) .nav-link {
    transition-delay: 0.1s;
}

.nav-links.active li:nth-child(2) .nav-link {
    transition-delay: 0.15s;
}

.nav-links.active li:nth-child(3) .nav-link {
    transition-delay: 0.2s;
}

.nav-links.active li:nth-child(4) .nav-link {
    transition-delay: 0.25s;
}

.nav-links.active li:nth-child(5) .nav-link {
    transition-delay: 0.3s;
}

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

.nav-link.active {
    color: var(--color-primary);
    background: transparent;
    /* No background, just color */
}

.nav-link.active i {
    opacity: 1;
    color: var(--color-primary);
    transform: scale(1.2);
}

.nav-link-external {
    font-size: 1.25rem;
    margin-top: var(--space-4);
    color: var(--color-text-tertiary);
}

/* Nav Actions (Theme Toggle + Ham) */
.nav-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.theme-toggle {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-md);
    color: var(--color-text-secondary);
    background: transparent;
    transition: background var(--transition-base);
}

.theme-toggle:hover {
    background: rgba(255, 107, 53, 0.1);
    color: var(--color-primary);
}

.theme-toggle .fa-sun,
.theme-toggle .fa-moon {
    position: absolute;
    transition: all 0.4s ease;
}

/* Hamburger */
.hamburger {
    width: 40px;
    height: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    border-radius: var(--border-radius-md);
}

.hamburger span {
    width: 20px;
    height: 2px;
    background: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition-base);
}

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

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

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

/* --------------------------------------------------------------------------
   6. HERO SECTION
   -------------------------------------------------------------------------- */
.hero {
    padding: var(--space-12) 0;
    text-align: center;
}

.hero-cta {
    display: flex;
    flex-direction: column;
    /* Stack on mobile */
    gap: var(--space-4);
    align-items: center;
    margin-top: var(--space-8);
}

/* --------------------------------------------------------------------------
   7. COMPONENTS (Cards, Buttons)
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-family: var(--font-display);
    font-weight: 600;
    border-radius: var(--border-radius-full);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    width: 100%;
    /* Full width on mobile often good */
    max-width: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 14px rgba(255, 107, 53, 0.25);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    border: 2px solid var(--color-surface-border);
    color: var(--color-text);
}

.tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding: var(--space-6) 0;
}

/* ==========================================================================
   REDESIGNED TOOL CARDS - Modern Glassmorphism Style
   ========================================================================== */

/* Tools Section */
.tools-section {
    padding: var(--space-12) 0;
    position: relative;
}

.tools-header {
    text-align: center;
    margin-bottom: var(--space-10);
}

.tools-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    font-size: var(--text-sm);
    font-weight: 600;
    border-radius: var(--border-radius-full);
    margin-bottom: var(--space-4);
}

.tools-header h2 {
    margin-bottom: var(--space-3);
}

.tools-header p {
    color: var(--color-text-secondary);
    font-size: var(--text-lg);
    max-width: 500px;
    margin: 0 auto;
}

/* Tool Card Base */
.tool-card {
    position: relative;
    background: var(--color-surface);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tool-card__glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(var(--color-primary-rgb), 0.08) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.tool-card:hover .tool-card__glow {
    opacity: 1;
}

.tool-card__content {
    position: relative;
    padding: var(--space-8);
    z-index: 1;
}

/* Card Header */
.tool-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: var(--space-5);
    flex-wrap: wrap;
    gap: var(--space-3);
}

.tool-card__icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
    box-shadow: 0 8px 24px rgba(var(--color-primary-rgb), 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    flex-shrink: 0;
}

.tool-card:hover .tool-card__icon {
    transform: scale(1.1) rotate(-5deg);
    box-shadow: 0 12px 32px rgba(var(--color-primary-rgb), 0.4);
}

.tool-card__icon--teal {
    background: linear-gradient(135deg, #4ECDC4, #2AB7A9);
    box-shadow: 0 8px 24px rgba(78, 205, 196, 0.3);
}

.tool-card:hover .tool-card__icon--teal {
    box-shadow: 0 12px 32px rgba(78, 205, 196, 0.4);
}

.tool-card__tag {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    background: rgba(var(--color-primary-rgb), 0.1);
    color: var(--color-primary);
    font-size: var(--text-xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: var(--border-radius-full);
    border: 1px solid rgba(var(--color-primary-rgb), 0.2);
}

.tool-card__tag--teal {
    background: rgba(78, 205, 196, 0.1);
    color: #2AB7A9;
    border-color: rgba(78, 205, 196, 0.2);
}

/* Card Content */
.tool-card__title {
    font-size: var(--text-xl);
    font-weight: 700;
    margin-bottom: var(--space-3);
    color: var(--color-text);
}

.tool-card__desc {
    color: var(--color-text-secondary);
    font-size: var(--text-sm);
    line-height: 1.7;
    margin-bottom: var(--space-5);
}

/* Feature List */
.tool-card__features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-6) 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.tool-card__features li {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--color-text-secondary);
}

.tool-card__features i {
    color: var(--color-success);
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Card Button */
.tool-card__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    width: 100%;
    padding: var(--space-4) var(--space-6);
    font-family: var(--font-display);
    font-size: var(--text-base);
    font-weight: 600;
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-lg);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-card__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 ease;
}

.tool-card__btn:hover::before {
    left: 100%;
}

.tool-card__btn--orange {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    box-shadow: 0 4px 16px rgba(var(--color-primary-rgb), 0.3);
}

.tool-card__btn--orange:hover {
    box-shadow: 0 8px 24px rgba(var(--color-primary-rgb), 0.4);
    transform: translateY(-2px);
    color: white;
}

.tool-card__btn--teal {
    background: linear-gradient(135deg, #4ECDC4, #2AB7A9);
    box-shadow: 0 4px 16px rgba(78, 205, 196, 0.3);
}

.tool-card__btn--teal:hover {
    box-shadow: 0 8px 24px rgba(78, 205, 196, 0.4);
    transform: translateY(-2px);
    color: white;
}

.tool-card__btn i {
    transition: transform 0.3s ease;
}

.tool-card__btn:hover i {
    transform: translateX(4px);
}

/* Card Hover States */
.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    border-color: rgba(var(--color-primary-rgb), 0.2);
}

.tool-card--tgpa:hover {
    border-color: rgba(78, 205, 196, 0.2);
}

/* Card Top Border Accent */
.tool-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tool-card--tgpa::after {
    background: linear-gradient(90deg, #4ECDC4, #2AB7A9);
}

.tool-card:hover::after {
    opacity: 1;
}

/* Animation */
.tool-card {
    opacity: 0;
    animation: cardSlideUp 0.6s ease forwards;
}

.tool-card:nth-child(1) {
    animation-delay: 0.1s;
}

.tool-card:nth-child(2) {
    animation-delay: 0.2s;
}

@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablet: 2 columns */
@media (min-width: 640px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }
    
    .tool-card__content {
        padding: var(--space-10);
    }
    
    .tool-card__icon {
        width: 64px;
        height: 64px;
        font-size: 1.75rem;
    }
    
    .tool-card__title {
        font-size: var(--text-2xl);
    }
}

/* Desktop: Enhanced spacing */
@media (min-width: 1024px) {
    .tools-section {
        padding: var(--space-16) 0;
    }
    
    .tools-grid {
        gap: var(--space-8);
    }
    
    .tool-card__content {
        padding: var(--space-12);
    }
}

.features {
    padding: var(--space-5);
    background: var(--color-surface);
    margin: var(--space-8) var(--space-4);
    max-width: calc(100% - var(--space-8));
    border-radius: var(--border-radius-xl);
    border: 1px solid var(--color-surface-border);
    overflow: hidden;
    box-sizing: border-box;
}

.features-header {
    text-align: center;
    margin-bottom: var(--space-6);
}

.features-header h2 {
    margin-bottom: var(--space-2);
    font-size: var(--text-xl);
}

.features-header .subtitle {
    font-size: var(--text-xs);
    max-width: 100%;
    margin: 0;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);
}

.feature-card {
    background: var(--color-bg);
    padding: var(--space-4);
    border-radius: var(--border-radius-lg);
    text-align: center;
    border: 1px solid var(--color-surface-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 0; /* Prevent overflow */
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 1.5rem;
    margin-bottom: var(--space-2);
    line-height: 1;
}

.feature-card h4 {
    font-size: var(--text-xs);
    margin-bottom: var(--space-1);
    color: var(--color-text);
    word-wrap: break-word;
}

.feature-card p {
    font-size: 0.65rem;
    color: var(--color-text-secondary);
    margin: 0;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Tablet (640px+) */
@media (min-width: 640px) {
    .features {
        padding: var(--space-8);
        margin: var(--space-12) auto;
        max-width: var(--container-max);
    }
    
    .features-header h2 {
        font-size: var(--text-3xl);
    }
    
    .features-header .subtitle {
        font-size: var(--text-base);
    }
    
    .features-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: var(--space-6);
    }
    
    .feature-card {
        padding: var(--space-6);
    }
    
    .feature-icon {
        font-size: 2.25rem;
        margin-bottom: var(--space-4);
    }
    
    .feature-card h4 {
        font-size: var(--text-base);
    }
    
    .feature-card p {
        font-size: var(--text-sm);
    }
}

/* --------------------------------------------------------------------------
   8. FORMS & GLASS PANELS
   -------------------------------------------------------------------------- */
.glass-panel {
    background: var(--color-surface);
    border-radius: var(--border-radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--color-surface-border);
    margin: var(--space-4) 0;
}

.form-control {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-surface-border);
    border-radius: var(--border-radius-md);
    background: var(--color-bg);
    color: var(--color-text);
    font-size: 1rem;
}

/* --------------------------------------------------------------------------
   9. FOOTER
   -------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
/* --------------------------------------------------------------------------
/* --------------------------------------------------------------------------
   9. FOOTER (Redesigned - Premium)
   -------------------------------------------------------------------------- */
.footer {
    position: relative;
    padding: 0;
    /* Remove top padding as wave is external now */
    margin-top: 100px;
    /* Space for the wave to overlap */
    /* Dark Premium Footer */
    background: #1a120b;
    color: #ede0d4;
    border-top: none;
    overflow: visible;
    /* CRITICAL: Allow wave to stick out top */
}

body.dark-mode .footer {
    background: #251b15;
    color: #ede0d4;
}

/* Wave Transition */
.footer-wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    overflow: hidden;
    line-height: 0;
    transform: translateY(-99%);
    /* Move completely above the footer (99% avoids 1px gap line) */
    z-index: 10;
    /* Ensure it stays on top of page content background */
    pointer-events: none;
}

.footer-wave svg {
    display: block;
    width: calc(100% + 1.3px);
    height: 100%;
}

.footer-wave path {
    fill: #1a120b;
    transition: fill 0.3s ease;
}

body.dark-mode .footer-wave path {
    fill: #251b15;
}

/* Footer Content */
.footer-container {
    padding-bottom: var(--space-8);
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: var(--space-8);
}

.footer-brand p {
    margin: var(--space-4) 0;
    max-width: 320px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: rgba(237, 224, 212, 0.7);
    /* Soft text */
}

.footer-social {
    display: flex;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

.footer-social a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.05);
    /* very subtle */
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-full);
    transition: all 0.3s ease;
    font-size: 1.2rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-social a:hover {
    background: var(--color-primary);
    color: white;
    transform: translateY(-3px);
    border-color: var(--color-primary);
    box-shadow: 0 5px 15px rgba(255, 107, 53, 0.3);
}

.footer-links-group h4 {
    color: white;
    font-size: 1.1rem;
    margin-bottom: var(--space-6);
    position: relative;
    display: inline-block;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.footer-links-group h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -8px;
    width: 24px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 3px;
}

.footer-links-group ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links-group li {
    margin-bottom: var(--space-3);
}

.footer-links-group a {
    color: rgba(237, 224, 212, 0.7);
    font-size: 0.95rem;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
}

.footer-links-group a:hover {
    color: var(--color-primary);
    transform: translateX(4px);
}

/* Footer Bottom Bar */
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: var(--space-6) 0;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.footer-bottom .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.footer-bottom p {
    margin: 0;
    font-size: 0.9rem;
}

.made-with .heart {
    color: #ef4444;
    display: inline-block;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

@media (max-width: 768px) {
    .footer-container {
        grid-template-columns: 1fr;
        gap: var(--space-8);
        text-align: center;
    }

    .footer-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-links-group h4::after {
        left: 50%;
        transform: translateX(-50%);
    }

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

/* --------------------------------------------------------------------------
   10. MEDIA QUERIES (Progressive Enhancement)
   -------------------------------------------------------------------------- */

/* Tablet & Up (>= 768px) */
@media (min-width: 768px) {
    :root {
        --header-height: 80px;
        --space-4: 1.5rem;
        /* Larger padding on container */
    }

    .hero-cta {
        flex-direction: row;
        justify-content: center;
    }

    .btn {
        width: auto;
        /* Buttons maintain intrinsic width */
    }
}

/* Desktop & Up (>= 1024px) */
@media (min-width: 1024px) {

    /* Navbar transformation */
    .hamburger {
        display: none;
    }

    .nav-menu-header {
        display: none !important;
    }

    .nav-links {
        position: static;
        width: auto;
        height: auto;
        background: transparent !important;
        /* Force transparent override */
        box-shadow: none;
        padding: 0;
        transform: none;
        display: block;
        /* Acts as simple wrapper */
        border: none !important;
        overflow: visible;
    }

    body.dark-mode .nav-links {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    .nav-list {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: var(--space-2);
        padding: 0;
        margin: 0;
        overflow: visible;
    }

    .nav-link {
        font-size: 0.9rem;
        padding: var(--space-2) var(--space-4);
        opacity: 1;
        transform: none;
        border-radius: var(--border-radius-full);
        display: inline-flex;
    }

    .nav-link i {
        font-size: 1rem;
        width: auto;
        opacity: 1;
    }

    .nav-link.active {
        background: rgba(255, 107, 53, 0.1);
        color: var(--color-primary);
    }

    .nav-link:hover {
        background: rgba(255, 107, 53, 0.05);
        transform: none;
    }

    .nav-link-external {
        margin-top: 0;
        border-top: none;
        padding-top: var(--space-2);
        font-size: 0.9rem;
    }

    .glass-panel {
        padding: var(--space-12);
    }

    .footer-links {
        flex-direction: row;
        justify-content: center;
        gap: var(--space-8);
    }
}

/* Floating Shapes (Background) */
.floating-shapes {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.shape {
    position: absolute;
    opacity: 0.6;
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    filter: blur(60px);
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 107, 53, 0.2) 0%, rgba(255, 171, 64, 0.05) 70%);
    top: -100px;
    right: -100px;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255, 224, 102, 0.25) 0%, rgba(255, 255, 255, 0) 70%);
    bottom: 10%;
    left: -50px;
    animation-delay: -5s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, rgba(255, 255, 255, 0) 70%);
    top: 40%;
    right: 10%;
    animation-delay: -10s;
}

.shape-4 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.1) 0%, rgba(255, 255, 255, 0) 70%);
    bottom: 30%;
    left: 20%;
    animation-delay: -7s;
}

@keyframes float {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -30px) rotate(10deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

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

.hero h1 {
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero .subtitle {
    animation: fadeInUp 0.8s 0.2s ease-out forwards backwards;
}

.hero-cta {
    animation: fadeInUp 0.8s 0.3s ease-out forwards backwards;
}

/* Dark mode toggle Logic (Icons) */
.theme-toggle .fa-sun {
    opacity: 1;
    transform: rotate(0);
}

.theme-toggle .fa-moon {
    opacity: 0;
    transform: rotate(-90deg);
}

body.dark-mode .theme-toggle .fa-sun {
    opacity: 0;
    transform: rotate(90deg);
}

body.dark-mode .theme-toggle .fa-moon {
    opacity: 1;
    transform: rotate(0);
}

/* --------------------------------------------------------------------------
   21. CALCULATOR ITEMS (New)
   -------------------------------------------------------------------------- */
.subject-row,
.subject-row-custom,
.subject-item-simple {
    background: var(--color-bg);
    padding: var(--space-4);
    border-radius: var(--border-radius-lg);
    margin-bottom: var(--space-4);
    border: 1px solid var(--color-surface-border);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.subject-row:hover,
.subject-row-custom:hover,
.subject-item-simple:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.subject-row,
.subject-row-custom {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4);
    align-items: start;
}

.subject-item-simple {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: var(--space-4);
}

/* Tablet & Up Overrides for Grid */
@media (min-width: 768px) {
    .subject-row {
        grid-template-columns: 2fr 120px 50px;
        align-items: center;
    }

    .subject-row-custom {
        grid-template-columns: 1fr 2fr 80px 120px 50px;
        align-items: end;
    }
}

/* Mobile Layout Improvements */
@media (max-width: 767px) {

    .subject-row,
    .subject-row-custom {
        grid-template-columns: 1fr auto;
        gap: var(--space-4) var(--space-2);
    }

    /* Make Title Span Full Width */
    .subject-row>*:first-child,
    .subject-row-custom>*:nth-child(1),
    .subject-row-custom>*:nth-child(2) {
        grid-column: 1 / -1;
    }

    /* Custom Subject Inputs on mobile */
    .subject-row-custom>*:nth-child(3) {
        /* Credits */
        grid-column: 1 / 2;
    }

    .subject-row-custom>*:nth-child(4) {
        /* Marks */
        grid-column: 1 / 2;
    }

    .subject-row-custom>*:last-child {
        /* Delete */
        grid-column: 2 / 3;
        align-self: end;
        justify-self: end;
    }

    /* Regular Subject Inputs */
    .subject-row>*:nth-child(2) {
        /* Marks */
        grid-column: 1 / 2;
    }

    .subject-row>*:last-child {
        /* Delete */
        grid-column: 2 / 3;
        align-self: end;
        justify-self: end;
    }

    .subject-row-buttons button {
        padding: var(--space-3);
        background: rgba(239, 68, 68, 0.1) !important;
    }
}

/* --------------------------------------------------------------------------
   22. MY DATA PAGE (New Responsive Design)
   -------------------------------------------------------------------------- */
.my-data-panel {
    max-width: 900px;
    margin: 0 auto;
}

.data-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-8);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.data-header h3 {
    font-size: var(--text-2xl);
    margin: 0;
}

.btn-clear-data {
    background: transparent;
    border: 1px solid var(--color-error);
    color: var(--color-error);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    font-weight: 600;
}

.btn-clear-data:hover {
    background: var(--color-error);
    color: white;
}

.program-card {
    background: var(--color-bg);
    border-radius: var(--border-radius-xl);
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    border: 1px solid var(--color-surface-border);
    box-shadow: var(--shadow-sm);
    animation: fadeInUp 0.5s ease-out;
}

.program-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-4);
    border-bottom: 1px dashed var(--color-surface-border);
    flex-wrap: wrap;
    gap: var(--space-4);
}

.program-info h3 {
    margin: 0 0 0.25rem 0;
    font-size: var(--text-xl);
    color: var(--color-primary);
}

.program-meta {
    font-size: var(--text-sm);
    color: var(--color-text-tertiary);
    font-weight: 500;
}

.btn-delete-program {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
    border: none;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
    border-radius: var(--border-radius-md);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.btn-delete-program:hover {
    background: #EF4444;
    color: white;
}

/* Semesters Grid */
.semesters-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.semester-card {
    background: var(--color-surface);
    padding: var(--space-4);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--color-surface-border);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.semester-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.semester-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-4);
}

.semester-header strong {
    font-size: var(--text-lg);
    font-family: var(--font-display);
}

.btn-delete-semester {
    color: var(--color-text-tertiary);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius-full);
    transition: all 0.2s;
    background: transparent;
    border: none;
    cursor: pointer;
}

.btn-delete-semester:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.semester-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3);
}

.stat-box {
    padding: var(--space-3);
    border-radius: var(--border-radius-md);
    text-align: center;
}

.stat-tgpa {
    background: rgba(16, 185, 129, 0.1);
    color: #10B981;
}

.stat-subjects {
    background: rgba(78, 205, 196, 0.1);
    color: #4ECDC4;
}

.stat-label {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 600;
    margin-bottom: 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-weight: 700;
    font-size: 1.25rem;
    font-family: var(--font-display);
}

/* No Data State */
.no-data-state {
    text-align: center;
    padding: var(--space-12) var(--space-4);
}

.no-data-icon {
    font-size: 4rem;
    margin-bottom: var(--space-4);
}

.no-data-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-4);
    justify-content: center;
    margin-top: var(--space-8);
}

/* Mobile Tweaks */
@media (max-width: 640px) {
    .data-header {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
        gap: var(--space-6);
    }

    .btn-clear-data {
        width: 100%;
        justify-content: center;
    }

    .program-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-4);
    }

    .btn-delete-program {
        width: 100%;
        justify-content: center;
        margin-top: var(--space-2);
    }

    .program-card {
        padding: var(--space-4);
    }

    .semesters-grid {
        grid-template-columns: 1fr;
    }
}