/* W5CQU Site Styles - Classic Ham Radio Theme */

:root {
    --bg-color: #f5f5f0;
    --text-color: #222;
    --text-secondary: #555;
    --accent-primary: #1a365d;
    --accent-secondary: #d69e2e;
    --border-color: #888;
    --header-bg: #1a365d;
    --content-bg: #fff;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 18px;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.site-header {
    background-color: var(--header-bg);
    color: #fff;
    padding: 1rem 2rem;
    text-align: center;
}

.callsign {
    font-family: "Courier New", monospace;
    font-size: 2.5rem;
    font-weight: bold;
    letter-spacing: 0.1em;
}

.tagline {
    font-size: 1rem;
    opacity: 1;
    margin-bottom: 1rem;
}

/* Navigation */
.main-nav {
    margin-top: 1rem;
}

.nav-toggle {
    display: none;
    background: var(--accent-primary);
    border: 2px solid #fff;
    color: #fff;
    font-size: 1.2rem;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-toggle:hover {
    background: var(--accent-secondary);
    transform: scale(1.05);
}

.hamburger-icon {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.menu-text {
    vertical-align: middle;
}

/* Hide nav icons on desktop */
.nav-icon {
    display: none;
}

.nav-list {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.nav-list a {
    display: block;
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

/* Only apply hover/active to top-level nav items, not dropdown items */
.nav-list > li > a:hover,
.nav-list > li > a.active {
    background-color: var(--accent-secondary);
    color: var(--header-bg);
}

/* Separate hover state for dropdown items */
.dropdown a:hover {
    background-color: var(--accent-secondary);
    color: var(--header-bg);
}

/* Remove active state from dropdown items */
.dropdown a.active {
    background-color: transparent;
    color: #fff;
}

/* Navigation - Dropdown on desktop, flat on mobile */
.has-dropdown {
    position: relative;
}

.has-dropdown > a::after {
    content: ' \25BC';
    font-size: 0.7em;
}

.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--header-bg);
    list-style: none;
    min-width: 150px;
    z-index: 100;
    border: 1px solid rgba(255,255,255,0.2);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.dropdown li {
    width: 100%;
}

.dropdown a {
    padding: 0.75rem 1rem;
    white-space: nowrap;
}

/* Desktop: show dropdown on hover */
@media (min-width: 769px) {
    .has-dropdown:hover .dropdown {
        display: block;
    }
}

/* Hide desktop-only items by default (shown on desktop) */
.desktop-only {
    display: block;
}

/* Main Content */
.content-area {
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--content-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Footer */
.site-footer {
    background-color: var(--header-bg);
    color: #fff;
    text-align: center;
    padding: 1rem;
    font-size: 1rem;
}

/* Controls Toolbar */
.controls-toggle {
    display: none; /* Hidden on desktop */
}

.controls-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    border-radius: 4px;
}

.controls-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.controls-group label {
    font-weight: 600;
    color: var(--text-secondary);
}

.controls-toolbar button {
    padding: 0.5rem 1rem;
    background-color: var(--accent-primary);
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
}

.controls-toolbar button:hover:not(:disabled) {
    background-color: var(--accent-secondary);
}

.controls-toolbar button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.controls-toolbar input[type="text"],
.controls-toolbar input[type="date"],
.controls-toolbar select {
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
}

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

.btn-sort-order {
    font-size: 1.2rem;
    padding: 0.4rem 0.8rem;
}

/* Pagination Controls */
.pagination-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    background-color: #fff;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
}

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

.pagination-btn.active {
    background-color: var(--accent-primary);
    color: #fff;
    border-color: var(--accent-primary);
}

.pagination-ellipsis {
    padding: 0.5rem;
    color: var(--text-secondary);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-left: 1rem;
}

/* Multi-Select Styles */
.thumbnail-checkbox,
.file-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.thumbnail-checkbox {
    position: absolute;
    top: 5px;
    left: 5px;
    z-index: 10;
}

.thumbnail-item {
    position: relative;
}

.thumbnail-item.selected {
    outline: 3px solid var(--accent-secondary);
    outline-offset: -3px;
}

.file-item.selected {
    background-color: rgba(214, 158, 46, 0.1);
    border-left: 3px solid var(--accent-secondary);
}

.file-checkbox {
    margin-right: 0.5rem;
}

/* Download Notification */
.download-notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--accent-primary);
    color: #fff;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 2000;
    animation: slideIn 0.3s ease;
}

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

/* File Date Display */
.file-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-right: 1rem;
}

