/* macOS X Projects Page Styles */
:root {
    /* macOS specific colors - Fixed Light Mode */
    --macos-window-bg: rgba(246, 246, 246, 0.8);
    --macos-window-border: rgba(0, 0, 0, 0.1);
    --macos-sidebar-bg: rgba(248, 248, 248, 0.95);
    --macos-button-red: #ff5f57;
    --macos-button-yellow: #ffbd2e;
    --macos-button-green: #28ca42;
    --macos-selection-blue: #007aff;
    --macos-text-secondary: #86868b;
    --macos-divider: rgba(0, 0, 0, 0.1);
    
    /* Text colors */
    --text-color: #1d1d1f;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    
    /* Background colors */
    --glass-bg: rgba(255, 255, 255, 0.8);
    --card-bg: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.1);
    --hover-bg: rgba(0, 0, 0, 0.05);
    
    /* Accent colors */
    --accent-color: #007aff;
    --accent-rgb: 0, 122, 255;
    
    /* Status colors */
    --status-completed: #34c759;
    --status-in-progress: #007aff;
    --status-live: #ff9500;
    
    /* Project card shadows */
    --card-shadow-light: 0 2px 20px rgba(0, 0, 0, 0.1);
    --card-shadow-hover: 0 8px 40px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: linear-gradient(135deg, #ffffff 0%, #dddddd 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: var(--text-color);
    padding: 0;
}

/* macOS Window Header */
.window-header {
    background: var(--macos-window-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--macos-window-border);
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.window-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.folder-icon {
    font-size: 16px;
}

/* Layout */
.sidebar {
    position: fixed;
    left: 0;
    top: 52px;
    width: 260px;
    height: calc(100vh - 52px);
    background: var(--macos-sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--macos-window-border);
    padding: 20px;
    overflow-y: auto;
    z-index: 50;
}

.main-content {
    margin-left: 260px;
    padding: 20px;
    min-height: calc(100vh - 52px);
}

/* Sidebar Styles */
.sidebar-section {
    margin-bottom: 30px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 13px;
    color: var(--macos-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
    padding: 0 8px;
}

.sidebar-list {
    list-style: none;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    color: var(--text-color);
    margin-bottom: 2px;
}

.sidebar-item:hover {
    background: var(--macos-divider);
}

.sidebar-item.active {
    background: var(--macos-selection-blue);
    color: white;
}

.sidebar-icon {
    font-size: 16px;
    width: 18px;
    text-align: center;
}

.count {
    margin-left: auto;
    background: var(--macos-text-secondary);
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
}

.sidebar-item.active .count {
    background: rgba(255, 255, 255, 0.3);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: 2px;
}

.status-dot.completed {
    background: var(--status-completed);
}

.status-dot.in-progress {
    background: var(--status-in-progress);
}

.status-dot.live {
    background: var(--status-live);
}

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 10px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--macos-text-secondary);
}

.breadcrumb-link {
    color: var(--macos-selection-blue);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.breadcrumb-link:hover {
    opacity: 0.7;
}

.breadcrumb-separator {
    color: var(--macos-text-secondary);
}

.breadcrumb-current {
    font-weight: 600;
    color: var(--text-color);
}

.sort-controls {
    display: flex;
    align-items: center;
}

.sort-dropdown {
    background: var(--macos-window-bg);
    border: 1px solid var(--macos-divider);
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
}

.sort-dropdown:hover, .sort-dropdown:focus {
    border-color: var(--macos-selection-blue);
    background: var(--card-bg);
}

/* Projects Grid - Full Row Layout */
.projects-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    padding: 10px;
    max-width: none;
}

.projects-container.list-view {
    gap: 30px;
}

/* Project Cards - Full Row with Wider Gallery */
.project-card {
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--card-shadow-light);
    display: flex;
    flex-direction: row;
    min-height: 350px;
    margin-bottom: 20px;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--card-hover-border);
}

