/* ========================================
   PERSONAL WEBSITE STYLES
   ========================================
   This CSS file controls the look and feel of your entire website.
   Edit colors, fonts, spacing, and more to customize it to your liking.
   ======================================== */

/* ========================================
   VARIABLES - Change these to customize your site colors
   ======================================== */
:root {
    /* Simplified color palette — keep your logo teal as a brand token. */
    --brand-color: #32c2c4;         /* Logo / brand teal (used only for logo button) */
    --primary-color: #0f766e;       /* Main accessible teal used across UI */
    --secondary-color: #065f46;     /* Darker accent for hover/active states */
    --accent-color: #064e3b;        /* Supporting accent (deep green) */
    --text-dark: #0f172a;           /* Strong readable text color */
    --text-light: #64748b;          /* Muted secondary text */
    --background: #ffffff;          /* Main page background */
    --background-alt: #f1f5f9;      /* Subtle alternate background */
    --border-color: #e6eef2;        /* Soft border color */

    /* Font settings */
    --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    --font-heading: 'Georgia', serif;

    /* Spacing */
    --container-max-width: 1200px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;

    /* Border radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 1rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth; /* Smooth scrolling between sections */
    scrollbar-gutter: stable; /* Reserve space for scrollbar to prevent layout shift */
}

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

/* Container for centering content */
.container {
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
}

h1 { font-size: 3rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }

/* Links */
a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ========================================
   NAVIGATION BAR
   ======================================== */
.navbar {
    background-color: var(--background);
    box-shadow: var(--shadow-md);
    position: sticky; /* Navbar stays at top when scrolling */
    top: 0;
    z-index: 1000;
    padding: var(--spacing-sm) 0;
}

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

/* Logo Section */
.logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.logo img {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Navigation Links */
.nav-links {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
}

.nav-links a {
    color: var(--text-dark);
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--secondary-color);
    background-color: var(--background-alt);
}

.nav-links a.active {
    color: var(--secondary-color);
    background-color: var(--background-alt);
}

/* Mobile Hamburger Menu */
.hamburger {
    display: none; /* Hidden on desktop, shown on mobile */
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
}

.hamburger span {
    width: 25px;
    height: 3px;
    background-color: var(--text-dark);
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* ========================================
   HOME/INTRO PAGE
   ======================================== */
.intro-page {
    min-height: 100vh;
}

/* Hero Section */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 90vh;
    background: linear-gradient(135deg, var(--background-alt) 0%, var(--background) 100%);
    padding: var(--spacing-lg) var(--spacing-md);
}

.hero-content {
    text-align: center;
    max-width: 800px;
}

.profile-photo {
    width: 300px;
    height: 300px;
    border-radius: 0; /* Square profile image */
    object-fit: cover;
    margin: 0 auto var(--spacing-md);
    border: 5px solid var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: var(--spacing-sm);
}

.highlight {
    color: var(--primary-color);
}

.tagline {
    font-size: 1.5rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
}

.intro-text {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: var(--spacing-md);
    line-height: 1.8;
}

/* Social Media Links */
.social-links {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
    margin: var(--spacing-md) 0;
}

.social-links a {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--background-alt);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--secondary-color);
    color: white;
    transform: translateY(-5px);
}

/* Call to Action Button */
.cta-button {
    display: inline-block;
    background-color: var(--secondary-color);
    color: white;
    padding: 1rem 2.5rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1.1rem;
    margin-top: var(--spacing-md);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.cta-button:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* About Section */
.about {
    padding: var(--spacing-lg) 0;
    background-color: var(--background);
}

.about h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.about-content {
    display: grid;
    /* Use a responsive grid so a single child will center itself
       instead of sticking to the left when the second column is missing. */
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-md);
    justify-items: center; /* center items within their grid cells */
}

/* Constrain the about text so it doesn't become too wide when centered */
.about-text {
    max-width: 680px;
    text-align: center; /* center headings and paragraphs inside the about block */
}

.about-text p {
    margin-bottom: var(--spacing-sm);
    color: var(--text-light);
}

/* Skills Tags */
.skills h3 {
    margin-bottom: var(--spacing-sm);
}

.skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
}

.skill-tag {
    background-color: var(--background-alt);
    color: var(--text-dark);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
}

/* ========================================
   GALLERY PAGE
   ======================================== */
.gallery-page {
    min-height: 100vh;
    padding: var(--spacing-lg) 0;
    background-color: var(--background-alt);
}

.gallery-page h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

.page-intro {
    text-align: center;
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
}