/* Gallery Grid */
.gallery-container {
    display: flex;
    gap: 1rem;
}

.gallery-sidebar {
    width: 200px;
    flex-shrink: 0;
}

.gallery-sidebar h3 {
    font-family: "Courier New", monospace;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

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

.gallery-sidebar a {
    display: block;
    padding: 0.5rem;
    color: var(--text-color);
    text-decoration: none;
    border-left: 3px solid transparent;
}

.gallery-sidebar a:hover,
.gallery-sidebar a.active {
    background-color: var(--bg-color);
    border-left-color: var(--accent-secondary);
}

.gallery-main {
    flex: 1;
}

.breadcrumb {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.breadcrumb a {
    color: var(--accent-primary);
}

.breadcrumb span {
    color: var(--border-color);
    margin: 0 0.5rem;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.thumbnail-item {
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

.thumbnail-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border: 3px solid var(--border-color);
}

.thumbnail-item:hover img {
    border-color: var(--accent-secondary);
}

.thumbnail-item p {
    font-size: 1rem;
    text-align: center;
    margin-top: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Folder Grid for thumbnail preview cards */
.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.folder-card {
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s;
}

.folder-card:hover {
    transform: scale(1.05);
}

.folder-card img {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border: 3px solid var(--border-color);
    border-radius: 4px;
}

.folder-card:hover img {
    border-color: var(--accent-secondary);
}

.folder-card p {
    margin-top: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
}

/* Legacy folder-item styles (kept for backward compatibility) */
.folder-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.folder-item:hover {
    background: var(--accent-secondary);
}

.folder-item .icon {
    font-size: 1.5rem;
}

/* File Browser */
.file-list {
    list-style: none;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--bg-color);
}

.file-item:hover {
    background-color: var(--bg-color);
}

.file-item a {
    color: var(--text-color);
    text-decoration: none;
    flex: 1;
}

.file-item a:hover {
    color: var(--accent-primary);
}

.file-item .icon {
    font-size: 1.25rem;
    width: 2rem;
    text-align: center;
}

.file-item .size {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

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

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    background: none;
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    padding: 1rem;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-close {
    top: 1rem;
    right: 1rem;
}

.lightbox-prev {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-next {
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-caption {
    position: absolute;
    bottom: 2rem;
    color: #fff;
    text-align: center;
    width: 100%;
}

/* Links Section */
.links-section h2 {
    font-family: "Courier New", monospace;
    color: var(--accent-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-secondary);
}

.links-list {
    list-style: none;
    margin-bottom: 2rem;
}

.links-list li {
    padding: 0.5rem 0;
}

.links-list a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
}

.links-list a:hover {
    color: var(--accent-secondary);
}

.links-list .desc {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-left: 0.5rem;
}

/* Home Section */
.home-content {
    text-align: center;
}

.home-content .shack-image {
    max-width: 100%;
    height: auto;
    border: 3px solid var(--border-color);
    margin-bottom: 1rem;
}

.home-content h1 {
    font-family: "Courier New", monospace;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

/* Flying Section - Enhanced Gallery */
.flying-content {
    max-width: 1000px;
    margin: 0 auto;
}

.flying-content h1 {
    text-align: center;
    font-family: "Courier New", monospace;
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.flying-intro,
.flying-bio {
    text-align: center;
    margin-bottom: 1.5rem;
}

.flying-gallery {
    margin: 2rem 0;
}

/* Featured Image - Large Display */
.featured-image {
    margin-bottom: 2rem;
    text-align: center;
}

.featured-image img {
    width: 100%;
    max-width: 800px;
    height: auto;
    border: 3px solid var(--accent-primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.featured-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.image-caption {
    margin-top: 0.75rem;
    font-size: 1.1rem;
    color: var(--accent-primary);
    font-weight: 600;
    font-family: "Courier New", monospace;
}

/* Grid of Additional Aircraft Images */
.aircraft-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.aircraft-card {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.aircraft-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.25);
}

.aircraft-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    border: 2px solid var(--border-color);
}

/* About Section */
.about-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }

    /* Show icons on mobile */
    .nav-icon {
        display: inline-block;
        font-size: 1.3rem;
        margin-right: 0.5rem;
        vertical-align: middle;
    }

    .nav-list {
        display: none;
        flex-direction: column;
        width: 100%;
        margin-top: 1rem;
        background: rgba(0, 0, 0, 0.95);
        border-radius: 8px;
        padding: 1rem 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    }

    .nav-list.active {
        display: flex;
        animation: slideDown 0.3s ease;
    }

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

    /* Mobile: Flatten dropdown - hide parent, show items directly */
    .desktop-only {
        display: none !important;
    }

    .has-dropdown {
        position: static;
    }

    .dropdown {
        display: block !important;
        position: static;
        background: transparent;
        border: none;
        box-shadow: none;
        min-width: auto;
    }

    .dropdown li {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .dropdown a {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
    }

    .nav-list li {
        width: 100%;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    .nav-list li:last-child {
        border-bottom: none;
    }

    .nav-list a {
        padding: 1rem 1.5rem;
        font-size: 1.1rem;
        display: flex;
        align-items: center;
        width: 100%;
        transition: all 0.2s ease;
    }

    .nav-list a:hover,
    .nav-list a.active {
        background-color: var(--accent-primary);
        padding-left: 2rem;
    }


    .gallery-container {
        flex-direction: column;
    }

    .gallery-sidebar {
        width: 100%;
    }

    .thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .folder-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .folder-card img {
        height: 110px;
    }

    .content-area {
        margin: 1rem;
        padding: 1rem;
    }

    /* Mobile: Collapsible controls */
    .controls-toggle {
        display: block;
        width: 100%;
        padding: 1rem;
        background: var(--accent-primary);
        color: white;
        border: none;
        border-radius: 4px;
        font-size: 1rem;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 0.5rem;
        transition: background 0.2s ease;
    }

    .controls-toggle:hover {
        background: var(--accent-secondary);
    }

    .controls-toolbar {
        display: none; /* Hidden by default on mobile */
        flex-direction: column;
        align-items: stretch;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .controls-toolbar.expanded {
        display: flex;
        max-height: 2000px;
        margin-bottom: 1rem;
    }

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

    .controls-toolbar button,
    .controls-toolbar input,
    .controls-toolbar select {
        width: 100%;
    }

    .controls-toolbar .search-input {
        min-width: auto;
    }

    /* Mobile: Smaller pagination buttons */
    .pagination-controls {
        gap: 0.25rem;
    }

    .pagination-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .pagination-info {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-top: 0.5rem;
    }

    /* Mobile: Bottom notification full-width */
    .download-notification {
        bottom: 0;
        right: 0;
        left: 0;
        border-radius: 0;
        text-align: center;
    }

    /* Mobile: Flying page gallery */
    .aircraft-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .featured-image img {
        border-radius: 4px;
    }

    .aircraft-card img {
        height: 180px;
    }

    /* Carousel: Responsive mobile styles */
    .carousel-hero {
        height: 300px;
    }

    .carousel-prev,
    .carousel-next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        opacity: 0.9;
    }

    .carousel-dots {
        bottom: 10px;
    }

    .dot {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
}

/* ===== CAROUSEL STYLES ===== */

.carousel-hero {
    width: 100%;
    height: 500px;
    overflow: hidden;
    position: relative;
    background: var(--bg-color);
}

.carousel-container {
    position: relative;
    width: 100%;
    height: 100%;
}

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

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

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Arrow Navigation Buttons */
.carousel-prev,
.carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    font-size: 2rem;
    cursor: pointer;
    z-index: 10;
    transition: background 0.3s ease, opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-prev:hover,
.carousel-next:hover {
    background: rgba(0, 0, 0, 0.8);
}

.carousel-prev:focus,
.carousel-next:focus {
    outline: 3px solid var(--accent-secondary);
    outline-offset: 2px;
}

.carousel-prev {
    left: 10px;
}

.carousel-next {
    right: 10px;
}

/* Dot Indicators */
.carousel-dots {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.dot:hover {
    background: rgba(255, 255, 255, 0.8);
    transform: scale(1.2);
}

.dot.active {
    background: var(--accent-secondary);
    border-color: var(--accent-secondary);
}

.dot:focus {
    outline: 2px solid white;
    outline-offset: 3px;
}

/* Gradient overlay for better dot visibility */
.carousel-slide::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100px;
    background: linear-gradient(to top, rgba(0,0,0,0.4), transparent);
    pointer-events: none;
}

/* Desktop: Hide arrows on hover (show only when hovering carousel) */
@media (min-width: 769px) {
    .carousel-prev,
    .carousel-next {
        opacity: 0;
    }

    .carousel-hero:hover .carousel-prev,
    .carousel-hero:hover .carousel-next {
        opacity: 1;
    }
}

/* Tablet: Adjust carousel height */
@media (max-width: 768px) and (min-width: 481px) {
    .carousel-hero {
        height: 400px;
    }
}

/* Accessibility: Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .carousel-slides {
        transition: none;
    }
}