.project-card.hidden {
    display: none;
}

/* Project Status */
.project-status {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.status-indicator {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.status-indicator.completed {
    background: var(--status-completed);
}

.status-indicator.in-progress {
    background: var(--status-in-progress);
}

.status-indicator.live {
    background: var(--status-live);
}

/* Project Gallery - Wider Layout */
.project-preview {
    position: relative;
    width: 55%;
    min-width: 500px;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px 0 0 20px;
    /* Ensure consistent aspect ratio regardless of content */
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-gallery {
    display: flex;
    width: 500%; /* 5 images width */
    height: 100%;
    animation: none; /* No auto-animation, only on hover */
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    /* Ensure gallery maintains aspect ratio */
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

.project-card:hover .project-gallery {
    animation: slideGallery 15s infinite ease-in-out;
}

.project-gallery.paused {
    animation-play-state: paused;
}

.gallery-item {
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
    display: flex;
    /* Ensure consistent aspect ratio for each gallery item */
    align-items: center;
    justify-content: center;
}

/* Gallery content items - maintain consistent aspect ratio */
.gallery-item.content-item {
    width: 100%;
    height: 100%;
    /* Ensure aspect ratio is maintained */
    aspect-ratio: 16/9;
    min-height: 100%;
}

.content-item .project-image, 
.content-item .project-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    /* Ensure consistent aspect ratio and positioning */
    object-position: center;
    display: block;
    /* Force aspect ratio consistency */
    aspect-ratio: 16/9;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.project-card:hover .content-item .project-image,
.project-card:hover .content-item .project-video {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.4) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 15;
}

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

.preview-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    font-size: 14px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.preview-btn:hover {
    background: white;
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
}

.gallery-controls {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.gallery-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-dot.active {
    background: white;
    transform: scale(1.2);
}

/* Gallery animations - Only on hover */
@keyframes slideGallery {
    0%, 18% { transform: translateX(0%); }
    20%, 38% { transform: translateX(-20%); }
    40%, 58% { transform: translateX(-40%); }
    60%, 78% { transform: translateX(-60%); }
    80%, 98% { transform: translateX(-80%); }
    100% { transform: translateX(0%); }
}

/* Smooth gallery transitions */
.project-gallery {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-gallery.manual-control {
    animation-play-state: paused;
}

/* Gallery only animates on hover/touch */
.project-card:not(:hover) .project-gallery {
    animation: none !important;
}

/* Enhanced hover effects for galleries */
.project-preview:hover .gallery-controls {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.gallery-controls {
    opacity: 0.7;
    transform: translateX(-50%) translateY(10px);
    transition: all 0.3s ease;
}

/* Ensure aspect ratio consistency across all media types */
.project-image,
.project-video {
    /* Force consistent aspect ratio for all media */
    aspect-ratio: 16/9;
    object-fit: contain;
    object-position: center;
    width: 100%;
    height: 100%;
    display: block;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Handle GIFs and animated content */
.project-image[src*=".gif"],
.project-video[src*=".gif"] {
    aspect-ratio: 16/9;
    object-fit: contain;
    object-position: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Additional safety for container-based aspect ratio */
.project-gallery .gallery-item,
.project-gallery .content-item {
    /* Ensure containers maintain aspect ratio */
    aspect-ratio: 16/9;
    min-height: 0; /* Allow flexbox to work properly */
}

/* Handle different image orientations consistently */
.project-image[src*=".png"],
.project-image[src*=".jpg"],
.project-image[src*=".jpeg"],
.project-image[src*=".webp"] {
    aspect-ratio: 16/9;
    object-fit: contain;
    object-position: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* Keep logos with cover fit to avoid weird scaling */
.project-image[src*="Logo"],
.project-image[src*="logo"],
.project-logo img {
    object-fit: cover !important;
    background: transparent !important;
}

.project-preview:hover .gallery-counter {
    opacity: 1;
}

.gallery-counter {
    opacity: 0.8;
    transition: opacity 0.3s ease;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(10px);
    position: absolute;
    top: 15px;
    left: 15px;
}

/* Loading state for gallery items */
.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.gallery-item:hover::before {
    transform: translateX(100%);
}

/* Video specific enhancements */
.project-video {
    filter: brightness(0.9);
    transition: filter 0.3s ease;
}

.gallery-item:hover .project-video {
    filter: brightness(1);
}

.video-play-button {
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.gallery-item:hover .video-play-button {
    opacity: 1;
}

/* Gallery item focus states */
.gallery-item {
    position: relative;
    cursor: pointer;
}

.gallery-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--macos-selection-blue);
    border-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.gallery-dot.active + .gallery-item::after,
.gallery-item.active::after {
    opacity: 1;
}

/* Project Info - Right Side with Logo */
.project-info {
    padding: 35px 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 350px;
}

.project-header {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.project-logo {
    width: 80px;
    height: 80px;
    border-radius: 12px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.project-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.project-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 0;
}

.project-title-group {
    flex: 1;
}

.project-title-container {
    flex: 1;
    min-width: 0; /* Allow text to wrap */
}

.project-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-color);
    line-height: 1.2;
}

.project-subtitle {
    font-size: 16px;
    color: var(--macos-text-secondary);
    margin-bottom: 0;
    font-weight: 500;
}

.project-description {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 25px;
    font-size: 15px;
    flex: 1;
}

.project-features {
    margin-bottom: 20px;
}

.project-features h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.features-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.feature-icon {
    width: 16px;
    height: 16px;
    color: var(--status-completed);
}

/* Tech Stack */
.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 20px;
}

.tech-badge {
    background: var(--tech-badge-bg);
    border: 1px solid var(--tech-badge-border);
    color: var(--text-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tech-badge.primary {
    background: var(--macos-selection-blue);
    border-color: var(--macos-selection-blue);
    color: white;
}

.tech-badge:hover {
    transform: translateY(-1px);
    background: var(--tech-badge-hover-bg);
}

/* Project Stats */
.project-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--macos-sidebar-bg);
    border-radius: 10px;
    border: 1px solid var(--macos-divider);
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.stat-label {
    font-size: 11px;
    color: var(--macos-text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
}

/* Progress Bar */
.project-progress {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--macos-divider);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--macos-selection-blue);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 12px;
    font-weight: 600;
    color: var(--macos-text-secondary);
    white-space: nowrap;
}

/* Collaborators */
.collaborators {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.collaborator-avatars {
    display: flex;
    gap: -8px;
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--macos-selection-blue);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    border: 2px solid var(--card-bg);
    margin-left: -8px;
}

.avatar:first-child {
    margin-left: 0;
}

.collaborator-count {
    font-size: 12px;
    color: var(--macos-text-secondary);
    font-weight: 500;
}

/* Project Links */
.project-links {
    display: flex;
    gap: 10px;
    margin-top: auto;
}

.btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    flex: 1;
    justify-content: center;
    cursor: pointer;
    background: none;
}

.btn-primary {
    background: var(--macos-selection-blue);
    color: white;
}

.btn-primary:hover {
    background: #0056d3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--secondary-link-bg);
    border-color: var(--secondary-link-border);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: var(--secondary-link-hover-bg);
    border-color: var(--secondary-link-hover-border);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    border-color: var(--macos-divider);
    color: var(--text-color);
}

.btn-ghost:hover {
    background: var(--macos-divider);
    transform: translateY(-1px);
}

.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--macos-text-secondary);
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: var(--text-color);
}

.empty-state p {
    font-size: 16px;
    max-width: 400px;
    margin: 0 auto;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.modal {
    background: var(--card-bg);
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    border: 1px solid var(--card-border);
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--macos-divider);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--macos-text-secondary);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--macos-divider);
    color: var(--text-color);
}

.modal-body {
    padding: 25px;
}

.preview-content {
    display: flex;
    gap: 20px;
}

.modal-project-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 12px;
    flex-shrink: 0;
}

.preview-details {
    flex: 1;
}

.preview-details p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

/* Gallery Modal Styles */
.gallery-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.gallery-modal.active {
    opacity: 1;
    visibility: visible;
}

.gallery-modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 90vw;
    max-width: 1200px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

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

.gallery-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    background: var(--glass-bg);
}

