/**
 * Mapping Safe Hydrogen Page Styles
 * Safe Hydrogen Child Theme
 *
 * @version 1.1.0
 */

/* ============================================
   CSS Custom Properties
   ============================================ */
:root {
    --shp-primary: #084f9f;
    --shp-accent: #22b273;
    --shp-accent-dark: #1a8f5c;
    --shp-text: #333333;
    --shp-text-light: #666666;
    --shp-bg: #ffffff;
    --shp-bg-alt: #f5f7fa;
    --shp-border: #e5e7eb;
    --shp-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shp-shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shp-radius: 8px;
    --shp-radius-lg: 12px;
    --shp-font: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --shp-container: 1200px;
}

/* ============================================
   Base Styles
   ============================================ */
.shp-main {
    font-family: var(--shp-font);
    color: var(--shp-text);
    line-height: 1.6;
}

.shp-container {
    max-width: var(--shp-container);
    margin: 0 auto;
    padding: 0 20px;
}

/* ============================================
   Hero Section - Full Width Map
   ============================================ */
.shp-hero {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    position: relative;
}

.shp-hero-text {
    text-align: center;
    padding: 40px 20px 24px;
    max-width: 900px;
    margin: 0 auto;
}

.shp-hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 12px;
    line-height: 1.2;
}

.shp-hero-description {
    font-size: 1.05rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
    line-height: 1.6;
}

/* ============================================
   CGA Video Map - Full Width
   ============================================ */
.cga-map-wrapper {
    position: relative;
    width: 100%;
}

.cga-map-container {
    position: relative;
    width: 100%;
    /* Video is 2510 x 1294 */
    aspect-ratio: 2510 / 1294;
    overflow: hidden;
    background: #1a1a2e;
}

.cga-map-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hotspot Button Styles */
.cga-hotspot {
    position: absolute;
    width: 140px;
    height: 140px;
    transform: translate(-50%, -50%);
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
    padding: 0;
}

.cga-hotspot:focus {
    outline: none;
}

.cga-hotspot:focus .hotspot-ring {
    box-shadow: 0 0 0 6px rgba(34, 178, 115, 0.5);
}

.hotspot-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 48px;
    height: 48px;
    background: var(--shp-accent);
    border-radius: 50%;
    z-index: 3;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(34, 178, 115, 0.5);
}

.cga-hotspot:hover .hotspot-core {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 6px 20px rgba(34, 178, 115, 0.6);
}

.hotspot-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border: 4px solid rgba(34, 178, 115, 0.7);
    border-radius: 50%;
    z-index: 2;
    transition: transform 0.2s ease;
}

.cga-hotspot:hover .hotspot-ring {
    transform: translate(-50%, -50%) scale(1.1);
}

.hotspot-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    border: 3px solid rgba(34, 178, 115, 0.5);
    border-radius: 50%;
    animation: cgaPulse 2.5s ease-out infinite;
    z-index: 1;
}

.hotspot-label {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    background: var(--shp-accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(34, 178, 115, 0.4);
    opacity: 0;
    transform: translateX(-50%) translateY(-10px) scale(0.7);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.cga-hotspot:hover .hotspot-label,
.cga-hotspot:focus .hotspot-label {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
    box-shadow: 0 6px 16px rgba(34, 178, 115, 0.5);
}

@keyframes cgaPulse {
    0% {
        transform: translate(-50%, -50%) scale(0.7);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.6);
        opacity: 0;
    }
}

/* Hotspot Positions (percentage-based) */
.cga-hotspot[data-hotspot="production"] { left: 18.25%; top: 23.65%; }
.cga-hotspot[data-hotspot="delivery"] { left: 19.12%; top: 43.43%; }
.cga-hotspot[data-hotspot="storage"] { left: 58.25%; top: 59.50%; }
.cga-hotspot[data-hotspot="applications"] { left: 57.05%; top: 23.65%; }

/* ============================================
   Mobile Quick Links Menu
   ============================================ */
.cga-mobile-menu {
    display: none;
    padding: 30px 20px 40px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.cga-mobile-menu-title {
    text-align: center;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 24px;
}

.cga-mobile-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    margin: 0 auto;
}

.cga-mobile-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: #fff;
    font-family: var(--shp-font);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cga-mobile-btn:hover,
.cga-mobile-btn:focus {
    background: rgba(34, 178, 115, 0.2);
    border-color: var(--shp-accent);
    transform: translateX(4px);
}

.cga-mobile-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--shp-accent);
    border-radius: 10px;
    flex-shrink: 0;
}

