/* Global Settings */
:root {
    --bg-color: #0b1120;
    /* Deeper tone */
    --bg-gradient: radial-gradient(circle at 50% 10%, #1e293b 0%, #0f172a 40%, #020617 100%);

    --primary-color: #2dd4bf;
    /* Teal-400 equivalent */
    --primary-glow: rgba(45, 212, 191, 0.4);

    --secondary-color: #94a3b8;
    /* Slate-400 */
    --text-main: #f8fafc;
    /* Slate-50 */
    --text-muted: #cbd5e1;
    /* Slate-300 */

    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    --overlay-bg: rgba(2, 6, 23, 0.85);

    /* Assessment Colors - slightly more pastel/neon */
    --level-5: #2dd4bf;
    /* Sanctuary */
    --level-4: #38bdf8;
    /* Mindful */
    --level-3: #fcd34d;
    /* Balanced */
    --level-2: #fb923c;
    /* Urban */
    --level-1: #f43f5e;
    /* Overload */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 400;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    line-height: 1.8;
    /* Increased global line-height */
    letter-spacing: 0.04em;
    /* Slight spacing for elegance */
}

/* Utilities */
.hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100%;
    transition: opacity 0.8s ease, visibility 0.8s;
    opacity: 0;
    visibility: hidden;
    z-index: 1;
}

.screen.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
    position: relative;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.pop-in {
    animation: popIn 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

/* Glass Panel - Enhanced */
.glass-panel {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: var(--glass-shadow);
}

/* Opening Screen */
#opening-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--bg-gradient);
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.opening-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.logo-container {
    width: 100px;
    height: 100px;
    margin-bottom: 0.5rem;
    position: relative;
}

.logo-circle {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), transparent);
    box-shadow: 0 0 40px var(--primary-glow);
    animation: pulse-glow 3s infinite ease-in-out;
}

@keyframes pulse-glow {

    0%,
    100% {
        opacity: 0.8;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(0.95);
    }
}

.app-title {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 200;
    letter-spacing: 0.15em;
    background: linear-gradient(to right, #fff, var(--primary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: -0.5rem;
}

.app-subtitle {
    color: var(--secondary-color);
    font-size: 0.9rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.8;
}

/* Navigation */
.top-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding: 0 10px;
    z-index: 210;
    /* Higher than overlay (200) */
}

.nav-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--primary-color);
}

.icon-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid transparent;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Main Content */
.container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 20px 24px;
    max-width: 600px;
    margin: 0 auto;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    padding: 2rem 0;
    width: 100%;
}

.instruction {
    text-align: center;
    color: var(--text-muted);
    font-weight: 300;
    font-size: 1.05rem;
    line-height: 2;
    margin-bottom: 1rem;
}

/* Visualization */
.visualization-area {
    position: relative;
    width: 280px;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.center-core {
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    z-index: 5;
    box-shadow: 0 0 20px #fff;
}

.ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 15px var(--primary-glow) inset;
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.5);
}

.animating .ripple {
    animation: ripple-spread 4s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
}

.animating .delay-0 {
    animation-delay: 0s;
}

.animating .delay-1 {
    animation-delay: 1.2s;
}

.animating .delay-2 {
    animation-delay: 2.4s;
}

@keyframes ripple-spread {
    0% {
        transform: translate(-50%, -50%) scale(0.2);
        opacity: 0;
    }

    20% {
        opacity: 0.6;
    }

    100% {
        transform: translate(-50%, -50%) scale(2.5);
        opacity: 0;
        border-width: 0;
    }
}

/* Status */
#status-display {
    text-align: center;
    margin-bottom: 1rem;
}

.status-main {
    font-family: 'Outfit', sans-serif;
    font-size: 2.5rem;
    font-weight: 200;
    color: #fff;
    letter-spacing: 0.05em;
    text-shadow: 0 0 20px var(--primary-glow);
}

.status-sub {
    font-size: 0.95rem;
    color: var(--secondary-color);
    margin-top: 0.5rem;
    letter-spacing: 0.05em;
}

/* Buttons */
.glass-btn {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 16px 40px;
    border-radius: 100px;
    font-size: 1.1rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-family: 'Zen Kaku Gothic New', sans-serif;
    font-weight: 500;
    letter-spacing: 0.05em;
    position: relative;
    overflow: hidden;
}

.glass-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: 0.5s;
}

.glass-btn:hover::before {
    left: 100%;
}

.glass-btn:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 20px var(--primary-glow);
    transform: translateY(-2px);
}

.glass-btn.primary {
    background: var(--primary-color);
    border: none;
    color: #020617;
    font-weight: 700;
}

.glass-btn.primary:hover {
    background: #5eead4;
    box-shadow: 0 0 30px var(--primary-glow);
}

