/* --- 판결해줘! AI - v3: Premium & Minimalist --- */

:root {
    --background: #fbfbfb;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --accent: #102a43;
    --border-color: #e2e8f0;
    --white: #ffffff;
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Inter', sans-serif;
    --border-radius: 4px;
    --max-width: 500px;
}

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

body {
    background-color: var(--background);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    letter-spacing: 0.2px;
}

/* v3.2 animation utility */
body.is-animating { overflow: hidden; }

.hidden { display: none !important; }

#app-container { max-width: var(--max-width); margin: 4rem auto; padding: 0 1rem; }
header { text-align: center; margin-bottom: 3rem; }
.main-title { font-family: var(--font-serif); font-size: 2.75rem; font-weight: 700; color: var(--text-primary); letter-spacing: 1px; }
.section-title { font-size: 1.25rem; font-weight: 500; margin-bottom: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.75rem; }
.input-section, .content-section { background-color: var(--white); border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 2rem; margin-bottom: 2rem; }

#issue-input { width: 100%; height: 100px; background: var(--background); border: 1px solid var(--border-color); border-radius: var(--border-radius); color: var(--text-primary); font-family: var(--font-sans); font-size: 1rem; resize: none; margin-bottom: 1rem; padding: 1rem; transition: border-color 0.2s; }
#issue-input:focus { outline: none; border-color: var(--accent); }

.main-button { width: 100%; padding: 0.9rem; font-size: 1rem; font-weight: 500; color: var(--white); background-color: var(--accent); border: none; border-radius: var(--border-radius); cursor: pointer; transition: background-color 0.2s; }
.main-button:hover, .main-button:disabled { background-color: #000; cursor: default; opacity: 0.8; }

.hot-topic-buttons { display: flex; flex-direction: column; gap: 0.75rem; }
.hot-topic-button, .vote-buttons button { width: 100%; padding: 0.75rem; background-color: transparent; border: 1px solid var(--border-color); border-radius: var(--border-radius); color: var(--text-secondary); text-align: left; cursor: pointer; transition: all 0.2s; }
.hot-topic-button:hover, .vote-buttons button:hover { border-color: var(--accent); color: var(--accent); background-color: #f7fafc; }

.vote-buttons { display: flex; gap: 1rem; }
.vote-separator { display: none; }
#vote-count { font-size: 0.9rem; color: var(--text-secondary); margin-top: 1rem; text-align: center; }
.ad-placeholder { text-align: center; color: #cbd5e0; font-size: 0.75rem; margin: 2rem 0; letter-spacing: 1px; }
#real-time-concerns .concern-card { background-color: #f7fafc; border: 1px solid var(--border-color); border-radius: var(--border-radius); padding: 1rem; margin-bottom: 0.5rem; font-size: 0.9rem; }

/* --- Modal --- */
#result-modal-container { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(26, 32, 44, 0.8); backdrop-filter: blur(5px); padding: 1rem; opacity: 0; transition: opacity 0.5s ease-in-out; }
#result-modal-container.visible { opacity: 1; }

.modal-content { width: 100%; max-width: var(--max-width); background: var(--white); border-radius: var(--border-radius); padding: 2.5rem; position: relative; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25); }
#close-modal { position: absolute; top: 1rem; right: 1rem; background: none; border: none; font-size: 1.5rem; color: var(--text-secondary); cursor: pointer; }
.modal-title { font-family: var(--font-serif); text-align: center; font-size: 1.75rem; margin-bottom: 2rem; }
#card-container { min-height: 150px; position: relative; overflow: hidden; margin-bottom: 1.5rem; }
.judgment-card { position: absolute; width: 100%; height: 100%; opacity: 0; visibility: hidden; transition: opacity 0.5s ease; }
.judgment-card.active { opacity: 1; visibility: visible; }
.judgment-card .card-title { font-weight: 500; font-size: 1.1rem; margin-bottom: 0.5rem; color: var(--accent); }
.judgment-card p { color: var(--text-secondary); line-height: 1.7; }

.typewriter-text { overflow: hidden; border-right: .15em solid var(--accent); white-space: pre-wrap; animation: typing 1.5s steps(30, end), blink-caret .75s step-end infinite; }

.card-navigation { display: flex; justify-content: space-between; margin-bottom: 1.5rem; }
.card-navigation button { background: none; border: none; color: var(--accent); font-size: 0.9rem; font-weight: 500; cursor: pointer; }

.share-buttons { text-align: center; border-top: 1px solid var(--border-color); padding-top: 1.5rem; display: flex; justify-content: center; gap: 1rem; }
.share-buttons button { background: none; border: none; font-size: 1.25rem; color: var(--text-secondary); cursor: pointer; transition: color 0.2s; }
.share-buttons button:hover { color: var(--accent); }

/* --- v3.2 REFINED ANIMATION STYLES --- */

#animation-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(251, 251, 251, 0.8);
    backdrop-filter: blur(5px);
}

.gavel-wrapper { position: relative; display: flex; align-items: center; justify-content: center; }

#gavel {
    font-size: 5rem; /* Emoji size */
    color: #4a5568; /* Dark Gray */
    transform-origin: bottom center;
    filter: drop-shadow(5px 5px 8px rgba(0,0,0,0.15));
    /* Set initial state for animation */
    transform: rotate(0deg);
}

#ripple-effect {
    position: absolute;
    bottom: -10px;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(113, 128, 150, 0.5); /* Gray ripple */
    border-radius: 50%;
    transform: scale(0);
    opacity: 0;
}

.loading-text { margin-top: 2rem; font-size: 1rem; color: var(--text-secondary); }

/* JS-controlled animation classes */
body.shake-vertical { animation: screen-shake-vertical 0.1s linear; }

#gavel.is-hitting { animation: gavel-hit 0.4s cubic-bezier(0.4, 0, 0.2, 1); }

#ripple-effect.is-rippling { animation: ripple 0.5s ease-out; }


/* --- REFINED KEYFRAMES for v3.2 --- */

@keyframes gavel-hit {
    0% { transform: rotate(0deg); }
    40% { transform: rotate(-20deg); } /* Anticipation: Wind up */
    100% { transform: rotate(5deg); } /* Impact: Hit and slightly bounce */
}

@keyframes ripple {
    0% { transform: scale(0); opacity: 1; }
    100% { transform: scale(10); opacity: 0; }
}

@keyframes screen-shake-vertical {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

@keyframes typing { from { width: 0 } to { width: 100% } }

@keyframes blink-caret { from, to { border-color: transparent } 50% { border-color: var(--accent); } }
