:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --secondary-color: #10b981;
    --secondary-dark: #0d9488;
    --accent-gold: #f59e0b;
    --accent-purple: #8b5cf6;
    --background-dark: #0f172a;
    --background-darker: #020617;
    --background-light: #f8fafc;
    --text-dark: #e2e8f0;
    --text-light: #1e293b;
    --card-bg-dark: #1e293b;
    --card-bg-light: #ffffff;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

:root.light-mode {
    --primary-color: #10b981;
    --primary-dark: #059669;
    --secondary-color: #2563eb;
    --secondary-dark: #1d4ed8;
    --accent-gold: #d97706;
    --accent-purple: #7c3aed;
    --background-dark: #f8fafc;
    --background-light: #0f172a;
    --text-dark: #1e293b;
    --text-light: #e2e8f0;
    --card-bg-dark: #ffffff;
    --card-bg-light: #1e293b;
}

html {
    scrollbar-color: var(--primary-color) var(--background-dark);
    scrollbar-width: thin;
}

body {
    background: var(--background-dark);
    color: var(--text-dark);
    font-family: 'Montserrat', sans-serif;
    line-height: 1.7;
    transition: background 0.5s, color 0.5s;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    line-height: 1.3;
}

/* ===== NAVBAR ===== */
.navbar {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    transition: var(--transition);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--text-dark);
    transition: color 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.navbar-brand:hover {
    color: var(--primary-color);
}

.navbar-brand i {
    font-size: 1.3rem;
}

.light-mode .navbar {
    background: rgba(248, 250, 252, 0.95);
}

.light-mode .navbar-brand {
    color: var(--text-dark);
}

/* ===== HERO SECTION ===== */
.maharbote-hero {
    position: relative;
    padding: 4rem 0 3rem;
    text-align: center;
    overflow: hidden;
}

.maharbote-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(139, 92, 246, 0.06) 0%, transparent 50%),
                radial-gradient(circle at 50% 80%, rgba(16, 185, 129, 0.05) 0%, transparent 40%);
    animation: heroGlow 12s ease-in-out infinite alternate;
    pointer-events: none;
    z-index: 0;
}

@keyframes heroGlow {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(2%, -2%) rotate(3deg); }
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    letter-spacing: 0.5px;
}

.hero-badge i {
    font-size: 0.7rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.maharbote-hero h1 {
    font-size: 3.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-purple), var(--secondary-color));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.maharbote-hero .subtitle {
    font-size: 1.15rem;
    opacity: 0.75;
    max-width: 700px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-actions .btn {
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-actions .btn-live {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-purple));
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.hero-actions .btn-live:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
}

.hero-actions .btn-source {
    background: transparent;
    color: var(--text-dark);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.hero-actions .btn-source:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-3px);
    background: rgba(37, 99, 235, 0.08);
}

.light-mode .hero-actions .btn-source {
    border-color: rgba(0, 0, 0, 0.15);
}

.light-mode .hero-actions .btn-source:hover {
    border-color: var(--primary-color);
}

/* ===== DECORATIVE DIVIDER ===== */
.section-divider {
    text-align: center;
    margin: 1rem 0 2rem;
    position: relative;
}

.section-divider::before,
.section-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 35%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.section-divider::before { left: 0; }
.section-divider::after { right: 0; }

.section-divider .star-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--card-bg-dark);
    border: 2px solid rgba(37, 99, 235, 0.2);
    border-radius: 50%;
    color: var(--accent-gold);
    font-size: 1rem;
}

/* ===== SECTION TITLES ===== */
.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

.section-title h2 {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-purple));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.section-title p {
    opacity: 0.6;
    font-size: 0.95rem;
    max-width: 500px;
    margin: 0 auto;
}

/* ===== OVERVIEW CARD ===== */
.overview-card {
    background: var(--card-bg-dark);
    border-radius: 16px;
    padding: 2.5rem;
    border: 1px solid rgba(37, 99, 235, 0.1);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-purple), var(--secondary-color));
    opacity: 0.6;
}