.gallery-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 5px;
    border-radius: 8px;
    transition: all 0.2s ease;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: var(--hover-bg);
    color: var(--text-primary);
}

.gallery-modal-body {
    display: flex;
    flex-direction: column;
    height: calc(90vh - 80px);
}

.gallery-modal-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.gallery-modal-viewer {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    min-height: 400px;
    background: rgba(0, 0, 0, 0.2);
}

.gallery-modal-image {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    max-height: 600px;
}

.gallery-modal-image img,
.gallery-modal-image video {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.gallery-nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.gallery-nav:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

.gallery-modal-counter {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.gallery-modal-thumbnails {
    display: flex;
    gap: 10px;
    padding: 20px;
    overflow-x: auto;
    border-top: 1px solid var(--border-color);
    background: var(--glass-bg);
}

.gallery-thumbnail {
    min-width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
}

.gallery-thumbnail:hover {
    border-color: var(--accent-color);
    transform: scale(1.05);
}

.gallery-thumbnail.active {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.3);
}

.gallery-thumbnail img,
.gallery-thumbnail video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile adjustments for gallery modal */
@media (max-width: 768px) {
    .gallery-modal-content {
        width: 95vw;
        max-height: 95vh;
    }
    
    .gallery-modal-header {
        padding: 15px 20px;
    }
    
    .gallery-modal-header h3 {
        font-size: 18px;
    }
    
    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .gallery-prev {
        left: 10px;
    }
    
    .gallery-next {
        right: 10px;
    }
    
    .gallery-modal-counter {
        top: 10px;
        right: 10px;
        padding: 6px 10px;
        font-size: 12px;
    }
    
    .gallery-modal-thumbnails {
        padding: 15px;
        gap: 8px;
    }
    
    .gallery-thumbnail {
        min-width: 60px;
        height: 45px;
    }
}
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .project-card {
        flex-direction: column;
        min-height: auto;
    }
    
    .project-preview {
        width: 100%;
        min-width: auto;
        aspect-ratio: 16/9;
        border-radius: 20px 20px 0 0;
        /* Ensure consistent aspect ratio on tablet */
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 250px;
    }
    
    /* Update tablet images to use contain */
    .content-item .project-image, 
    .content-item .project-video {
        object-fit: contain;
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    }
    
    /* Keep logos with cover fit */
    .project-image[src*="Logo"],
    .project-image[src*="logo"] {
        object-fit: cover !important;
        background: transparent !important;
    }
    
    .project-header {
        gap: 15px;
    }
    
    .project-logo {
        width: 70px;
        height: 70px;
    }
    
    .project-logo img {
        padding: 0;
    }
    
    .project-info {
        padding: 25px 30px;
        min-height: auto;
    }
    
    .project-title {
        font-size: 24px;
    }
    
    .features-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) and (min-width: 481px) {
    .project-preview {
        aspect-ratio: 3/2;
        /* Intermediate aspect ratio for mid-size mobile screens */
        min-height: 200px;
        max-height: 320px;
    }
    
    .gallery-item.content-item {
        aspect-ratio: 3/2;
    }
    
    .content-item .project-image, 
    .content-item .project-video {
        aspect-ratio: 3/2;
        object-fit: contain; /* Show more content on mid-size screens */
        object-position: center;
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    }
}

