/* =============================================
   SIMULATION GARDEN PAVILION - Main Stylesheet
   Mobile-first, Touch-friendly
   ============================================= */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    overflow: hidden;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    touch-action: pan-x pan-y pinch-zoom;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    -webkit-font-smoothing: antialiased;
    background: #1a1a2e;
}

/* ---------- Header Info ---------- */
#info {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #e0e0e0;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    letter-spacing: 1px;
    pointer-events: none;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    white-space: nowrap;
}

/* ---------- Legend ---------- */
.legend {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.75);
    padding: 10px 14px;
    border-radius: 25px;
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    flex-wrap: wrap;
    justify-content: center;
    max-width: 95vw;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #ccc;
    font-size: 10px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 15px;
    transition: background 0.3s;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
}

.legend-item:active {
    background: rgba(255, 255, 255, 0.2);
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ---------- Controls Hint ---------- */
.controls-hint {
    position: absolute;
    bottom: 85px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.45);
    font-size: 10px;
    z-index: 10;
    pointer-events: none;
    white-space: nowrap;
}

/* ---------- Touch Navigation Buttons ---------- */
.touch-controls {
    position: absolute;
    bottom: 120px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 20;
}

.touch-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    touch-action: manipulation;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.2s;
}

.touch-btn:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.92);
}

.reset-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 20;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    touch-action: manipulation;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.2s;
}

.reset-btn:active {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(0.92);
}

/* ---------- Floating Contact Button ---------- */
.floating-contact {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 10px;
}

.floating-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f5c842, #e0a800);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #1a1a2e;
    font-size: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 30px rgba(245, 200, 66, 0.5);
    animation: floatAnim 3s ease-in-out infinite, glowPulse 2s ease-in-out infinite;
    transition: all 0.3s;
    -webkit-tap-highlight-color: rgba(245, 200, 66, 0.3);
    touch-action: manipulation;
}

.floating-btn:active {
    transform: scale(0.9);
    box-shadow: 0 4px 15px rgba(245, 200, 66, 0.8);
}

