:root {
    --primary: #ffffff;
    --primary-light: #e5e5e5;
    --secondary: #cccccc;
    --accent: #999999;
    
    --bg-dark: #0a0a0a;
    --bg-dark-2: #1a1a1a;
    --bg-dark-3: #2a2a2a;
    
    --text-light: #ffffff;
    --text-gray: #cccccc;
    --text-muted: #999999;
    
    --gradient-primary: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
    
    --card-bg: rgba(26, 26, 26, 0.9);
    --card-border: #3a3a3a;
    --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 12px;
}

[data-theme="light"] {
    --bg-dark: #f5f5f5;
    --bg-dark-2: #e8e8e8;
    --bg-dark-3: #d5d5d5;
    
    --text-light: #0a0a0a;
    --text-gray: #333333;
    --text-muted: #666666;
    
    --card-bg: rgba(255, 255, 255, 0.95);
    --card-border: #c0c0c0;
    --card-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    transition: var(--transition);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Portfolio Text Overlay */
.portfolio-text {
    position: fixed;
    top: 50%;
    left: 50px;
    transform: translateY(-50%);
    font-size: clamp(80px, 12vw, 150px);
    font-weight: 800;
    color: rgba(255, 255, 255, 0.03);
    letter-spacing: 0.02em;
    z-index: 0;
    pointer-events: none;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    user-select: none;
}

[data-theme="light"] .portfolio-text {
    color: rgba(0, 0, 0, 0.02);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--card-border);
    height: 80px;
    transition: var(--transition);
}

[data-theme="light"] .header {
    background: rgba(245, 245, 245, 0.95);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.header-content {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 3rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    height: 45px;
    display: flex;
    align-items: center;
}

.logo img {
    height: 100%;
    width: auto;
    max-height: 45px;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn {
    padding: 0.85rem 1.8rem;
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    background: transparent;
    color: var(--text-light);
}

.btn-primary {
    background: var(--primary);
    color: #0a0a0a;
}

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

[data-theme="light"] .btn-primary {
    color: #0a0a0a;
}

[data-theme="light"] .btn-primary:hover {
    color: var(--text-light);
}

/* Fullscreen Button */
.fullscreen-toggle {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: var(--transition);
    color: var(--text-light);
}

.fullscreen-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .fullscreen-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Fullscreen icon changes when in fullscreen */
:fullscreen .fullscreen-toggle i::before,
:-webkit-full-screen .fullscreen-toggle i::before,
:-moz-full-screen .fullscreen-toggle i::before {
    content: "\f066"; /* fas fa-compress */
}

.theme-toggle {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: var(--transition);
    color: var(--text-light);
}

.theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .theme-toggle:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Offline Status Indicator */
.offline-status {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 0, 0, 0.9);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    display: none; /* Hidden by default, shown when offline */
    align-items: center;
    gap: 10px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s ease;
    max-width: 90%;
    width: auto;
    white-space: nowrap;
}

.offline-status i {
    font-size: 1.2rem;
}

.offline-status span {
    font-size: 0.9rem;
    font-weight: 500;
}

.offline-close {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    margin-left: 10px;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.offline-close:hover {
    opacity: 1;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Projects Section - Masonry Layout */
.projects-section {
    padding: 120px 8rem 4rem;
    min-height: 100vh;
    background: var(--bg-dark);
    position: relative;
    z-index: 1;
}

.projects-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    grid-auto-rows: auto;
}

.project-card {
    position: relative;
    overflow: visible;
    cursor: pointer;
    text-decoration: none;
    display: block;
    transition: var(--transition);
    padding: 12px;
}

.project-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 2px solid var(--card-border);
    border-radius: var(--border-radius);
    pointer-events: none;
    transition: var(--transition);
}

.project-card:hover::before {
    border-color: var(--primary);
}

.project-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
}

.project-image-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.project-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
    filter: grayscale(30%);
    border-radius: 8px;
}

[data-theme="light"] .project-image {
    filter: grayscale(0%);
}