@media (max-width: 768px) {
    .window-header {
        padding: 0 15px;
    }
    
    .window-title {
        position: static;
        transform: none;
    }
    
    .content-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .projects-container {
        gap: 25px;
        padding: 5px;
    }
    
    .project-card {
        margin: 0;
        min-height: auto;
    }
    
    .project-preview {
        aspect-ratio: 4/3;
        min-width: 300px;
        /* Better aspect ratio for mobile - shows more height */
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 220px;
        max-height: 350px;
    }
    
    /* Update gallery items for better mobile aspect ratio */
    .gallery-item.content-item {
        aspect-ratio: 4/3;
    }
    
    .content-item .project-image, 
    .content-item .project-video {
        aspect-ratio: 4/3;
        object-fit: contain; /* Show full image on mobile */
        object-position: center;
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    }
    
    /* For very small content, use cover to avoid letterboxing */
    .content-item .project-image[src*="Logo"],
    .content-item .project-image[src*="logo"] {
        object-fit: cover;
        background: transparent;
    }
    
    .project-header {
        gap: 12px;
    }
    
    .project-logo {
        width: 55px;
        height: 55px;
    }
    
    .project-logo img {
        padding: 0;
    }
    
    .project-info {
        padding: 20px 25px;
    }
    
    .project-title {
        font-size: 22px;
    }
    
    .project-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .project-links {
        flex-direction: column;
    }
    
    .preview-content {
        flex-direction: column;
    }
    
    .modal-project-image {
        width: 100%;
        height: 200px;
    }
    
    .gallery-controls {
        bottom: 10px;
    }
    
    .gallery-dot {
        width: 6px;
        height: 6px;
    }
    
    .gallery-counter {
        top: 10px;
        left: 10px;
        font-size: 10px;
        padding: 3px 6px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 15px;
    }
    
    .project-info {
        padding: 20px;
    }
    
    .project-title {
        font-size: 20px;
    }
    
    .project-preview {
        min-width: 300px;
        height: 180px;
    }
    
    /* Even smaller logo corner for very small screens */
    .gallery-item.logo-item {
        width: 50px;
        height: 50px;
        top: 8px;
        right: 8px;
    }
    
    .logo-item .project-image {
        padding: 4px;
    }
    
    .window-controls {
        gap: 6px;
    }
    
    .window-control {
        width: 10px;
        height: 10px;
    }
    
    .gallery-counter {
        top: 8px;
        left: 8px;
        font-size: 9px;
        padding: 2px 5px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 15px;
    }
    
    .project-info {
        padding: 20px;
    }
    
    .project-preview {
        aspect-ratio: 4/3;
        min-width: 280px;
        /* Better aspect ratio for very small screens - shows more height */
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 200px;
        max-height: 280px;
    }
    
    /* Use better aspect ratio for very small screens */
    .project-image,
    .project-video {
        aspect-ratio: 4/3 !important;
        object-fit: contain !important; /* Show full image on very small screens */
        object-position: center;
        background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    }
    
    /* Keep logos with cover fit */
    .project-image[src*="Logo"],
    .project-image[src*="logo"] {
        object-fit: cover !important;
        background: transparent;
    }
    
    .gallery-item.content-item {
        aspect-ratio: 4/3 !important;
    }
    
    .window-controls {
        gap: 6px;
    }
    
    .window-control {
        width: 10px;
        height: 10px;
    }
}

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

.project-card {
    animation: slideIn 0.5s ease forwards;
}

.project-card:nth-child(1) { animation-delay: 0.1s; }
.project-card:nth-child(2) { animation-delay: 0.2s; }
.project-card:nth-child(3) { animation-delay: 0.3s; }
.project-card:nth-child(4) { animation-delay: 0.4s; }
.project-card:nth-child(5) { animation-delay: 0.5s; }
.project-card:nth-child(6) { animation-delay: 0.6s; }

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

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--macos-text-secondary);
    border-radius: 4px;
}

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