.overview-card:hover {
    border-color: rgba(37, 99, 235, 0.25);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.overview-card p {
    font-size: 1.05rem;
    opacity: 0.85;
    margin-bottom: 1.5rem;
}

.overview-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.overview-tags .tag {
    padding: 0.35rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(37, 99, 235, 0.15);
    transition: var(--transition);
}

.overview-tags .tag:hover {
    background: rgba(37, 99, 235, 0.2);
    transform: translateY(-2px);
}

/* ===== GALLERY ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.gallery-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.25);
    border-color: rgba(37, 99, 235, 0.2);
}

.gallery-item .gallery-img-wrapper {
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 10;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.gallery-item:hover img {
    transform: scale(1.08);
}

.gallery-item .gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.2rem 1rem 1rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0;
    transition: var(--transition);
    transform: translateY(10px);
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
    transform: translateY(0);
}

.gallery-item .gallery-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: var(--transition);
    z-index: 2;
}

.gallery-item:hover .gallery-icon {
    transform: translate(-50%, -50%) scale(1);
}

/* ===== FEATURES GRID ===== */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
}

.feature-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg-dark);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.feature-box:hover {
    border-color: rgba(37, 99, 235, 0.2);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-color);
}

.feature-icon.gold { background: rgba(245, 158, 11, 0.1); color: var(--accent-gold); }
.feature-icon.green { background: rgba(16, 185, 129, 0.1); color: var(--secondary-color); }
.feature-icon.purple { background: rgba(139, 92, 246, 0.1); color: var(--accent-purple); }

.feature-text h5 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.feature-text p {
    font-size: 0.85rem;
    opacity: 0.65;
    margin: 0;
    line-height: 1.5;
}

/* ===== TECH STACK ===== */
.tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.2rem;
}