.project-card:hover .project-image {
    transform: scale(1.1);
    filter: grayscale(0%);
}

.project-overlay {
    position: absolute;
    inset: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, 
        rgba(10, 10, 10, 0.95) 0%, 
        rgba(10, 10, 10, 0.7) 50%,
        transparent 100%);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    border-radius: 8px;
}

[data-theme="light"] .project-overlay {
    background: linear-gradient(to top, 
        rgba(245, 245, 245, 0.95) 0%, 
        rgba(245, 245, 245, 0.7) 50%,
        transparent 100%);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-card:hover .project-card-inner {
    transform: scale(1.02);
    box-shadow: 0 20px 40px rgba(255, 255, 255, 0.1);
}

.project-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: white;
    line-height: 1.2;
}

[data-theme="light"] .project-title {
    color: #0a0a0a;
}

.project-category {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: white;
    color: #0a0a0a;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    width: fit-content;
    border: 2px solid white;
    border-radius: 4px;
}

[data-theme="light"] .project-category {
    background: #0a0a0a;
    color: white;
    border-color: #0a0a0a;
}

.project-tags {
    display: flex;
    gap: 0.4rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.project-tag {
    padding: 0.3rem 0.7rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.5);
    font-size: 0.7rem;
    color: white;
    border-radius: 4px;
}

[data-theme="light"] .project-tag {
    border-color: rgba(10, 10, 10, 0.5);
    color: #0a0a0a;
}

/* Masonry Size Variations */
.project-card:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 400px;
}

.project-card:nth-child(7) {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 400px;
}

.project-card:nth-child(12) {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 400px;
}

.project-card:nth-child(17) {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 400px;
}

.project-card:nth-child(23) {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 400px;
}

.project-card:nth-child(3) {
    grid-column: span 1;
    grid-row: span 2;
    min-height: 300px;
}

.project-card:nth-child(5) {
    grid-column: span 1;
    grid-row: span 2;
    min-height: 300px;
}

.project-card:nth-child(10) {
    grid-column: span 1;
    grid-row: span 2;
    min-height: 300px;
}

.project-card:nth-child(14) {
    grid-column: span 1;
    grid-row: span 2;
    min-height: 300px;
}

.project-card:nth-child(19) {
    grid-column: span 1;
    grid-row: span 2;
    min-height: 300px;
}

.project-card:nth-child(21) {
    grid-column: span 1;
    grid-row: span 2;
    min-height: 300px;
}

.project-card {
    min-height: 200px;
}

/* Floating Filter Button */
.filter-fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 2px solid var(--card-border);
    background: var(--bg-dark-2);
    color: var(--primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.filter-fab:hover {
    background: var(--primary);
    color: #0a0a0a;
    border-color: var(--primary);
    transform: scale(1.05);
}

/* Filter Modal */
.filter-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1001;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
    padding: 1rem;
}

.filter-modal.active {
    display: flex;
}

.filter-modal-content {
    background: rgba(26, 26, 26, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    padding: 1.2rem;
    max-width: 280px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .filter-modal-content {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.8rem;
}

.filter-header h3 {
    font-size: 1rem;
    color: var(--text-light);
    font-weight: 700;
}

.close-modal {
    width: 32px;
    height: 32px;
    border: 1px solid var(--card-border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-light);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: var(--primary);
    color: #0a0a0a;
    border-color: var(--primary);
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.filter-btn {
    padding: 0.5rem 0.9rem;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    color: var(--text-light);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.filter-btn:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

.filter-btn.active {
    background: var(--primary);
    color: #0a0a0a;
    border-color: var(--primary);
}

/* Project Detail Modal */
.project-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(10px);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    padding: 2rem;
}

.project-modal.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

.project-modal-content {
    max-width: 1400px;
    width: 100%;
    background: var(--bg-dark-2);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius);
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalSlideIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 4rem);
}

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

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--card-border);
    background: rgba(26, 26, 26, 0.95);
    color: var(--text-light);
    font-size: 1rem;
    cursor: pointer;
    z-index: 100;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--primary);
    color: #0a0a0a;
    border-color: var(--primary);
    transform: rotate(90deg);
}