@keyframes floatAnim {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes glowPulse {
    0%, 100% { box-shadow: 0 8px 30px rgba(245, 200, 66, 0.5); }
    50% { box-shadow: 0 8px 45px rgba(245, 200, 66, 0.85), 0 0 60px rgba(245, 200, 66, 0.3); }
}

.floating-label {
    background: rgba(0, 0, 0, 0.8);
    color: #f5c842;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    white-space: nowrap;
    border: 1px solid rgba(245, 200, 66, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.4s;
    pointer-events: none;
}

.floating-label.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ---------- Modal Popup ---------- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 100;
    display: none;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal-card {
    background: linear-gradient(145deg, #1e1e30, #2a2a40);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 25px;
    max-width: 500px;
    width: 90%;
    max-height: 75vh;
    overflow-y: auto;
    color: #e0e0e0;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

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

.modal-close {
    position: absolute;
    top: 12px;
    right: 15px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 10;
    -webkit-tap-highlight-color: rgba(255, 80, 80, 0.3);
}

.modal-close:active {
    background: rgba(255, 80, 80, 0.5);
    transform: rotate(90deg);
}

.modal-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
    letter-spacing: 1px;
}

.modal-subtitle {
    font-size: 11px;
    color: #999;
    margin-bottom: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.modal-divider {
    width: 50px;
    height: 3px;
    border-radius: 3px;
    margin-bottom: 12px;
}

.modal-desc {
    font-size: 13px;
    line-height: 1.6;
    color: #bbb;
    margin-bottom: 16px;
}

.modal-features {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.modal-tag {
    background: rgba(255, 255, 255, 0.08);
    padding: 5px 12px;
    border-radius: 18px;
    font-size: 10px;
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.modal-btn {
    display: inline-block;
    background: rgba(120, 200, 160, 0.25);
    color: #a0e8c0;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(160, 232, 192, 0.4);
    transition: all 0.3s;
    text-align: center;
    letter-spacing: 0.5px;
    -webkit-tap-highlight-color: rgba(120, 200, 160, 0.3);
}

.modal-btn:active {
    background: rgba(120, 200, 160, 0.5);
    transform: scale(0.96);
}

/* ---------- Mailbox / Contact Modal ---------- */
.mailbox-modal {
    background: linear-gradient(160deg, #1a1a30, #252540);
    border: 2px solid rgba(200, 170, 120, 0.5);
    text-align: center;
}

.mailbox-modal .modal-icon {
    font-size: 60px;
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-15px); }
}

.contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px;
    margin: 10px 0;
    border-radius: 16px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: none;
    transition: all 0.3s;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.wa-btn {
    background: linear-gradient(135deg, #25D366, #128C7E);
    box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

.wa-btn:active {
    transform: scale(0.96);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.5);
}

.email-btn {
    background: linear-gradient(135deg, #EA4335, #BB001B);
    box-shadow: 0 8px 25px rgba(234, 67, 53, 0.3);
}

.email-btn:active {
    transform: scale(0.96);
    box-shadow: 0 4px 15px rgba(234, 67, 53, 0.5);
}

.contact-btn-icon {
    font-size: 28px;
}

/* ---------- Simulation Panel ---------- */
.sim-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(10, 15, 25, 0.96);
    border: 1px solid rgba(100, 200, 150, 0.4);
    border-radius: 20px;
    padding: 20px;
    z-index: 200;
    display: none;
    width: 94%;
    max-width: 750px;
    max-height: 85vh;
    overflow-y: auto;
    color: #e0e0e0;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
}

.sim-panel.active {
    display: block;
    animation: slideUp 0.3s ease-out;
}

.sim-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sim-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.sim-close {
    background: rgba(255, 80, 80, 0.3);
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: rgba(255, 80, 80, 0.3);
    flex-shrink: 0;
    transition: all 0.2s;
}

.sim-close:active {
    background: rgba(255, 80, 80, 0.7);
    transform: scale(0.9);
}

.sim-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

.sim-stat {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sim-stat-label {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #888;
    margin-bottom: 3px;
}

.sim-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: #7ec8e3;
}

.sim-chart {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

canvas.sim-canvas {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    display: block;
}

.sim-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.sim-tab {
    padding: 7px 14px;
    border-radius: 18px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.3px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #999;
    transition: all 0.3s;
    -webkit-tap-highlight-color: rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.sim-tab.active {
    background: rgba(120, 200, 160, 0.2);
    color: #a0e8c0;
    border-color: rgba(160, 232, 192, 0.5);
}

.sim-tab:active {
    background: rgba(255, 255, 255, 0.2);
}

/* ---------- Animations ---------- */
.pulse {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.blink {
    animation: blink 0.8s step-end infinite;
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ---------- Mobile Responsive ---------- */
@media (max-width: 500px) {
    .sim-grid {
        grid-template-columns: 1fr;
    }

    #info {
        font-size: 11px;
        padding: 8px 14px;
    }

    .legend-item {
        font-size: 9px;
        padding: 3px 6px;
    }

    .sim-stat-value {
        font-size: 16px;
    }

    .sim-title {
        font-size: 15px;
    }

    .floating-btn {
        width: 48px;
        height: 48px;
        font-size: 22px;
    }

    .floating-label {
        font-size: 10px;
        padding: 8px 12px;
    }

    .touch-btn {
        width: 42px;
        height: 42px;
        font-size: 18px;
    }

    .modal-card {
        padding: 20px;
        max-height: 70vh;
    }

    .sim-panel {
        padding: 15px;
        max-height: 80vh;
    }

    .contact-btn {
        font-size: 14px;
        padding: 12px;
    }
}

/* ---------- Scrollbar Styling ---------- */
.modal-card::-webkit-scrollbar,
.sim-panel::-webkit-scrollbar {
    width: 4px;
}

.modal-card::-webkit-scrollbar-track,
.sim-panel::-webkit-scrollbar-track {
    background: transparent;
}

.modal-card::-webkit-scrollbar-thumb,
.sim-panel::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 2px;
}