:root {
    --bg-color: #1a1a1a;
    --surface-color: #2a2a2a;
    --surface-color-light: #3a3a3a;
    --text-color: #f0f0f0;
    --text-muted: #aaaaaa;
    --teal-primary: #00adb5;
    --teal-hover: #00d2d3;
    --border-radius: 12px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Typography styles */
h1, h2, h3, h4 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

a {
    color: var(--teal-primary);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--teal-hover);
}

/* Navigation */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: rgba(42, 42, 42, 0.95);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    backdrop-filter: blur(10px);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.nav-brand .accent {
    color: var(--teal-primary);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
}

.nav-links a:hover {
    color: var(--teal-primary);
}

/* Hero Section */
.hero {
    height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a3333 100%);
    padding: 0 1rem;
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--teal-primary);
    animation: fadeInDown 1s ease;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    animation: fadeInUp 1s ease;
}

/* Portfolio Grid */
.portfolio-section {
    padding: 4rem 2%; /* Small margins */
    max-width: 1600px;
    margin: 0 auto;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

/* Grid breakpoints */
@media (min-width: 768px) {
    .portfolio-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2rem;
    }
}

@media (min-width: 1200px) {
    .portfolio-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 2rem;
    }
}

/* Project Card */
.project-card {
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
    display: flex;
    flex-direction: column;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0, 173, 181, 0.2);
}

/* Carousel */
.carousel-container {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: var(--surface-color-light);
}

.carousel-track {
    display: flex;
    height: 100%;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 0.2s, opacity 0.2s;
    z-index: 2;
    opacity: 0;
    pointer-events: none;
}

.project-card:hover .carousel-btn {
    opacity: 1;
    pointer-events: auto;
}

.carousel-btn:hover {
    background: var(--teal-primary);
}

.carousel-btn.prev {
    left: 10px;
}

.carousel-btn.next {
    right: 10px;
}

/* Project Info */
.project-info {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.project-title {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.project-details {
    display: none;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
    animation: fadeIn 0.5s ease;
}

.tools-used {
    display: none;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.5s ease;
}

.tool-badge {
    background: rgba(0, 173, 181, 0.15);
    color: var(--teal-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    border: 1px solid rgba(0, 173, 181, 0.3);
}

.btn-shrink {
    display: none;
    align-self: flex-start;
    padding: 0.5rem 1.25rem;
    background-color: transparent;
    color: var(--teal-primary);
    border: 1px solid var(--teal-primary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    margin-top: auto;
}

.btn-shrink:hover {
    background-color: var(--teal-primary);
    color: var(--bg-color);
}

/* Expanded State */
.project-card.expanded {
    grid-column: 1 / -1;
    cursor: default;
    transform: none;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    /* For better layout on desktop when expanded */
    flex-direction: column;
}

@media (min-width: 900px) {
    .project-card.expanded {
        flex-direction: row;
        align-items: stretch;
    }
    
    .project-card.expanded .carousel-container {
        width: 65%;
        aspect-ratio: 16 / 9; /* Wider aspect ratio for expanded view */
    }
    
    .project-card.expanded .project-info {
        width: 35%;
        padding: 2rem;
        justify-content: center;
    }

    .project-card.expanded .project-title {
        font-size: 2rem;
        margin-bottom: 1rem;
        color: var(--teal-primary);
    }
}

.project-card.expanded .project-details,
.project-card.expanded .tools-used,
.project-card.expanded .btn-shrink {
    display: flex;
}

.project-card.expanded .project-details {
    display: block;
}

/* Footer */
.footer {
    background-color: var(--surface-color);
    padding: 3rem 5%;
    text-align: center;
    margin-top: 4rem;
}

.footer h3 {
    color: var(--teal-primary);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.footer p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: var(--teal-primary);
    color: var(--bg-color);
    border-radius: 4px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 6px rgba(0, 173, 181, 0.3);
}

.btn:hover {
    background-color: var(--teal-hover);
    color: var(--bg-color);
}

.copyright {
    margin-top: 3rem;
    font-size: 0.85rem;
    color: #666;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--teal-primary);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color var(--transition-speed);
}

.lightbox-close:hover {
    color: var(--teal-hover);
}

/* Make hoverable carousel images change mouse cursor when expanded */
.project-card.expanded .carousel-slide img {
    cursor: zoom-in;
    pointer-events: auto; /* Enable clicking on the image when expanded */
}

/* Lightbox Navigation Buttons */
.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.5rem;
    transition: background 0.2s;
    z-index: 2001;
}

.lightbox-btn:hover {
    background: var(--teal-primary);
}

.lightbox-btn.prev {
    left: 20px;
}

.lightbox-btn.next {
    right: 20px;
}
