* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", "DejaVu Sans", "Cantarell", Ubuntu, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #000 0%, #111 30%, #000 70%, #000 100%);
    color: #fff;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

/* Global text rhythm */
p { margin: 0 0 0.75rem; }
p, li { line-height: 1.7; }

/* Constrain long text lines for readability (not in cards) */
.section-content p { max-width: none; }
.section-content p:last-child { margin-bottom: 0; }
.modal-body p { max-width: none; }

/* Let card text take full width */
.project-card p, .education-item p { max-width: none; }

/* Headings spacing within sections */
.section-content h2 { margin: 0 0 0.5rem; }
.section-content h3 { margin: 0.8rem 0 0.4rem; }

/* Dark overlay for better readability */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    pointer-events: none;
    z-index: 0;
}

body {
    position: relative;
}

/* Ensure content stays above overlay */
.sidebar, .content-area, .loading-screen, .modal-overlay, .image-modal-overlay {
    position: relative;
    z-index: 1;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 2px solid #ff66cc;
    outline-offset: 2px;
}

/* Page scrollbar styling (visible) */
body::-webkit-scrollbar { width: 12px; }
body::-webkit-scrollbar-track { background: #000; }
body::-webkit-scrollbar-thumb {
    background: #4a0fa8; /* even darker purple */
    border-radius: 10px;
    border: 2px solid #000;
}
body::-webkit-scrollbar-thumb:hover { background: #5a13c1; }
body::-webkit-scrollbar-corner { background: #000; }


/* Loading Animation */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, #000, #1a0033, #330066);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    animation: fadeOut 0.6s ease-in-out 1.2s forwards;
}

.loading-text {
    font-size: 2.5rem;
    margin-bottom: 30px;
    animation: pulse 2s infinite;
    background: linear-gradient(45deg, #9933ff, #ff66cc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 3px solid #333;
    border-top: 3px solid #9933ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Left-side GIF panel */
.space-bg {
    position: fixed;
    top: 0;
    right: 0;
    width: 84vw; /* adjust the portion of screen showing the GIF */
    height: 100vh;
    background: url('background.gif?v=2025-09-20-1') center/cover no-repeat;
    pointer-events: none;
    z-index: 0; /* behind content but above page background */
}

/* Soften the edge where the GIF meets the right side */
.space-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 100%;
    background: linear-gradient(to right, rgba(0,0,0,0.4) 0%, rgba(0,0,0,0) 100%);
}

/* Dark overlay to make background darker and improve text readability - TEMPORARILY DISABLED */
/*
.space-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: -1;
}
*/

/* Main Container */
.main-container {
    display: flex;
    min-height: 100vh;
    opacity: 0;
    animation: slideIn 0.6s ease-out 1.8s forwards;
    position: relative;
    z-index: 10;
}

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

/* Sidebar */
.sidebar {
    width: 250px;
    background: #000; /* fully opaque to override background */
    border-right: 1px solid rgba(255, 255, 255, 0.2);
    padding: 30px 0;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: auto;
    min-height: 100vh;
    overflow-y: auto;
    z-index: 1000;
}

/* Hide sidebar scrollbar but keep it scrollable */
.sidebar::-webkit-scrollbar { width: 0; height: 0; }
.sidebar { -ms-overflow-style: none; /* IE/Edge */ }
/* Firefox-only property; ignored elsewhere */
/* Firefox shows default sidebar scrollbar; acceptable for compatibility */

/* Logo Section Styles */
.logo-section {
    padding: 20px 30px 40px 30px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.logo-image {
    max-width: 120px;
    max-height: 80px;
    width: auto;
    height: auto;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.05);
}

/* Alternative: Text-based logo */
.logo-text {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(45deg, #9933ff, #ff66cc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo-text:hover {
    transform: scale(1.05);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 15px 30px;
    color: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.nav-item:hover,
.nav-item.active {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: rgba(255, 255, 255, 0.5);
    transform: translateX(10px);
}

.nav-item i {
    margin-right: 15px;
    width: 20px;
    display: inline-block;
    text-align: center;
    font-style: normal;
}

/* Content Area */
.content-area {
    margin-left: 250px;
    flex: 1;
    padding: 28px 40px 40px;
    min-height: 100vh;
    width: calc(100% - 250px);
    max-width: calc(100% - 250px);
    overflow-x: hidden;
    overflow-y: auto; /* allow page/content to scroll */
}

.content-section {
    display: none;
    animation: slideInFromBottom 0.6s ease-out;
}

.content-section.active {
    display: block;
}

/* Remove section-specific scrollbar styling; use page default */

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

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

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

.section-title {
    font-size: 3rem;
    margin-bottom: 12px;
    background: rgba(0, 0, 0, 0.8);
    color: #9933ff;
    -webkit-text-fill-color: #9933ff;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    display: inline-block;
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Make Home title easier to read: add a box style only for #home */


.section-content {
    background: rgba(0, 0, 0, 0.8);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    padding: 22px 30px 30px;
    margin-bottom: 30px;
    color: #ffffff;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

.project-card, .education-item {
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 16px 20px 20px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
    color: #ffffff;
}

/* Remove extra top gap inside cards */
.project-card h3,
.education-item h3 { margin: 0 0 8px; }
.project-card > :first-child,
.education-item > :first-child { margin-top: 0; }

.bullets{
    margin-left: 30px;
}

.h3-font-size{
    font-size: 23px;
}

/* Square card layout for Projects and Extracurriculars */
#projects .section-content,
#extracurriculars .section-content {
    display: block; /* Reverted: use natural document flow for cards; grid removed */
}

#projects .section-content .project-card,
#extracurriculars .section-content .project-card {
    overflow: hidden;
    display: block;
    margin-bottom: 20px;
}

/* Make titles compact, keep badges aligned */
#projects .section-content .project-card h3,
#extracurriculars .section-content .project-card h3 {
    margin-bottom: 8px;
}

#projects .section-content .project-card .badge,
#extracurriculars .section-content .project-card .badge {
    align-self: flex-start;
    margin-bottom: 8px;
}

/* Clamp text so content fits inside the square */
#projects .section-content .project-card p,
#extracurriculars .section-content .project-card p {
    display: block;
    overflow-wrap: break-word;
    word-break: normal;
}

/* Keep action at the bottom of the square */
#projects .section-content .project-card .view-details-btn,
#extracurriculars .section-content .project-card .view-details-btn {
    margin-top: 15px;
}

/* Removed square grid mobile overrides */

.project-card:hover, .education-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}
/* View Details Button */
.view-details-btn {
    background: linear-gradient(45deg, #333, #555);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    padding: 10px 20px;
    margin-top: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.view-details-btn:hover {
    background: linear-gradient(45deg, #555, #777);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Modal Styles */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    max-width: 900px;
    max-height: 90vh;
    width: 100%;
    position: relative;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

/* Modal scrollbar styling to match page */
.modal-content::-webkit-scrollbar { width: 12px; }
.modal-content::-webkit-scrollbar-track { background: #000; }
.modal-content::-webkit-scrollbar-thumb {
    background: #4a0fa8;
    border-radius: 10px;
    border: 2px solid #000;
}
.modal-content::-webkit-scrollbar-thumb:hover { background: #5a13c1; }
.modal-content::-webkit-scrollbar-corner { background: #000; }

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 2rem;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10001;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 40px;
    color: #fff;
    line-height: 1.6;
}

.modal-body h1 {
    background: linear-gradient(45deg, #9933ff, #ff66cc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.modal-body h2 {
    color: #fff;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.modal-body h3 {
    color: #ccc;
    margin-top: 25px;
    margin-bottom: 10px;
}

.modal-body p {
    margin-bottom: 15px;
}

.modal-body ul {
    margin-left: 20px;
    margin-bottom: 20px;
}

.modal-body li {
    margin-bottom: 8px;
}

.modal-links {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.modal-link {
    background: linear-gradient(45deg, #9933ff, #ff66cc);
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.modal-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(153, 51, 255, 0.3);
}

/* Badges */
.badge {
    display: inline-block;
    font-size: 0.75rem;
    line-height: 1;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(153, 51, 255, 0.6);
    background: rgba(153, 51, 255, 0.12);
    color: #9933ff;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* Contact grid layout (moved from inline styles) */
.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Utility helpers (replace inline styles) */
.mt-30 { margin-top: 30px !important; }
.fs-22 { font-size: 22px !important; }
.fs-19 { font-size: 19px !important; }

.badge-fun {
    border-color: rgba(255, 102, 204, 0.6);
    background: rgba(255, 102, 204, 0.12);
    color: #ff66cc;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0;
}

.tech-item {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    color: #fff;
}

/* Star Animation */
@keyframes starFade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(2);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    .content-area {
        margin-left: 200px;
        padding: 20px;
    }
    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 600px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .content-area {
        margin-left: 0;
    }
}