.project-modal-body {
    padding: 0;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* FIXED: Project Detail Modal Image */
.project-detail-image-container {
    width: 100%;
    position: relative;
    background: var(--bg-dark-3);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    overflow-x: hidden;
    flex-shrink: 0;
    padding: 20px;
    min-height: 500px;
    height: auto;
}

.project-detail-large-image {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.project-detail-large-image.zoomed {
    cursor: zoom-out;
    transform: scale(1.5);
    transform-origin: center center;
}

.project-detail-info {
    padding: 3rem;
    flex-shrink: 0;
}

.project-detail-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-light);
    line-height: 1.2;
}

.project-detail-meta {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.project-detail-category {
    padding: 0.5rem 1.5rem;
    background: var(--primary);
    color: #0a0a0a;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    border: 2px solid var(--primary);
}

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

.project-detail-tag {
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-gray);
    font-size: 0.9rem;
    border-radius: 4px;
    transition: var(--transition);
}

.project-detail-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.project-detail-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-gray);
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--card-border);
}

.project-detail-features {
    margin-bottom: 3rem;
}

.project-detail-features h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.feature-item {
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

[data-theme="light"] .feature-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.feature-item h4 {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-gray);
    margin: 0;
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.feature-item i {
    color: var(--primary);
    font-size: 0.9rem;
}

.project-detail-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.action-btn {
    padding: 1rem 2rem;
    border: 2px solid var(--primary);
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    background: var(--primary);
    color: #0a0a0a;
}

.action-btn:hover {
    background: transparent;
    color: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(255, 255, 255, 0.1);
}

/* Light theme adjustments */
[data-theme="light"] .project-modal-content {
    background: var(--bg-dark-2);
}

[data-theme="light"] .modal-close {
    background: rgba(255, 255, 255, 0.95);
    color: #0a0a0a;
}

[data-theme="light"] .project-detail-tag {
    border-color: rgba(0, 0, 0, 0.2);
    color: var(--text-gray);
}

/* Zoom hint for images */
.zoom-hint {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.project-detail-image-container:hover .zoom-hint {
    opacity: 1;
}

/* Loading state for images */
.project-detail-image-container.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.project-detail-image-container.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 3px solid var(--card-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Image error handling */
.project-detail-large-image.error {
    display: none;
}

.project-detail-image-container.has-error::after {
    content: 'Image not available';
    color: var(--text-muted);
    font-size: 1rem;
    text-align: center;
}

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

/* Responsive Design */
@media (max-width: 1200px) {
    .projects-section {
        padding: 100px 6rem 3rem;
    }

    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .project-card:nth-child(1),
    .project-card:nth-child(7),
    .project-card:nth-child(12),
    .project-card:nth-child(17),
    .project-card:nth-child(23) {
        grid-column: span 2;
        grid-row: span 2;
        min-height: 350px;
    }

    .portfolio-text {
        font-size: 80px;
        left: 20px;
    }
    
    .project-detail-image-container {
        min-height: 450px;
    }
}

@media (max-width: 992px) {
    .header-content {
        padding: 0 2rem;
    }

    .projects-section {
        padding: 100px 4rem 3rem;
    }

    .projects-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .project-card:nth-child(1),
    .project-card:nth-child(7),
    .project-card:nth-child(12),
    .project-card:nth-child(17),
    .project-card:nth-child(23) {
        grid-column: span 2;
        min-height: 320px;
    }

    .portfolio-text {
        display: none;
    }
    
    .project-detail-info {
        padding: 2rem;
    }
    
    .project-detail-title {
        font-size: 2rem;
    }
    
    .project-detail-image-container {
        min-height: 400px;
    }
    
    /* Responsive adjustments for offline status */
    .offline-status {
        top: 80px;
        white-space: normal;
        text-align: center;
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px 15px;
    }
    
    .offline-status span {
        font-size: 0.85rem;
        flex: 1;
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .header {
        height: 70px;
    }

    .header-content {
        padding: 0 1.5rem;
    }

    .logo {
        height: 36px;
    }

    .btn-primary {
        padding: 0.75rem 1.2rem;
        font-size: 0.85rem;
    }

    .theme-toggle, .fullscreen-toggle {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }

    .projects-section {
        padding: 90px 3rem 2rem;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .project-card:nth-child(1),
    .project-card:nth-child(7),
    .project-card:nth-child(12),
    .project-card:nth-child(17),
    .project-card:nth-child(23) {
        grid-column: span 2;
        min-height: 280px;
    }

    .project-card:nth-child(3),
    .project-card:nth-child(5),
    .project-card:nth-child(10),
    .project-card:nth-child(14),
    .project-card:nth-child(19),
    .project-card:nth-child(21) {
        grid-column: span 1;
        grid-row: span 1;
        min-height: 180px;
    }

    .filter-fab {
        width: 52px;
        height: 52px;
        bottom: 20px;
        right: 20px;
        font-size: 1.1rem;
    }

    .filter-modal {
        padding: 1rem;
    }

    .filter-modal-content {
        max-width: 260px;
        padding: 1rem;
    }

    .filter-header h3 {
        font-size: 0.95rem;
    }

    .filter-btn {
        padding: 0.45rem 0.8rem;
        font-size: 0.75rem;
    }
    
    .project-modal {
        padding: 1rem;
    }
    
    .project-detail-image-container {
        min-height: 350px;
        padding: 15px;
    }
    
    .project-detail-title {
        font-size: 1.75rem;
    }
    
    .project-detail-info {
        padding: 1.5rem;
    }
    
    .modal-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
    }
    
    .project-detail-large-image {
        max-height: 70vh;
    }
}

@media (max-width: 480px) {
    .header-actions {
        gap: 0.75rem;
    }

    .btn-primary span {
        display: none;
    }

    .btn-primary {
        padding: 0.75rem;
    }

    .theme-toggle, .fullscreen-toggle {
        width: 40px;
        height: 40px;
    }

    .projects-section {
        padding: 90px 1.5rem 2rem;
    }

    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .project-card {
        min-height: 160px;
        padding: 8px;
    }

    .project-card:nth-child(1),
    .project-card:nth-child(7),
    .project-card:nth-child(12),
    .project-card:nth-child(17),
    .project-card:nth-child(23) {
        grid-column: span 2;
        min-height: 240px;
    }

    .project-card:nth-child(3),
    .project-card:nth-child(5),
    .project-card:nth-child(10),
    .project-card:nth-child(14),
    .project-card:nth-child(19),
    .project-card:nth-child(21) {
        min-height: 160px;
    }

    .filter-fab {
        width: 48px;
        height: 48px;
        bottom: 15px;
        right: 15px;
        font-size: 1rem;
    }

    .filter-modal {
        padding: 1rem;
    }

    .filter-modal-content {
        max-width: 240px;
        padding: 0.9rem;
    }

    .filter-header h3 {
        font-size: 0.9rem;
    }

    .filter-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.7rem;
    }

    .close-modal {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .project-detail-image-container {
        min-height: 300px;
        padding: 10px;
    }
    
    .project-detail-title {
        font-size: 1.5rem;
    }
    
    .project-detail-info {
        padding: 1.5rem;
    }
    
    .project-detail-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .project-detail-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
    
    .modal-close {
        top: 0.75rem;
        right: 0.75rem;
        width: 32px;
        height: 32px;
    }
    
    /* Responsive adjustments for offline status */
    .offline-status {
        flex-direction: column;
        gap: 8px;
        padding: 10px;
    }
    
    .offline-close {
        position: absolute;
        top: 5px;
        right: 5px;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark-2);
}

::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.project-modal-body::-webkit-scrollbar {
    width: 8px;
}

.project-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.project-modal-body::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}

.project-detail-image-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.project-detail-image-container::-webkit-scrollbar-track {
    background: var(--bg-dark-3);
}

.project-detail-image-container::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}

.project-detail-image-container::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}