/* Unsplash Collection Links */
.unsplash-collections {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.unsplash-collections h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.collection-buttons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.collection-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.collection-btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Gallery Filters */
.gallery-filters {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background-color: var(--background);
    color: var(--text-dark);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

.filter-btn.active {
    background-color: var(--secondary-color);
    color: white;
    border-color: var(--secondary-color);
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--spacing-md);
    contain: layout; /* Isolate layout recalculations */
}

.gallery-item {
    position: relative;
    overflow: visible;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.gallery-item.hidden {
    display: none; /* Used by JavaScript filter */
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    transition: transform 0.3s ease;
}

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

/* Persistent Gallery Caption - Shows below each photo */
.gallery-caption {
    padding: var(--spacing-sm);
    text-align: center;
    background-color: var(--background-alt);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    border: 1px solid var(--border-color);
    border-top: none;
}

.gallery-caption a {
    display: block;
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.gallery-caption a:hover {
    color: var(--primary-color);
}

.gallery-caption h4 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-dark);
}

.gallery-caption p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Gallery Overlay - Shows on hover */
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    padding: var(--spacing-md);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

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

.gallery-overlay h3 {
    font-size: 1.2rem;
    margin-bottom: 0.25rem;
}

.gallery-overlay p {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Lightbox - Shows enlarged image when clicked */
.lightbox {
    display: none; /* Hidden by default, shown by JavaScript */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-image {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 40px;
    font-size: 50px;
    color: white;
    cursor: pointer;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 40px;
    color: white;
    background-color: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 1rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

/* ========================================
   PROJECTS PAGE
   ======================================== */
.projects-page {
    min-height: 100vh;
    padding: var(--spacing-lg) 0;
    background-color: var(--background-alt);
}

.projects-page h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

/* Project Tabs */
.project-tabs {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.tab-btn {
    padding: 0.75rem 2rem;
    border: none;
    background-color: var(--background);
    color: var(--text-dark);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.tab-btn:hover {
    background-color: var(--secondary-color);
    color: white;
}

.tab-btn.active {
    background-color: var(--secondary-color);
    color: white;
}

/* Projects Container */
.projects-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Individual Project Card */
.project-card {
    display: flex;
    flex-direction: row;
    background-color: var(--background);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    align-items: stretch;
    contain: layout; /* Isolate layout recalculations */
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.project-card.hidden {
    display: none; /* Used by JavaScript filter */
}

/* Alternate image position based on data-layout attribute */
.project-card[data-layout="image-right"] {
    flex-direction: row-reverse;
}

.project-image {
    flex: 0 0 40%;
    min-height: 350px;
    overflow: hidden;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.project-image iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

.project-card:hover .project-image img {
    transform: scale(1.1);
}

.project-content {
    flex: 1;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.project-header {
    display: flex;
    flex-direction: column; /* stack title and badge vertically */
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: var(--spacing-sm);
}

.project-header h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 0; /* remove default margin so spacing is controlled by gap */
}

/* Project Badges */
.project-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.project-badge.professional {
    background-color: #dbeafe;
    color: #1e40af;
}

.project-badge.personal {
    background-color: #fef3c7;
    color: #92400e;
}

.project-description {
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

/* Technology Tags */
.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: var(--spacing-md);
}

.tag {
    background-color: var(--background-alt);
    color: var(--text-dark);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
}

/* Project Links/Buttons */
.project-links {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-primary {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--secondary-color);
    color: white;
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
}

.btn-secondary {
    flex: 1;
    text-align: center;
    padding: 0.75rem 1.5rem;
    background-color: transparent;
    color: var(--secondary-color);
    border: 2px solid var(--secondary-color);
    border-radius: var(--radius-md);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: var(--accent-color);
    color: white;
}

/* ========================================
   BLOG PAGE
   ======================================== */
.blog-page {
    min-height: 100vh;
    padding: var(--spacing-lg) 0;
    background-color: var(--background-alt);
}

.blog-page h1 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

/* Blog Filters */
.blog-filters {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: var(--spacing-lg);
}

/* Individual Blog Card */
.blog-card {
    background-color: var(--background);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.blog-card.hidden {
    display: none; /* Used by JavaScript filter */
}

.blog-image {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content Type Badges */
.content-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-badge {
    background-color: var(--primary-color);
    color: white;
}

.video-badge {
    background-color: #dc2626;
    color: white;
}

.blog-content {
    padding: var(--spacing-md);
}

/* Blog Meta Info */
.blog-meta {
    display: flex;
    gap: var(--spacing-sm);
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: var(--spacing-sm);
}

.blog-meta .date::after {
    content: "•";
    margin-left: var(--spacing-sm);
}

.blog-content h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

.blog-content h3 a {
    color: var(--text-dark);
    transition: color 0.3s ease;
}

.blog-content h3 a:hover {
    color: var(--primary-color);
}

.blog-excerpt {
    color: var(--text-light);
    margin-bottom: var(--spacing-sm);
    line-height: 1.6;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: var(--spacing-md);
}

.read-more {
    color: var(--primary-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: gap 0.3s ease;
}

.read-more:hover {
    gap: 0.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-lg);
}

.page-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background-color: var(--background);
    color: var(--text-dark);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.page-btn:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

.page-num {
    width: 40px;
    height: 40px;
    border: 2px solid var(--border-color);
    background-color: var(--background);
    color: var(--text-dark);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-num:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-num.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ========================================
   FOOTER
   ======================================== */
footer {
    background-color: var(--text-dark);
    color: white;
    text-align: center;
    padding: var(--spacing-md);
    margin-top: var(--spacing-lg);
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--accent-color);
    text-decoration: underline;
}

footer a:hover {
    color: white;
}

/* ========================================
   RESPONSIVE DESIGN - Mobile/Tablet
   ======================================== */
@media (max-width: 768px) {
    /* Navigation - Show hamburger menu on mobile */
    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background-color: var(--background);
        width: 100%;
        padding: var(--spacing-md);
        box-shadow: var(--shadow-lg);
        transition: left 0.3s ease;
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    /* Hero Section */
    .hero h1 {
        font-size: 2.5rem;
    }
    
    .profile-photo {
        width: 150px;
        height: 150px;
        border-radius: 0; /* Keep square on mobile */
    }
    
    /* About Section - Stack on mobile */
    .about-content {
        grid-template-columns: 1fr;
    }
    
    /* Gallery Grid - 2 columns on mobile */
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: var(--spacing-sm);
    }
    
    /* Projects Grid - Stack vertically on mobile */
    .projects-container {
        flex-direction: column;
    }
    
    .project-card {
        flex-direction: column !important;
    }
    
    .project-image {
        flex: 0 0 250px;
        min-height: 250px;
    }
    
    /* Blog Grid - 1 column on mobile */
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    /* Adjust spacing */
    :root {
        --spacing-lg: 2rem;
        --spacing-md: 1rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
}

/* Tablet view */
@media (min-width: 769px) and (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .projects-container,
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
