/* =============================================
   ZONE DISCOVERY — Psychological Event Search
   Personal Cockpit Integration Module
   Version: 1.0.0 | Created: 2026-02-22
   ============================================= */

/* ─────────────────────────────────────────────
   SECTION: Main Container
   ───────────────────────────────────────────── */

.zone-discovery {
    padding: 2.5rem 0 3rem;
    position: relative;
}

.zone-discovery .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ─────────────────────────────────────────────
   SECTION: Header — Title + Assistant Message
   ───────────────────────────────────────────── */

.zone-header {
    text-align: center;
    margin-bottom: 1.8rem;
}

.zone-main-title {
    font-size: 2rem;
    font-weight: 700;
    color: #e0f0e0;
    margin: 0 0 0.5rem 0;
    letter-spacing: -0.02em;
}

.zone-assistant-message {
    font-size: 1.05rem;
    color: #88b8a0;
    font-style: italic;
    margin: 0;
    opacity: 0;
    transform: translateY(8px);
    animation: zoneAssistantFadeIn 0.6s ease 0.2s forwards;
}

@keyframes zoneAssistantFadeIn {
    to {
        opacity: 0.9;
        transform: translateY(0);
    }
}

/* ─────────────────────────────────────────────
   SECTION: Header Location Pill
   ───────────────────────────────────────────── */

.header-location-pill {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    margin: 1.2rem auto 0;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 2rem;
    transition: all 0.3s ease;
}

.header-location-pill:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(126, 255, 109, 0.2);
}

.header-location-pill svg.icon-location {
    width: 14px !important;
    height: 14px !important;
    color: #7EFF6D;
    flex-shrink: 0;
}

.events-header .header-location-pill #user-location {
    font-size: 0.88rem !important;
    color: rgba(255, 255, 255, 0.75);
    font-weight: 400 !important;
}

.events-header .header-location-pill .btn-change-location {
    padding: 0.2rem 0.6rem !important;
    background: rgba(126, 255, 109, 0.08);
    border: 1px solid rgba(126, 255, 109, 0.2);
    border-radius: 1rem !important;
    color: #7EFF6D;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.75rem !important;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.events-header .header-location-pill .btn-change-location:hover {
    background: rgba(126, 255, 109, 0.15);
    transform: translateY(-1px);
}

/* ─────────────────────────────────────────────
   SECTION: Location Bar
   ───────────────────────────────────────────── */

