/* Modern Dark Portfolio Styles */

:root {
    --bg-dark: #0a0a0a;
    --bg-card: #141414;
    --bg-card-hover: #1c1c1c;
    --border-color: #262626;
    --text-main: #f5f5f5;
    --text-muted: #a1a1aa;
    --accent: #e2e8f0;
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

body {
    font-family: var(--font-sans);
    line-height: 1.6;
    color: var(--text-main);
    background-color: var(--bg-dark);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 5%;
}

/* Header & Nav */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 1.5rem 0;
    z-index: 1000;
    transition: all 0.3s ease;
    background-color: transparent;
}

.header.scrolled {
    background-color: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 5%;
    padding-right: 7rem; /* Explicitly reserve space for the live clock */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.nav-menu ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.nav-menu a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-menu a:hover {
    color: var(--text-main);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.hamburger .bar {
    width: 20px;
    height: 2px;
    background-color: var(--text-muted);
    transition: 0.3s;
}

/* Typography Overrides */
h1 {
    font-size: 3.5rem;
    font-weight: 700;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 0.5rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: -0.5px;
    margin-bottom: 3rem;
    color: var(--text-main);
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 5rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    background-image: url('hero-illustration.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.15;
    filter: blur(4px);
    z-index: 0;
}

.hero-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4rem;
    width: 100%;
    position: relative;
    z-index: 1;
}

.hero-content {
    flex: 1;
    max-width: 500px;
}

.hero-subtitle {
    font-size: 2rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 1.5rem;
}

.hero-description {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 2.5rem;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.03);
    transition: all 0.2s ease;
}

.btn-outline:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.profilepic {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 4px solid var(--border-color);
    object-fit: cover;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    /* filter: grayscale(70%); */
    transition: all 0.4s ease;
}

.profilepic:hover {
    filter: grayscale(0%);
    transform: scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Skills Section */
.skills-section {
    padding: 6rem 0;
    background-color: #0d0d0d;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.skills-table {
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 3rem auto 0;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: transparent;
}

.skills-row {
    display: flex;
    align-items: stretch;
    border-bottom: 1px solid var(--border-color);
}

.skills-row:last-child {
    border-bottom: none;
}

.skills-category-name {
    flex: 0 0 200px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-main);
    padding: 1.5rem;
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
}

.skills-list {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1.5rem;
}

.skill-badge {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 0.4rem 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.skill-badge:hover {
    background-color: var(--bg-card-hover);
    border-color: #404040;
    transform: translateY(-2px);
}

.skill-badge img {
    width: 18px;
    height: 18px;
}

.skill-badge span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
}

.skill-badge:hover span {
    color: var(--text-main);
}

.badge-glow-react {
    border-color: rgba(97, 218, 251, 0.2);
    box-shadow: 0 0 10px rgba(97, 218, 251, 0.05);
}

.badge-glow-react:hover {
    border-color: rgba(97, 218, 251, 0.5);
    box-shadow: 0 0 15px rgba(97, 218, 251, 0.2);
}

.badge-glow-js {
    border-color: rgba(247, 223, 30, 0.2);
    box-shadow: 0 0 10px rgba(247, 223, 30, 0.05);
}

.badge-glow-js:hover {
    border-color: rgba(247, 223, 30, 0.5);
    box-shadow: 0 0 15px rgba(247, 223, 30, 0.2);
}

.invert-dark {
    filter: invert(1) drop-shadow(0 0 2px rgba(255,255,255,0.2));
}

/* Projects Section (Integrated with projects-loader.js) */
.projects-section {
    padding: 6rem 0;
}

.projects-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
}

.project-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    padding: 0.75rem;
}

.project-card.preview-active {
    flex-direction: row-reverse;
    align-items: center;
    gap: 1.5rem;
}