.tech-card {
    background: var(--card-bg-dark);
    border-radius: 14px;
    padding: 2rem 1.5rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.tech-card:hover {
    transform: translateY(-5px);
    border-color: rgba(37, 99, 235, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.tech-card .tech-icon-wrap {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    margin: 0 auto 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.tech-card .tech-icon-wrap.react { background: rgba(97, 218, 251, 0.12); color: #61DAFB; }
.tech-card .tech-icon-wrap.vite { background: rgba(100, 108, 255, 0.12); color: #646CFF; }
.tech-card .tech-icon-wrap.js { background: rgba(247, 223, 30, 0.12); color: #F7DF1E; }

.tech-card h5 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.tech-card p {
    font-size: 0.82rem;
    opacity: 0.6;
    margin: 0;
    line-height: 1.5;
}

/* ===== CODE SECTION ===== */
.code-section {
    background: var(--card-bg-dark);
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.code-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.code-dots {
    display: flex;
    gap: 6px;
}

.code-dots span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.code-dots span:nth-child(1) { background: #ff5f57; }
.code-dots span:nth-child(2) { background: #ffbd2e; }
.code-dots span:nth-child(3) { background: #28c840; }

.code-title {
    font-size: 0.8rem;
    opacity: 0.5;
    font-family: 'Courier New', monospace;
}

.code-body {
    padding: 1.5rem;
    overflow-x: auto;
}

.code-body pre {
    margin: 0;
    font-size: 0.85rem;
    line-height: 1.7;
    color: var(--text-dark);
    opacity: 0.85;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
}

.code-body code .comment { color: #6b7280; }
.code-body code .keyword { color: #818cf8; }
.code-body code .string { color: #34d399; }
.code-body code .path { color: #fbbf24; }

/* ===== CALCULATION NOTE ===== */
.note-box {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1.2rem 1.5rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.15);
    border-radius: 10px;
    margin-top: 1.5rem;
}

.note-box i {
    font-size: 1.2rem;
    color: var(--accent-gold);
    margin-top: 2px;
    flex-shrink: 0;
}

.note-box p {
    font-size: 0.85rem;
    opacity: 0.7;
    margin: 0;
    line-height: 1.6;
}

/* ===== CTA SECTION ===== */
.cta-section {
    text-align: center;
    padding: 3.5rem 2.5rem;
    background: var(--card-bg-dark);
    border-radius: 16px;
    border: 1px solid rgba(37, 99, 235, 0.1);
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(37, 99, 235, 0.06) 0%, transparent 60%);
    pointer-events: none;
}

.cta-section h3 {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
}

.cta-section > p {
    font-size: 0.95rem;
    opacity: 0.65;
    max-width: 550px;
    margin: 0 auto 1.5rem;
}

.cta-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-actions .btn {
    padding: 0.75rem 1.8rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: none;
    text-decoration: none;
}

.cta-actions .btn-live {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-purple));
    color: white;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

.cta-actions .btn-live:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.4);
    color: white;
}

.cta-actions .btn-source {
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.cta-actions .btn-source:hover {
    background: transparent;
    color: var(--primary-color);
    transform: translateY(-3px);
}

.light-mode .cta-actions .btn-source {
    background: var(--primary-color);
    color: white;
}

.light-mode .cta-actions .btn-source:hover {
    background: transparent;
    color: var(--primary-color);
}

/* ===== FLOATING BUTTONS ===== */
.floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 1000;
}

.back-to-top,
.theme-toggle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
}

.back-to-top:hover,
.theme-toggle:hover {
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

/* Back Button */
.back-button {
    position: fixed;
    bottom: 40px;
    left: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 50px;
    padding: 12px 24px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
}

.back-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* ===== LIGHTBOX ===== */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
    backdrop-filter: blur(8px);
    transition: background 0.3s;
}

:root.light-mode .lightbox-overlay {
    background: rgba(248, 250, 252, 0.88);
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-overlay img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: lightboxIn 0.3s ease-out;
}

:root.light-mode .lightbox-overlay img {
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

@keyframes lightboxIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
    background: rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

:root.light-mode .lightbox-close {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.7);
}

.lightbox-close:hover {
    opacity: 1;
    transform: rotate(90deg);
}

.lightbox-caption {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 20px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
    transition: background 0.3s, color 0.3s;
}

:root.light-mode .lightbox-caption {
    color: rgba(15, 23, 42, 0.8);
    background: rgba(255, 255, 255, 0.7);
}

/* ===== FOOTER ===== */
footer {
    background: var(--background-darker);
    color: var(--text-dark);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
    transition: background 0.5s, color 0.5s;
}

footer p {
    margin: 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.light-mode footer {
    background: #e2e8f0;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-up {
    animation: fadeInUp 0.7s ease-out forwards;
}

.delay-100 { animation-delay: 0.1s; }
.delay-150 { animation-delay: 0.15s; }
.delay-200 { animation-delay: 0.2s; }
.delay-250 { animation-delay: 0.25s; }
.delay-300 { animation-delay: 0.3s; }
.delay-350 { animation-delay: 0.35s; }
.delay-400 { animation-delay: 0.4s; }

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .features-grid {
        grid-template-columns: 1fr;
    }
    
    .tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .maharbote-hero h1 {
        font-size: 2.2rem;
    }
    
    .maharbote-hero {
        padding: 2.5rem 0 2rem;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .tech-grid {
        grid-template-columns: 1fr;
    }
    
    .overview-card {
        padding: 1.5rem;
    }
    
    .cta-section {
        padding: 2rem 1.5rem;
    }
    
    .back-button {
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        padding: 10px 20px;
        font-size: 0.85rem;
    }
    
    .back-button:hover {
        transform: translateX(-50%) translateY(-2px);
    }
    
    .section-divider::before,
    .section-divider::after {
        width: 20%;
    }
}

@media (max-width: 575px) {
    html {
        scrollbar-color: var(--primary-color) var(--background-dark);
        scrollbar-width: thin;
    }
    
    ::-webkit-scrollbar {
        height: 8px;
        width: 8px;
    }
}