/* ============================================================
   ipjosim.com - Communication Health Verifier
   Medical Clean Teal + Neomorphism Design
   ============================================================ */

:root {
    --color-gray-dark: #6b7280;
    --color-white: #ffffff;
    --color-bg-light: #f5fafa;
    --color-green-bright: #22c55e;
    --color-teal-light: #d1e9e6;
    --color-teal-lighter: #ccfbf1;
    --color-teal: #0d9488;
    --color-teal-dark: #134e4a;
    --color-amber: #f59e0b;
    --color-red: #ef4444;

    --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-korean: 'Noto Sans KR', sans-serif;
    --font-metrics: 'Space Grotesk', 'Inter', sans-serif;

    --gap-xs: 0.5rem;
    --gap-sm: 1rem;
    --gap-md: 1.5rem;
    --gap-lg: 2rem;
    --gap-xl: 3rem;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

/* ============================================================
   RESET & GLOBAL STYLES
   ============================================================ */

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

html {
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background: linear-gradient(135deg, var(--color-bg-light) 0%, var(--color-white) 100%);
    color: var(--color-gray-dark);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

textarea {
    font-family: var(--font-korean);
    resize: vertical;
}

/* ============================================================
   HEADER
   ============================================================ */

.header {
    padding: var(--gap-xl) var(--gap-lg);
    background: var(--color-white);
    border-bottom: 2px solid var(--color-teal-light);
    text-align: center;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.08);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-family: var(--font-korean);
    color: var(--color-teal);
    font-weight: 700;
    margin-bottom: var(--gap-xs);
    letter-spacing: -0.02em;
}

.tagline {
    font-size: 0.95rem;
    color: var(--color-gray-dark);
    font-weight: 400;
    opacity: 0.8;
}

/* ============================================================
   HERO SECTION (THE CHECK-UP)
   ============================================================ */

.hero-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--gap-xl) var(--gap-lg);
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-bg-light) 0%, var(--color-white) 100%);
}

.hero-container {
    width: 100%;
    max-width: 640px;
    display: flex;
    flex-direction: column;
    gap: var(--gap-lg);
}

.hero-title {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    color: var(--color-teal);
    text-align: center;
    font-weight: 700;
}

.hero-subtitle {
    font-size: 1rem;
    color: var(--color-gray-dark);
    text-align: center;
    opacity: 0.7;
    font-family: var(--font-korean);
}

/* Input Area */
.input-area {
    max-width: 640px;
    width: 100%;
    min-height: 150px;
    padding: var(--gap-md);
    border: 2px solid var(--color-teal-light);
    border-radius: var(--radius-md);
    font-family: var(--font-korean);
    font-size: 1rem;
    background: var(--color-white);
    color: var(--color-gray-dark);
    line-height: 1.7;
    box-shadow: 0 4px 16px rgba(13, 148, 136, 0.06);
    transition: all 0.3s ease;
}

.input-area:focus {
    outline: none;
    border-color: var(--color-teal);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.12);
}

.input-area::placeholder {
    color: var(--color-teal-light);
    opacity: 0.8;
}

/* Analyze Button */
.analyze-button {
    padding: 12px 32px;
    background: linear-gradient(135deg, var(--color-teal) 0%, var(--color-teal-dark) 100%);
    color: var(--color-white);
    font-weight: 600;
    font-size: 1rem;
    border-radius: var(--radius-md);
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.25);
    transition: all 0.3s ease;
    max-width: fit-content;
    padding-left: 40px;
    padding-right: 40px;
}

.analyze-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 148, 136, 0.35);
}

.analyze-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.25);
}

/* Diagnostic Meters */
.diagnostic-meters {
    display: flex;
    flex-direction: column;
    gap: var(--gap-lg);
    margin-top: var(--gap-md);
    opacity: 0;
    transition: opacity 0.6s ease;
}

.diagnostic-meters.active {
    opacity: 1;
}

.meter-item {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
}

.meter-label {
    font-family: var(--font-metrics);
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--color-teal);
    min-width: 140px;
    text-align: right;
}

.meter-bar {
    flex: 1;
    height: 6px;
    background: var(--color-teal-light);
    border-radius: 3px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.meter-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-teal) 0%, var(--color-green-bright) 100%);
    border-radius: 3px;
    transition: width 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 0 2px 4px rgba(13, 148, 136, 0.3);
}

.meter-value {
    font-family: var(--font-metrics);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-teal);
    min-width: 45px;
    text-align: right;
}

/* ============================================================
   HEARTBEAT DIVIDER
   ============================================================ */

.heartbeat-divider {
    width: 100%;
    height: 60px;
    margin: var(--gap-xl) 0;
    fill: none;
}

/* ============================================================
   DIAGNOSIS SECTION
   ============================================================ */