.zone-location-bar {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.zone-location {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.2rem;
    background: rgba(126, 255, 109, 0.06);
    border: 1px solid rgba(126, 255, 109, 0.15);
    border-radius: 2rem;
    color: #c0e8c0;
    cursor: pointer;
    transition: all 0.25s ease;
    font-size: 0.92rem;
}

.zone-location:hover {
    background: rgba(126, 255, 109, 0.12);
    border-color: rgba(126, 255, 109, 0.35);
}

.zone-location-icon {
    font-size: 1rem;
    opacity: 0.8;
}

.zone-change-link {
    color: #7EFF6D;
    font-size: 0.82rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    margin-left: 0.25rem;
}

/* ─────────────────────────────────────────────
   SECTION: Zone Cards Grid (5 Cards)
   ───────────────────────────────────────────── */

.zone-cards {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
    margin-bottom: 2rem;
}

@media (max-width: 1100px) {
    .zone-cards {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 720px) {
    .zone-cards {
        grid-template-columns: 1fr 1fr;
        gap: 0.7rem;
    }

    .header-location-pill {
        padding: 0.5rem 1rem;
        gap: 0.45rem;
    }
    .header-location-pill #user-location {
        font-size: 0.88rem;
    }
}

@media (max-width: 420px) {
    .zone-cards {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }

    .header-location-pill {
        padding: 0.4rem 0.8rem;
        gap: 0.4rem;
    }
    .header-location-pill .btn-change-location {
        padding: 0.25rem 0.6rem;
        font-size: 0.78rem;
    }
}

/* ─────────────────────────────────────────────
   SECTION: Individual Zone Card
   ───────────────────────────────────────────── */

.zone-card {
    position: relative;
    padding: 2.2rem 1.4rem 1.8rem;
    border-radius: 1.1rem;
    background: linear-gradient(160deg,
        rgba(15, 38, 38, 0.92) 0%,
        rgba(10, 21, 21, 0.96) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-align: center;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

/* Top accent bar */
.zone-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--zone-color, #7EFF6D);
    opacity: 0.5;
    transition: opacity 0.3s ease, height 0.3s ease;
}

/* Hover glow */
.zone-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(ellipse at 50% 0%, var(--zone-accent, rgba(126,255,109,0.1)) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.zone-card:hover {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--zone-color, #7EFF6D) 40%, transparent);
    box-shadow:
        0 8px 32px var(--zone-accent, rgba(126, 255, 109, 0.12)),
        0 2px 8px rgba(0, 0, 0, 0.3);
}

.zone-card:hover::before {
    opacity: 1;
}

.zone-card:hover::after {
    opacity: 1;
}

/* Active/selected state */
.zone-card--active {
    border-color: var(--zone-color) !important;
    box-shadow: 0 0 24px var(--zone-accent, rgba(126, 255, 109, 0.15));
}

.zone-card--active::before {
    opacity: 1;
    height: 4px;
}

.zone-card--active::after {
    opacity: 0.8;
}

/* ─────────────────────────────────────────────
   SECTION: Zone Card — Cockpit States
   ───────────────────────────────────────────── */

/* Highlighted: Cockpit recommends this zone */
.zone-card--highlight {
    border-color: color-mix(in srgb, var(--zone-color, #7EFF6D) 50%, transparent);
    box-shadow: 0 0 20px var(--zone-accent);
}

/* Warning: User neglects this area */
.zone-card--warning {
    border-color: rgba(255, 107, 53, 0.5);
    box-shadow: 0 0 15px rgba(255, 107, 53, 0.12);
}

.zone-card--warning::before {
    background: #ff6b35;
    opacity: 0.8;
}

/* Dimmed: User is overloading this area */
.zone-card--dim {
    opacity: 0.45;
    filter: grayscale(0.35);
}

.zone-card--dim:hover {
    opacity: 0.75;
    filter: grayscale(0);
}

/* Pulse animation for highlighted zones */
.zone-card--pulse {
    animation: zonePulse 2.5s ease-in-out infinite;
}

@keyframes zonePulse {
    0%, 100% {
        box-shadow: 0 0 12px var(--zone-accent, rgba(126, 255, 109, 0.1));
    }
    50% {
        box-shadow:
            0 0 24px var(--zone-accent, rgba(126, 255, 109, 0.2)),
            0 0 48px var(--zone-accent, rgba(126, 255, 109, 0.08));
    }
}

/* ─────────────────────────────────────────────
   SECTION: Card Badges (Recommended / Warning)
   ───────────────────────────────────────────── */

.zone-card--recommended {
    order: -1; /* Push to front */
}

.zone-recommended-tag {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    padding: 0.15rem 0.55rem;
    background: var(--zone-color, #7EFF6D);
    color: #0a1515;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.5;
    z-index: 2;
}

.zone-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.55rem;
    font-size: 1rem;
    z-index: 2;
    animation: badgeBounce 1.8s ease-in-out infinite;
}

@keyframes badgeBounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-3px) scale(1.1); }
}

/* ─────────────────────────────────────────────
   SECTION: Card Content
   ───────────────────────────────────────────── */

.zone-card-icon {
    font-size: 2.8rem;
    margin-bottom: 0.75rem;
    line-height: 1;
}

.zone-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #e0f0e0;
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.zone-card-hook {
    font-size: 0.92rem;
    color: #88b8a0;
    line-height: 1.55;
    margin: 0 0 0.75rem 0;
    opacity: 0.85;
}

/* Signal message from cockpit */
.zone-card-signal {
    font-size: 0.72rem;
    color: var(--zone-color, #7EFF6D);
    font-weight: 600;
    margin: 0.5rem 0 0 0;
    padding: 0.3rem 0.5rem;
    background: var(--zone-accent, rgba(126, 255, 109, 0.08));
    border-radius: 0.4rem;
    display: inline-block;
}

.zone-card--warning .zone-card-signal {
    color: #ff6b35;
    background: rgba(255, 107, 53, 0.1);
}

/* Subcategory preview tags */
.zone-card-subs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    justify-content: center;
    margin-top: 0.5rem;
}

.zone-sub-tag {
    font-size: 0.76rem;
    color: #6a8a7a;
    padding: 0.18rem 0.5rem;
    background: rgba(255, 255, 255, 0.035);
    border-radius: 0.3rem;
    white-space: nowrap;
}

.zone-sub-more {
    font-size: 0.76rem;
    color: var(--zone-color, #7EFF6D);
    padding: 0.18rem 0.5rem;
    opacity: 0.8;
}

/* ─────────────────────────────────────────────
   SECTION: Subcategory Panel
   (Expands after zone selection)
   ───────────────────────────────────────────── */

.zone-subcategories {
    background: rgba(15, 38, 38, 0.75);
    border: 1px solid rgba(126, 255, 109, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.zone-sub-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.zone-back-btn {
    background: none;
    border: 1px solid rgba(126, 255, 109, 0.25);
    color: #7EFF6D;
    padding: 0.35rem 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.82rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.zone-back-btn:hover {
    background: rgba(126, 255, 109, 0.1);
    border-color: rgba(126, 255, 109, 0.5);
}

.zone-sub-header h3 {
    color: #e0f0e0;
    font-size: 1.15rem;
    margin: 0;
    font-weight: 600;
}

/* Assistant bubble inside subcategory panel */
.zone-sub-intro {
    margin-bottom: 1.2rem;
}

.zone-assistant-bubble {
    color: #88b8a0;
    font-style: italic;
    padding: 0.75rem 1rem;
    margin: 0;
    background: rgba(126, 255, 109, 0.04);
    border-left: 3px solid rgba(126, 255, 109, 0.25);
    border-radius: 0 0.5rem 0.5rem 0;
    font-size: 0.88rem;
    line-height: 1.5;
}

/* Subcategory buttons grid */
.zone-sub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

@media (max-width: 520px) {
    .zone-sub-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.zone-sub-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.9rem;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 0.7rem;
    color: #b8d8c8;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.88rem;
    text-align: left;
    font-family: inherit;
}

.zone-sub-btn:hover {
    background: rgba(126, 255, 109, 0.08);
    border-color: rgba(126, 255, 109, 0.25);
    color: #d0f0d0;
}

.zone-sub-btn--active {
    background: rgba(126, 255, 109, 0.12) !important;
    border-color: rgba(126, 255, 109, 0.5) !important;
    color: #7EFF6D !important;
}

.zone-sub-btn-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
}

.zone-sub-btn-label {
    line-height: 1.3;
}

/* "Show all from this zone" button */
.zone-show-all-btn {
    display: block;
    width: 100%;
    padding: 0.65rem;
    background: rgba(126, 255, 109, 0.06);
    border: 1px solid rgba(126, 255, 109, 0.18);
    border-radius: 0.5rem;
    color: #7EFF6D;
    cursor: pointer;
    font-size: 0.88rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.zone-show-all-btn:hover {
    background: rgba(126, 255, 109, 0.12);
    border-color: rgba(126, 255, 109, 0.4);
}

/* ─────────────────────────────────────────────
   SECTION: Event Results
   ───────────────────────────────────────────── */

.zone-events {
    min-height: 0;
    transition: min-height 0.3s ease;
}

.zone-events-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.zone-events-title {
    color: #c0e8c0;
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.zone-events-count {
    color: #7a9a8a;
    font-size: 0.85rem;
}

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

@media (max-width: 640px) {
    .zone-events-grid {
        grid-template-columns: 1fr;
    }
}

/* Individual event card */
.zone-event-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    padding: 1.1rem 1.2rem;
    background: rgba(15, 38, 38, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 0.75rem;
    transition: all 0.25s ease;
    border-top: 3px solid var(--zone-color, #7EFF6D);
}

.zone-event-card:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--zone-color, #7EFF6D) 40%, transparent);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.35);
}

.zone-event-date {
    font-size: 0.78rem;
    color: var(--zone-color, #7EFF6D);
    margin-bottom: 0.35rem;
    font-weight: 600;
}

.zone-event-title {
    font-size: 0.95rem;
    color: #e0f0e0;
    margin: 0 0 0.3rem 0;
    line-height: 1.35;
    font-weight: 500;
}

.zone-event-location {
    font-size: 0.82rem;
    color: #88b8a0;
    margin: 0 0 0.5rem 0;
}

.zone-event-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.5rem;
}

.zone-event-price {
    font-size: 0.82rem;
    color: #c0e8c0;
    font-weight: 600;
}

.zone-event-free {
    color: #7EFF6D;
}

.zone-event-category-tag {
    font-size: 0.7rem;
    color: #6a8a7a;
    padding: 0.1rem 0.4rem;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 0.25rem;
}

/* ─────────────────────────────────────────────
   SECTION: Loading State
   ───────────────────────────────────────────── */

.zone-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #88b8a0;
}

.zone-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(126, 255, 109, 0.15);
    border-top-color: #7EFF6D;
    border-radius: 50%;
    margin: 0 auto 0.8rem;
    animation: zoneSpin 0.75s linear infinite;
}

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

.zone-loading p {
    margin: 0;
    font-size: 0.9rem;
}

/* ─────────────────────────────────────────────
   SECTION: Empty State
   ───────────────────────────────────────────── */

.zone-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #88b8a0;
}

.zone-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.zone-empty p {
    margin: 0;
}

.zone-empty-hint {
    font-size: 0.83rem;
    margin-top: 0.5rem !important;
    opacity: 0.65;
}

/* ─────────────────────────────────────────────
   SECTION: Transition Animations
   ───────────────────────────────────────────── */

.zone-fade-in {
    animation: zoneFadeIn 0.35s ease forwards;
}

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

.zone-card {
    opacity: 0;
    animation: zoneCardAppear 0.4s ease forwards;
}

.zone-card:nth-child(1) { animation-delay: 0.05s; }
.zone-card:nth-child(2) { animation-delay: 0.1s; }
.zone-card:nth-child(3) { animation-delay: 0.15s; }
.zone-card:nth-child(4) { animation-delay: 0.2s; }
.zone-card:nth-child(5) { animation-delay: 0.25s; }

@keyframes zoneCardAppear {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ─────────────────────────────────────────────
   SECTION: Cockpit Integration Feedback
   ───────────────────────────────────────────── */

/* Brief glow when zone context is refreshed after mood check-in */
.zone-context-refreshed {
    animation: zoneContextGlow 1.2s ease-out;
}

@keyframes zoneContextGlow {
    0%   { box-shadow: 0 0 0 0 rgba(126, 255, 109, 0.3); }
    30%  { box-shadow: 0 0 20px 4px rgba(126, 255, 109, 0.15); }
    100% { box-shadow: 0 0 0 0 rgba(126, 255, 109, 0); }
}

/* ─────────────────────────────────────────────
   SECTION: Reduced Motion (Accessibility)
   ───────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .zone-card,
    .zone-assistant-message,
    .zone-card--pulse,
    .zone-context-refreshed {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    .zone-spinner {
        animation-duration: 1.5s;
    }
    .zone-badge {
        animation: none !important;
    }
}