.project-card:hover {
    transform: translateY(-8px);
    border-color: #404040;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.project-image {
    display: none;
    width: 100%;
    height: auto;
    overflow: hidden;
    background-color: #1a1a1a;
    border: 1px solid #222;
    border-radius: 8px;
}

.project-card.preview-active .project-image {
    display: block;
    width: 320px;
    flex-shrink: 0;
}

.project-image img,
.project-image video {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease, filter 0.3s ease;
    filter: brightness(0.8) contrast(1.1);
}

.project-card:hover .project-image img,
.project-card:hover .project-image video {
    transform: scale(1.02);
    filter: brightness(1) contrast(1.1);
}

.project-content {
    padding: 1rem 0.25rem 0.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-card.preview-active .project-content {
    padding: 0.5rem;
}

.project-content h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.project-content p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
    flex-grow: 1;
}

.project-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.project-links .btn {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
    text-align: center;
    border: 1px solid #333;
    background-color: #1a1a1a;
    color: #dedede;
}

.project-links .btn:hover {
    background-color: #262626;
    border-color: #404040;
}

/* Removed btn-demo btn-primary btn-linkedin overrides to keep them all matching gray vibe */

/* Contact / Footer Section */
.contact-section {
    padding: 4rem 0 2rem;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.divider {
    text-align: center;
    position: relative;
    margin: 2rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: var(--border-color);
    z-index: 1;
}

.divider span {
    background-color: var(--bg-dark);
    padding: 0 1.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    z-index: 2;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 50px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.social-link svg {
    opacity: 0.8;
}

.social-link:hover {
    background-color: var(--text-main);
    color: var(--bg-dark);
    border-color: var(--text-main);
}

.footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
}

.footer p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 900px) {
    .hero-container {
        flex-direction: column-reverse;
        text-align: center;
        padding-top: 3rem;
        gap: 2rem;
    }
    .hero-content {
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    h1 { font-size: 2.8rem; }
    .hero-subtitle { font-size: 1.5rem; }
    
    .hero-image {
        display: flex;
        justify-content: center;
        width: 100%;
    }
    
    .profilepic {
        width: 180px;
        height: 180px;
        border-width: 3px;
    }
    
    .skills-grid {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    h1 { font-size: 2.15rem; }
    .hero-subtitle { font-size: 1.2rem; }
    .hero-description { font-size: 0.95rem; padding: 0 1rem; }
    
    .hamburger { display: flex; }
    
    .nav-menu {
        position: fixed;
        z-index: 1001;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: rgba(10, 10, 10, 0.98);
        padding-top: 5rem;
        transition: right 0.3s ease;
        border-left: 1px solid var(--border-color);
    }
    
    .nav-menu.active { right: 0; }
    
    .nav-container {
        padding-right: 5%; /* Restore standard padding for mobile */
    }

    .nav-menu ul {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    
    .skills-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .skills-category-name {
        flex: none;
        width: 100%;
        border-right: none;
        border-bottom: 1px dashed rgba(255,255,255,0.1);
        padding: 1rem 1.5rem;
    }

    .skills-list {
        padding: 1rem 1.5rem 1.5rem;
    }

    .projects-container {
        grid-template-columns: 1fr;
    }

    .project-card.preview-active {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .project-card.preview-active .project-image {
        width: 100%;
        margin-top: 1rem;
    }
}

html { scroll-behavior: smooth; }

/* System UI Elements */
.system-ui-element {
    position: fixed;
    z-index: 900;
    font-family: inherit;
    font-variant-numeric: tabular-nums;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    background-color: rgba(10, 10, 10, 0.4);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    pointer-events: none;
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.live-clock {
    top: 1.5rem;
    right: 1.5rem;
}

.time-spent {
    bottom: 1.5rem;
    right: 1.5rem;
}

@media (max-width: 768px) {
    .live-clock {
        top: 5rem; /* Firmly below mobile header */
        right: 1rem;
        left: auto;
    }
    .time-spent {
        bottom: 1rem;
        right: 1rem;
    }
}