.cga-mobile-btn-icon svg {
    width: 20px;
    height: 20px;
    stroke: #fff;
}

.cga-mobile-btn-text {
    flex: 1;
}

/* ============================================
   Popup Styles
   ============================================ */
.cga-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(4px);
}

.cga-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.cga-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--shp-bg);
    border-radius: var(--shp-radius-lg);
    max-width: 520px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
}

.cga-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.cga-popup-header {
    position: sticky;
    top: 0;
    background: var(--shp-bg);
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--shp-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cga-popup-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--shp-accent);
}

.cga-popup-close {
    background: var(--shp-bg-alt);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--shp-text-light);
    padding: 0;
    line-height: 1;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.cga-popup-close:hover {
    color: var(--shp-text);
    background: var(--shp-border);
}

.cga-popup-content {
    padding: 16px 24px 28px;
}

.cga-standards-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cga-standard-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--shp-border);
}

.cga-standard-item:last-child {
    border-bottom: none;
}

.cga-standard-link {
    display: block;
    color: var(--shp-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    line-height: 1.5;
    transition: color 0.2s ease;
}

.cga-standard-link:hover {
    color: var(--shp-accent);
}

/* ============================================
   Publications Section
   ============================================ */
.shp-publications {
    padding: 60px 0 80px;
    background: var(--shp-bg);
}

.shp-section-header {
    text-align: center;
    margin-bottom: 32px;
}

.shp-section-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--shp-primary);
    margin: 0 0 8px;
}

.shp-section-subtitle {
    font-size: 1rem;
    color: var(--shp-text-light);
    margin: 0;
}

/* ============================================
   Filters
   ============================================ */
.shp-filters {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.shp-search-wrapper {
    position: relative;
    max-width: 450px;
    margin: 0 auto;
    width: 100%;
}

.shp-search-input {
    width: 100%;
    padding: 14px 56px 14px 20px;
    font-size: 1rem;
    font-family: var(--shp-font);
    border: 2px solid var(--shp-border);
    border-radius: 50px;
    background: var(--shp-bg);
    color: var(--shp-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.shp-search-input:focus {
    outline: none;
    border-color: var(--shp-accent);
    box-shadow: 0 0 0 3px rgba(34, 178, 115, 0.15);
}

.shp-search-input::placeholder {
    color: var(--shp-text-light);
}

.shp-search-submit {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--shp-accent);
    border: none;
    cursor: pointer;
    color: #fff;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.shp-search-submit:hover {
    background: var(--shp-accent-dark);
}

.shp-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.shp-filter-btn {
    padding: 10px 18px;
    font-size: 0.9rem;
    font-family: var(--shp-font);
    font-weight: 500;
    border: 2px solid var(--shp-border);
    border-radius: 50px;
    background: var(--shp-bg);
    color: var(--shp-text);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.shp-filter-btn:hover {
    border-color: var(--shp-accent);
    color: var(--shp-accent);
}

.shp-filter-btn.active {
    background: var(--shp-accent);
    border-color: var(--shp-accent);
    color: white;
}

.shp-filter-count {
    opacity: 0.7;
    font-size: 0.85em;
    margin-left: 2px;
}

/* Active Filters */
.shp-active-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
}

.shp-active-filter {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: var(--shp-bg-alt);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--shp-text);
}

.shp-remove-filter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: var(--shp-text-light);
    color: #fff;
    border-radius: 50%;
    border: none;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease;
}

.shp-remove-filter:hover {
    background: #e53e3e;
    color: #fff;
}

.shp-clear-all {
    font-size: 0.85rem;
    font-family: var(--shp-font);
    color: var(--shp-primary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.shp-clear-all:hover {
    color: var(--shp-accent);
    text-decoration: underline;
}

/* ============================================
   Publications Grid
   ============================================ */
.shp-grid-wrapper {
    position: relative;
    min-height: 200px;
}

.shp-grid-wrapper.loading .shp-grid {
    opacity: 0.4;
    pointer-events: none;
}

.shp-loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 10;
    color: var(--shp-text-light);
    font-size: 0.9rem;
}

.shp-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--shp-border);
    border-top-color: var(--shp-accent);
    border-radius: 50%;
    animation: shpSpin 0.8s linear infinite;
}

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

.shp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    transition: opacity 0.2s ease;
}

.shp-card {
    background: var(--shp-bg);
    border: 1px solid var(--shp-border);
    border-radius: var(--shp-radius-lg);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    display: flex;
    flex-direction: column;
}

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

