/* Gallery Page Styles */

/* Dark mode variables for gallery */
@media (prefers-color-scheme: dark) {
    .gallery-hero {
        background: linear-gradient(135deg, #0a0a1a 0%, #0d1b3e 50%, #1a3a6e 100%);
    }

    .gallery-hero-overlay {
        background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.02)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    }

    .gallery-hero p {
        opacity: 0.75;
    }

    .btn-secondary-inverse {
        border-color: rgba(255, 255, 255, 0.35);
    }

    .btn-secondary-inverse:hover {
        border-color: rgba(255, 255, 255, 0.55);
        background: rgba(255, 255, 255, 0.08);
    }

    .gallery-controls {
        background: var(--bg-card);
        border-bottom-color: var(--border-color);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .controls-group label {
        color: var(--text-light);
    }

    .controls-group select,
    .controls-group input {
        background: var(--bg-light);
        border-color: var(--border-color);
        color: var(--text-dark);
    }

    .controls-group select:focus,
    .controls-group input:focus {
        border-color: var(--primary-color);
        background: var(--bg-light);
    }

    .results-info {
        border-top-color: var(--border-color);
    }

    #results-count {
        color: var(--text-light);
    }

    .checklist-gallery {
        background: var(--bg-light);
    }

    .checklist-card {
        background: var(--bg-card);
        border-color: var(--border-color);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    .checklist-card:hover {
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    }

    .checklist-card-info h3 {
        color: var(--text-dark);
    }

    .checklist-aircraft-badge {
        background: rgba(100, 150, 255, 0.15);
        color: var(--primary-light);
        border: 1px solid rgba(0, 200, 255, 0.3);
    }

    .checklist-card-body p {
        color: var(--text-light);
    }

    .checklist-card-meta {
        border-top-color: var(--border-color);
    }

    .rating-value {
        color: var(--text-dark);
    }

    .ratings-count {
        color: var(--text-light);
    }

    .checklist-author {
        color: var(--text-light);
    }

    .btn-outline {
        background: var(--bg-card);
        border-color: var(--border-color);
        color: var(--text-dark);
    }

    .btn-outline:hover {
        border-color: var(--primary-color);
        background: rgba(0, 102, 255, 0.1);
    }

    .gallery-empty h3 {
        color: var(--text-dark);
    }

    .gallery-empty p {
        color: var(--text-light);
    }

    .modal-content {
        background: var(--bg-card);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    }

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

    .modal-close:hover {
        background: var(--border-color);
        color: var(--text-dark);
    }

    .preview-info h2 {
        color: var(--text-dark);
    }

    .preview-description {
        color: var(--text-light);
    }

    .preview-meta {
        border-top-color: var(--border-color);
    }

    .preview-meta-item .label {
        color: var(--text-light);
    }

    .preview-meta-item .value {
        color: var(--text-dark);
    }

    .preview-checklist h3 {
        color: var(--text-dark);
    }

    .preview-checklist-section h4 {
        color: var(--primary-color);
        border-bottom-color: rgba(33, 150, 243, 0.25);
    }

    .preview-checklist-section li {
        color: var(--text-light);
    }

    .preview-actions {
        border-top-color: var(--border-color);
    }

    .checklist-icon.cessna { background: linear-gradient(135deg, #1a2a4a, #1e3a5f); }
    .checklist-icon.piper { background: linear-gradient(135deg, #3a2a1a, #4a3a2e); }
    .checklist-icon.vans { background: linear-gradient(135deg, #1a3a2a, #1e4a3a); }
    .checklist-icon.beech { background: linear-gradient(135deg, #3a1a2a, #4a2e3a); }
    .checklist-icon.bombardier { background: linear-gradient(135deg, #2a1a3a, #3a2e4a); }
    .checklist-icon.airbus { background: linear-gradient(135deg, #1a3a3a, #1e4a4a); }
    .checklist-icon.boeing { background: linear-gradient(135deg, #3a3a1a, #4a4a2e); }
    .checklist-icon.gulfstream { background: linear-gradient(135deg, #3a2a3a, #4a3a4a); }
    .checklist-icon.glasair { background: linear-gradient(135deg, #1a3a3a, #1e4a4a); }
    .checklist-icon.default { background: linear-gradient(135deg, #1a1a2e, #2a2a3e); }

    .submit-cta {
        background: #0f172a;
    }

    .cta-content .btn {
        background: var(--primary-light);
        color: #0f172a;
    }

    .cta-content .btn:hover {
        background: var(--accent-color);
    }
}

/* Gallery Hero */
.gallery-hero {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #0052cc 50%, #0066ff 100%);
    color: white;
    padding: 6rem 0 4rem;
    text-align: center;
    overflow: hidden;
}

.gallery-hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.03)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    pointer-events: none;
}

.gallery-hero-content {
    position: relative;
    z-index: 1;
}

.gallery-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.gallery-hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.7;
}

.gallery-hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-secondary-inverse {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 0.875rem 2rem;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

/* Gallery Controls */
.gallery-controls {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    position: sticky;
    top: 64px;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

@media (prefers-color-scheme: dark) {
    .gallery-controls {
        background: var(--bg-card);
        border-bottom: 1px solid var(--border-color);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
}

.controls-bar {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
    flex-wrap: wrap;
}

.controls-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    min-width: 150px;
}

.controls-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.controls-group select,
.controls-group input {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.875rem;
    background: var(--bg-card);
    color: var(--text-dark);
    transition: all 0.3s ease;
    min-width: 100%;
}

.controls-group select:focus,
.controls-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.controls-group input {
    min-width: 200px;
}

.results-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

#results-count {
    font-size: 0.875rem;
    color: var(--text-light);
    font-weight: 500;
}

/* Gallery Grid */
.checklist-gallery {
    padding: 3rem 0 4rem;
    background: var(--bg-light);
}

.gallery-grid-checklist {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* Checklist Card */
.checklist-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}


.checklist-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.checklist-card-header {
    padding: 1.5rem 1.5rem 0;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.checklist-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.checklist-icon.cessna { background: linear-gradient(135deg, #e3f2fd, #bbdefb); }
.checklist-icon.piper { background: linear-gradient(135deg, #fff3e0, #ffe0b2); }
.checklist-icon.vans { background: linear-gradient(135deg, #e8f5e9, #c8e6c9); }
.checklist-icon.beech { background: linear-gradient(135deg, #fce4ec, #f8bbd0); }
.checklist-icon.bombardier { background: linear-gradient(135deg, #ede7f6, #d1c4e9); }
.checklist-icon.airbus { background: linear-gradient(135deg, #e0f7fa, #b2ebf2); }
.checklist-icon.boeing { background: linear-gradient(135deg, #fff8e1, #ffecb3); }
.checklist-icon.gulfstream { background: linear-gradient(135deg, #f3e5f5, #e1bee7); }
.checklist-icon.glasair { background: linear-gradient(135deg, #e0f2f1, #b2dfdb); }
.checklist-icon.default { background: linear-gradient(135deg, #f5f5f5, #e0e0e0); }

.checklist-card-info {
    flex: 1;
    min-width: 0;
}

.checklist-card-info h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.25rem;
    line-height: 1.3;
}

.checklist-aircraft-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(0, 102, 255, 0.08);
    padding: 0.25rem 0.625rem;
    border-radius: 6px;
}

.checklist-card-body {
    padding: 1rem 1.5rem;
    flex: 1;
}

.checklist-card-body p {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.checklist-card-meta {
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.checklist-rating {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.stars {
    display: flex;
    gap: 0.125rem;
}

.star {
    color: #e0e0e0;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.star.filled {
    color: #ffc107;
}

.star.half {
    position: relative;
    color: #e0e0e0;
}

.star.half::before {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    overflow: hidden;
    color: #ffc107;
}

.rating-value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.ratings-count {
    font-size: 0.75rem;
    color: var(--text-light);
}

.checklist-author {
    font-size: 0.75rem;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.checklist-card-actions {
    padding: 1rem 1.5rem 1.5rem;
    display: flex;
    gap: 0.75rem;
}

.checklist-card-actions .btn {
    flex: 1;
    justify-content: center;
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
}

.btn-outline {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-dark);
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    cursor: pointer;
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: rgba(0, 102, 255, 0.04);
}

/* Gallery Empty State */
.gallery-empty {
    text-align: center;
    padding: 4rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.empty-icon {
    font-size: 4rem;
    opacity: 0.5;
}

.gallery-empty h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
}

.gallery-empty p {
    color: var(--text-light);
    max-width: 400px;
}

/* Submit CTA */
.submit-cta {
    padding: 4rem 0;
    background: #1a1a2e;
    color: white;
    text-align: center;
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.cta-content .btn {
    background: white;
    color: #1a1a2e;
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 700;
}

.cta-content .btn:hover {
    background: #1a1a2e;
    color: white;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 2rem;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-light);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.3s ease;
    z-index: 1;
}

.modal-close:hover {
    background: var(--border-color);
    color: var(--text-dark);
}

/* Checklist Preview in Modal */
.preview-header {
    padding: 2rem 2rem 0;
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
}

.preview-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.preview-info h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.preview-aircraft-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(0, 102, 255, 0.08);
    padding: 0.375rem 0.875rem;
    border-radius: 8px;
}

.preview-body {
    padding: 1.5rem 2rem;
}

.preview-description {
    font-size: 1rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.preview-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.preview-meta-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.preview-meta-item .label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-meta-item .value {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-dark);
}

.preview-checklist {
    padding: 0 2rem 1.5rem;
}

.preview-checklist h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.preview-checklist-section {
    margin-bottom: 1rem;
}

.preview-checklist-section h4 {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    padding-bottom: 0.375rem;
    border-bottom: 1px solid rgba(0, 102, 255, 0.15);
}

.preview-checklist-section ol {
    padding-left: 1.25rem;
}

.preview-checklist-section li {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 0.25rem;
}

.preview-actions {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Responsive */
@media (max-width: 768px) {
    .gallery-hero {
        padding: 4rem 0 3rem;
    }

    .gallery-hero h1 {
        font-size: 2rem;
    }

    .gallery-hero p {
        font-size: 1rem;
    }

    .controls-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .controls-group {
        min-width: auto;
    }

    .controls-group input {
        min-width: auto;
    }

    .gallery-grid-checklist {
        grid-template-columns: 1fr;
    }

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

    .preview-body {
        padding: 1rem 1.5rem;
    }

    .preview-checklist {
        padding: 0 1.5rem 1rem;
    }

    .preview-actions {
        padding: 1rem 1.5rem;
        flex-direction: column;
    }

    .gallery-hero-actions {
        flex-direction: column;
        align-items: center;
    }
}