.diagnosis-section {
    padding: var(--gap-xl) var(--gap-lg);
    background: var(--color-white);
    border-top: 1px solid var(--color-teal-lighter);
}

.diagnosis-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: var(--gap-xl);
}

.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    color: var(--color-teal);
    text-align: center;
    font-weight: 700;
    margin-bottom: var(--gap-md);
}

/* Scores Grid (Bento) */
.scores-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--gap-lg);
    margin-bottom: var(--gap-xl);
}

.score-item {
    display: flex;
    justify-content: center;
    align-items: center;
}

.score-gauge {
    position: relative;
    width: 120px;
    height: 120px;
}

.gauge-svg {
    width: 100%;
    height: 100%;
}

.gauge-track {
    fill: none;
    stroke: var(--color-teal-light);
    stroke-width: 8;
    stroke-linecap: round;
}

.gauge-fill {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
    transition: stroke-dasharray 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.gauge-fill[data-score="high"] {
    stroke: var(--color-green-bright);
}

.gauge-fill[data-score="medium"] {
    stroke: var(--color-amber);
}

.gauge-fill[data-score="low"] {
    stroke: var(--color-red);
}

.gauge-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gauge-value {
    font-family: var(--font-metrics);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--color-teal);
}

.gauge-label {
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--color-gray-dark);
    text-transform: uppercase;
    opacity: 0.7;
}

/* Assessment Box */
.assessment-box {
    background: var(--color-bg-light);
    padding: var(--gap-md);
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-teal);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.08);
}

.assessment-title {
    font-family: var(--font-metrics);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--color-teal);
    text-transform: uppercase;
    margin-bottom: var(--gap-sm);
}

.assessment-text {
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--color-gray-dark);
}

/* ============================================================
   PRESCRIPTION SECTION (RECOMMENDATIONS)
   ============================================================ */

.prescription-section {
    padding: var(--gap-xl) var(--gap-lg);
    background: linear-gradient(135deg, var(--color-teal-lighter) 0%, var(--color-bg-light) 100%);
}

.prescription-container {
    max-width: 1200px;
    margin: 0 auto;
}

.recommendations-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--gap-lg);
}

.recommendation-item {
    background: var(--color-white);
    padding: var(--gap-md);
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: var(--gap-md);
    box-shadow: 0 4px 12px rgba(13, 148, 136, 0.06);
    border: 1px solid var(--color-teal-light);
    transition: all 0.3s ease;
}

.recommendation-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(13, 148, 136, 0.12);
}

.recommendation-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    background: var(--color-teal);
    color: var(--color-white);
    font-family: var(--font-metrics);
    font-weight: 700;
    border-radius: 50%;
    flex-shrink: 0;
}

.recommendation-item p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--color-gray-dark);
}

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    padding: var(--gap-lg);
    background: var(--color-white);
    border-top: 1px solid var(--color-teal-light);
    text-align: center;
    color: var(--color-gray-dark);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.score-item {
    animation: slideUp 0.6s ease-out forwards;
}

.score-item:nth-child(2) {
    animation-delay: 0.1s;
}

.score-item:nth-child(3) {
    animation-delay: 0.2s;
}

.score-item:nth-child(4) {
    animation-delay: 0.3s;
}

/* ============================================================
   RESPONSIVE DESIGN
   ============================================================ */

@media (max-width: 768px) {
    :root {
        --gap-lg: 1.5rem;
        --gap-xl: 2rem;
    }

    .header {
        padding: var(--gap-lg) var(--gap-md);
    }

    .hero-section {
        padding: var(--gap-lg) var(--gap-md);
        min-height: auto;
    }

    .hero-container {
        max-width: 100%;
    }

    .input-area {
        min-height: 120px;
    }

    .diagnostic-meters {
        gap: var(--gap-md);
    }

    .meter-label {
        min-width: 100px;
        font-size: 0.85rem;
    }

    .scores-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--gap-md);
    }

    .section-title {
        font-size: 1.5rem;
    }

    .recommendations-list {
        grid-template-columns: 1fr;
    }

    .diagnosis-section,
    .prescription-section {
        padding: var(--gap-lg) var(--gap-md);
    }
}

@media (max-width: 480px) {
    :root {
        --gap-md: 1rem;
        --gap-lg: 1.25rem;
    }

    .logo {
        font-size: 1.75rem;
    }

    .hero-title {
        font-size: 1.25rem;
    }

    .input-area {
        min-height: 100px;
        padding: var(--gap-sm);
    }

    .analyze-button {
        padding: 10px 24px;
        font-size: 0.95rem;
    }

    .scores-grid {
        grid-template-columns: 1fr;
    }

    .meter-item {
        gap: var(--gap-sm);
    }

    .meter-label {
        min-width: 80px;
        font-size: 0.8rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .meter-item {
        flex-wrap: wrap;
    }
}
