/* ===== BASE STYLES ===== */
:root[data-theme="dark"] {
    /* Backgrounds */
    --bg-primary: #0a0a0a;
    --bg-secondary: #121212;
    --bg-tertiary: #1a1a1a;
    --bg-card: #262626;
    --bg-overlay: rgba(10, 10, 10, 0.95);
    
    /* Accent Colors - Cyber Green Theme */
    --accent-primary: #4ade80;
    --accent-secondary: #22c55e;
    --accent-light: #86efac;
    --accent-dark: #16a34a;
    --accent-glow: rgba(74, 222, 128, 0.3);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-muted: #a3a3a3;
    --text-accent: #4ade80;
    
    /* UI Elements */
    --border-color: #333333;
    --border-accent: #4ade80;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 20px rgba(74, 222, 128, 0.4);
}

:root[data-theme="light"] {
    /* Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --bg-tertiary: #f5f5f5;
    --bg-card: #ffffff;
    --bg-overlay: rgba(255, 255, 255, 0.95);
    
    /* Accent Colors */
    --accent-primary: #000000;
    --accent-secondary: #1a1a1a;
    --accent-light: #404040;
    --accent-dark: #0a0a0a;
    --accent-glow: rgba(0, 0, 0, 0.1);
    
    /* Text */
    --text-primary: #000000;
    --text-secondary: #262626;
    --text-muted: #737373;
    --text-accent: #16a34a;
    
    /* UI Elements */
    --border-color: #e5e5e5;
    --border-accent: #000000;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 20px rgba(0, 0, 0, 0.1);
}

* {
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: 'Space Grotesk', sans-serif;
    overflow-x: hidden;
    line-height: 1.6;
}

.pixel-text {
    font-family: 'Press Start 2P', cursive;
    image-rendering: pixelated;
}

/* ===== LAYOUT & SPACING ===== */
.section-padding {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 3rem;
    text-align: center;
}

.container-narrow {
    max-width: 800px;
    margin: 0 auto;
}

/* ===== NAVIGATION ===== */
.pixel-nav {
    background-color: var(--bg-overlay);
    backdrop-filter: blur(8px);
    border: 2px solid var(--border-color);
    border-radius: 40px;
    padding: 0.75rem 0;
    transition: all 0.3s ease;
    margin: 1rem auto;
    max-width: 1350px;
    box-shadow: var(--shadow-md);
}

.nav-logo {
    max-width: 60px; 
    height: auto;
}

.footer-logo {
    max-width: 250px;
    height: auto;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.2rem;
    color: var(--text-accent) !important;
    text-decoration: none;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    margin: 0 10px;
    position: relative;
    transition: color 0.3s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--text-accent) !important;
}

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

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