.shp-card-media {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--shp-bg-alt);
}

.shp-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.shp-card:hover .shp-card-media img {
    transform: scale(1.05);
}

.shp-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.shp-card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.shp-card-category {
    font-size: 0.7rem;
    font-weight: 700;
    font-family: var(--shp-font);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--shp-accent);
    background: rgba(34, 178, 115, 0.1);
    padding: 3px 8px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease;
}

.shp-card-category:hover {
    background: rgba(34, 178, 115, 0.2);
}

.shp-card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 10px;
    color: var(--shp-text);
}

.shp-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.shp-card-title a:hover {
    color: var(--shp-accent);
}

.shp-card-title .pub-code {
    color: var(--shp-primary);
    font-weight: 700;
}

.shp-card-excerpt {
    font-size: 0.9rem;
    color: var(--shp-text-light);
    line-height: 1.55;
    margin: 0 0 14px;
    flex: 1;
}

.shp-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--shp-primary);
    text-decoration: none;
    transition: color 0.2s ease;
    margin-top: auto;
}

.shp-card-link:hover {
    color: var(--shp-accent);
}

.shp-card-link svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.shp-card-link:hover svg {
    transform: translate(2px, -2px);
}

/* ============================================
   No Results
   ============================================ */
.shp-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 20px;
    color: var(--shp-text-light);
}

.shp-no-results svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.shp-no-results p {
    margin: 0 0 20px;
    font-size: 1.1rem;
}

.shp-btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 0.95rem;
    font-family: var(--shp-font);
    font-weight: 600;
    background: var(--shp-primary);
    color: white;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.shp-btn:hover {
    background: var(--shp-accent);
    color: white;
}

/* ============================================
   Responsive - Tablet
   ============================================ */
@media (max-width: 900px) {
    .shp-hero-title {
        font-size: 1.75rem;
    }

    .shp-hero-description {
        font-size: 0.95rem;
    }

    .cga-hotspot {
        width: 100px;
        height: 100px;
    }

    .hotspot-core {
        width: 36px;
        height: 36px;
    }

    .hotspot-ring {
        width: 60px;
        height: 60px;
        border-width: 3px;
    }

    .hotspot-pulse {
        width: 90px;
        height: 90px;
    }

    .hotspot-label {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
}

/* ============================================
   Responsive - Mobile (Hide Map, Show Menu)
   ============================================ */
@media (max-width: 768px) {
    /* Hide the video map on mobile */
    .cga-map-wrapper {
        display: none;
    }

    /* Show the mobile menu */
    .cga-mobile-menu {
        display: block;
    }

    .shp-hero-text {
        padding: 30px 20px 0;
    }

    .shp-hero-title {
        font-size: 1.5rem;
    }

    .shp-hero-description {
        font-size: 0.9rem;
    }

    .cga-popup {
        width: 95%;
        max-height: 85vh;
    }

    .cga-popup-header {
        padding: 20px 20px 14px;
    }

    .cga-popup-title {
        font-size: 1.15rem;
    }

    .cga-popup-content {
        padding: 12px 20px 24px;
    }

    .shp-publications {
        padding: 40px 0 60px;
    }

    .shp-section-title {
        font-size: 1.35rem;
    }

    .shp-filter-buttons {
        gap: 8px;
    }

    .shp-filter-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .shp-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .shp-card-body {
        padding: 16px;
    }

    .shp-card-title {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    .shp-hero-text {
        padding: 24px 16px 0;
    }

    .shp-hero-title {
        font-size: 1.35rem;
    }

    .cga-mobile-menu {
        padding: 24px 16px 32px;
    }

    .cga-mobile-btn {
        padding: 14px 16px;
        gap: 12px;
        font-size: 0.9rem;
    }

    .cga-mobile-btn-icon {
        width: 36px;
        height: 36px;
    }

    .cga-mobile-btn-icon svg {
        width: 18px;
        height: 18px;
    }

    .shp-filter-btn {
        padding: 8px 12px;
        font-size: 0.75rem;
    }

    .shp-filter-count {
        display: none;
    }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
    .cga-map-wrapper,
    .cga-mobile-menu,
    .shp-filters {
        display: none;
    }

    .shp-hero {
        background: none;
        padding: 20px;
    }

    .shp-hero-title,
    .shp-hero-description {
        color: #000;
    }

    .shp-grid {
        display: block;
    }

    .shp-card {
        break-inside: avoid;
        margin-bottom: 16px;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