.glass-btn.small-btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    width: 100%;
    border-radius: 16px;
    margin-top: 10px;
}

.glass-btn.secondary-btn {
    margin-top: 2rem;
    background: transparent;
    border-color: var(--secondary-color);
    color: var(--secondary-color);
    width: auto;
    padding: 10px 30px;
    font-size: 0.9rem;
}

/* Inputs & Slider */
.input-section {
    margin-top: 1rem;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    font-weight: 500;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(0, 0, 0, 0.2);
    padding: 15px 20px;
    border-radius: 16px;
    border: 1px solid var(--glass-border);
}

.styled-slider {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.styled-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary-color);
    border: 4px solid #0f172a;
    box-shadow: 0 0 10px var(--primary-glow);
    transition: transform 0.2s;
}

.styled-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

#wifi-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    min-width: 50px;
    text-align: right;
}

.input-hint {
    margin-top: 12px;
    font-size: 0.8rem;
    color: var(--secondary-color);
    opacity: 0.8;
}

.glass-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s;
}

.glass-input:focus {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.4);
}

/* Result Layout */
.result-panel {
    width: 100%;
    gap: 1.5rem;
    padding: 2rem;
    background: rgba(15, 23, 42, 0.6);
}

.assessment-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.assessment-title {
    font-size: 0.9rem;
    color: var(--secondary-color);
    display: block;
    margin-bottom: 0.5rem;
}

.assessment-badge {
    display: block;
    width: 100%;
    text-align: center;
    padding: 12px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f172a;
    letter-spacing: 0.05em;
}

/* Recommendation */
.recommendation-card {
    background: linear-gradient(135deg, rgba(45, 212, 191, 0.1), rgba(45, 212, 191, 0.02));
    border: 1px solid rgba(45, 212, 191, 0.3);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.rec-icon {
    font-size: 1.4rem;
    color: var(--primary-color);
    width: 48px;
    height: 48px;
    background: rgba(45, 212, 191, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rec-label {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.1em;
    opacity: 0.9;
}

.rec-text {
    font-size: 1rem;
    line-height: 1.8;
    color: #e2e8f0;
}

/* Grid */
.result-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 1.5rem;
}

.result-card {
    background: rgba(30, 41, 59, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    transition: transform 0.3s;
}

.result-card:hover {
    transform: translateY(-3px);
    background: rgba(30, 41, 59, 0.6);
}

.result-card.full-width {
    grid-column: span 2;
    flex-direction: row;
    align-items: center;
}

.card-icon {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.result-card.full-width .card-icon {
    margin-bottom: 0;
    margin-right: 5px;
}

.card-label {
    font-size: 0.75rem;
    color: var(--secondary-color);
    font-weight: 500;
}

.card-value {
    font-family: 'Outfit', sans-serif;
    font-size: 1.35rem;
    font-weight: 500;
    color: #fff;
    letter-spacing: 0.02em;
}

.card-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    opacity: 0.8;
}

.value-row {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

/* Overlay & Modals */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.7);
    backdrop-filter: blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 200;
}

.overlay-panel {
    width: 90%;
    max-width: 450px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 3rem 2rem;
}

.overlay-panel h2 {
    font-size: 1.8rem;
    font-weight: 300;
    letter-spacing: 0.1em;
}

.overlay-panel .note {
    color: var(--secondary-color);
    font-size: 0.95rem;
    line-height: 1.8;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 300;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1;
}

.modal-content {
    position: relative;
    z-index: 10;
    width: 90%;
    max-width: 500px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    background: #0f172a;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.modal-header h3 {
    font-size: 1.2rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: #fff;
    margin: 0;
}

.close-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    font-size: 1rem;
}

.close-btn:hover {
    background: rgba(255, 50, 50, 0.2);
    border-color: rgba(255, 50, 50, 0.4);
    color: #fff;
    transform: rotate(90deg) scale(1.1);
}

.help-section {
    margin-bottom: 2.5rem;
}

.help-section h4 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
}

.help-section p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.8;
    padding-left: 28px;
}

/* History */
.history-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-item:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
    border-color: rgba(255, 255, 255, 0.1);
}

.history-location {
    font-weight: 600;
    font-size: 1.05rem;
    color: #fff;
}

.history-date {
    font-size: 0.8rem;
    color: var(--secondary-color);
    font-family: 'Outfit', sans-serif;
}

.history-badge {
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 6px;
    color: #020617 !important;
    /* Force dark text for contrast */
    background: #fff;
    /* Fallback */
    font-weight: 700;
}

.history-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-details-grid span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.history-details-grid i {
    color: var(--primary-color);
    width: 16px;
    text-align: center;
}

.history-date {
    font-size: 0.75rem;
    color: var(--secondary-color);
    margin-top: 8px;
    text-align: right;
    opacity: 0.7;
}