.btn-external {
    background-color: var(--bg-card);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 0;
    font-weight: 500;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-external:hover {
    background-color: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s;
    padding: 8px;
}

.theme-toggle:hover {
    color: var(--text-accent);
}

/* Hamburger Menu Styling */
.navbar-toggler {
    border: 2px solid var(--accent-primary);
    padding: 0.5rem;
    border-radius: 0;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: transparent;
}

.navbar-toggler:focus {
    box-shadow: 0 0 0 0.2rem var(--accent-glow);
    outline: none;
}

.navbar-toggler:hover {
    background-color: var(--accent-glow);
}

/* Custom Hamburger Icon with 3 lines */
.hamburger-icon {
    width: 28px;
    height: 20px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.hamburger-icon .line {
    width: 100%;
    height: 3px;
    background-color: var(--accent-primary);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Animation when menu is open */
.navbar-toggler:not(.collapsed) .hamburger-icon .line:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.navbar-toggler:not(.collapsed) .hamburger-icon .line:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.navbar-toggler:not(.collapsed) .hamburger-icon .line:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* Font Awesome Alternative */
.hamburger-icon-fa {
    color: var(--accent-primary);
    font-size: 1.5rem;
}

/* Remove Bootstrap default icon */
.navbar-toggler-icon {
    display: none;
}

/* ===== PAGINATION STYLES ===== */
.pagination {
    margin: 0;
    padding: 0;
    display: inline-flex;
    gap: 0.5rem;
}

.pagination .page-item {
    list-style: none;
}

.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    padding: 8px 12px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0;
    font-weight: 600;
    transition: all 0.15s ease;
}

.pagination .page-link:hover {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
}

.pagination .page-item.active .page-link {
    background: var(--accent-primary);
    color: var(--bg-primary);
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== HERO SECTIONS ===== */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background-color: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    opacity: 0.1;
}

.hero-content {
    padding-top: 7em;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 2.5rem;
    max-width: 600px;
}

.page-hero {
    padding: 8rem 0 4rem;
    background-color: var(--bg-secondary);
    border-bottom: 4px solid var(--border-color);
}

.page-title {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 600px;
}

.breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 2rem;
}

.breadcrumb-item a {
    color: var(--text-muted);
    text-decoration: none;
}

.breadcrumb-item.active {
    color: var(--text-accent);
}

/* ===== MOBILE RESPONSIVE FIXES ===== */

/* Tablets and below (landscape tablets & mobile) */
@media (max-width: 991px) {
    .pixel-nav {
        border-radius: 20px;
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .navbar-collapse {
        background-color: var(--bg-card);
        border: 2px solid var(--border-color);
        border-radius: 0;
        margin-top: 1rem;
        padding: 1rem;
        box-shadow: var(--shadow-md);
    }
    
    .navbar-nav {
        gap: 0.5rem;
    }
    
    .navbar-nav .nav-item {
        width: 100%;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
        margin: 0;
        border-bottom: 2px solid var(--border-color);
    }
    
    .navbar-nav .nav-link:last-child {
        border-bottom: none;
    }
    
    .btn-external {
        width: 100%;
        text-align: center;
        margin-top: 0.5rem;
    }
    
    .theme-toggle {
        width: 100%;
        text-align: left;
        padding: 0.75rem 1rem;
        border-top: 2px solid var(--border-color);
    }
}

/* Mobile devices */
@media (max-width: 768px) {
    /* Navigation fixes */
    .pixel-nav {
        border-radius: 15px;
        padding: 0.5rem 0;
        margin: 0.5rem;
    }
    
    .nav-logo {
        max-width: 45px;
    }
    
    .navbar-toggler {
        width: 40px;
        height: 40px;
    }
    
    .navbar-toggler-icon,
    .navbar-toggler-icon::before,
    .navbar-toggler-icon::after {
        width: 25px;
    }
    
    /* Hero section fixes */
    .hero-section {
        min-height: auto;
        padding: 6rem 0 3rem;
    }
    
    .hero-content {
        padding-top: 2rem;
    }
    
    .hero-title {
        font-size: 1.75rem;
        line-height: 1.3;
        word-wrap: break-word;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    .page-hero {
        padding: 6rem 0 3rem;
    }
    
    .page-title {
        font-size: 1.75rem;
        line-height: 1.3;
        word-wrap: break-word;
    }
    
    .page-subtitle {
        font-size: 1rem;
        line-height: 1.5;
    }
    
    /* Section title fixes */
    .section-title {
        font-size: 1.75rem;
        line-height: 1.3;
        margin-bottom: 2rem;
    }
    
    .section-padding {
        padding: 3rem 0;
    }
    
    /* Container fixes */
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Footer logo fix */
    .footer-logo {
        max-width: 180px;
    }
}

/* Small mobile devices */
@media (max-width: 576px) {
    .pixel-nav {
        margin: 0.25rem;
        max-width: calc(100% - 0.5rem);
        border-radius: 10px;
    }
    
    .nav-logo {
        max-width: 40px;
    }
    
    .navbar-toggler {
        width: 35px;
        height: 35px;
        padding: 0.4rem;
    }
    
    .navbar-toggler-icon,
    .navbar-toggler-icon::before,
    .navbar-toggler-icon::after {
        width: 22px;
    }
    
    .navbar-toggler-icon::before {
        top: 0;
    }
    
    .navbar-toggler-icon::after {
        bottom: 0;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .page-title {
        font-size: 1.5rem;
    }
    
    .page-subtitle {
        font-size: 0.9rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-padding {
        padding: 2.5rem 0;
    }
    
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .footer-logo {
        max-width: 150px;
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    .hero-title {
        font-size: 1.25rem;
    }
    
    .page-title {
        font-size: 1.25rem;
    }
    
    .section-title {
        font-size: 1.25rem;
    }
}

/* Landscape mobile devices */
@media (max-width: 768px) and (orientation: landscape) {
    .hero-section {
        min-height: auto;
        padding: 5rem 0 2rem;
    }
    
    .page-hero {
        padding: 5rem 0 2rem;
    }
}

/* Prevent horizontal scroll */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

.row {
    margin-left: 0;
    margin-right: 0;
}

[class*="col-"] {
    padding-left: 12px;
    padding-right: 12px;
}

/* Ensure all images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Text color utilities */
.text-accent {
    color: var(--text-accent) !important;
}

[data-theme="dark"] .text-accent {
    color: var(--accent-primary) !important;
}

[data-theme="light"] .text-accent {
    color: #000000 !important;
}

/* Fix for terminal mockup on mobile */
@media (max-width: 768px) {
    .terminal-mockup {
        font-size: 0.75rem;
        padding: 1rem;
    }
    
    .terminal-text {
        font-size: 0.7rem;
        overflow-x: auto;
    }
}