/* I Ching Divination - Styles */

:root {
    --primary-color: #2c3e50;
    --secondary-color: #34495e;
    --accent-color: #c0392b;
    --gold-color: #d4af37;
    --background-color: #f8f6f3;
    --card-background: #ffffff;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --yang-color: #2c3e50;
    --yin-color: #2c3e50;
    --changing-color: #c0392b;
}

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

body {
    font-family: 'Noto Sans TC', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 3rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
}

header .subtitle {
    font-size: 1.25rem;
    color: var(--text-light);
    font-weight: 300;
}

/* Question Section */
.question-section {
    margin-bottom: 2rem;
}

.question-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.question-section textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
}

.question-section textarea:focus {
    outline: none;
    border-color: var(--gold-color);
}

/* Divination Button */
.divination-section {
    text-align: center;
    margin-bottom: 3rem;
}

.cast-button {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 1.5rem 3rem;
    font-size: 1.5rem;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 auto;
}

.cast-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(44, 62, 80, 0.3);
}

.cast-button:active {
    transform: translateY(0);
}

.cast-button .button-text {
    font-weight: 700;
    display: block;
}

.cast-button .button-subtext {
    font-size: 0.875rem;
    opacity: 0.8;
    font-weight: 400;
}

.cast-button.casting {
    animation: pulse 0.5s ease infinite;
}

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

/* Result Section */
.result-section {
    margin-bottom: 2rem;
}

.hidden {
    display: none !important;
}

.hexagram-display {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
}

.hexagram-card {
    background: var(--card-background);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    flex: 1;
    min-width: 280px;
    max-width: 360px;
    text-align: center;
}

.hexagram-card h2 {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.hexagram-card.relating h2 {
    color: var(--accent-color);
}

/* Hexagram Visual */
.hexagram-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.hexagram-line {
    width: 120px;
    height: 12px;
    display: flex;
    justify-content: center;
    gap: 12px;
}

.hexagram-line.yang {
    background-color: var(--yang-color);
    border-radius: 2px;
}

.hexagram-line.yin {
    background-color: transparent;
}

.hexagram-line.yin::before,
.hexagram-line.yin::after {
    content: '';
    width: 50px;
    height: 12px;
    background-color: var(--yin-color);
    border-radius: 2px;
}

.hexagram-line.changing {
    position: relative;
}

.hexagram-line.changing::after {
    content: '✕';
    position: absolute;
    right: -25px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--changing-color);
    font-weight: bold;
}

.hexagram-line.yin.changing::after {
    right: -25px;
}

/* Hexagram Info */
.hexagram-info {
    margin-bottom: 1rem;
}

.hexagram-number {
    display: inline-block;
    background-color: var(--gold-color);
    color: white;
    width: 36px;
    height: 36px;
    line-height: 36px;
    border-radius: 50%;
    font-weight: 700;
    margin-right: 0.5rem;
}

.hexagram-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.hexagram-judgment {
    font-size: 1rem;
    color: var(--secondary-color);
    line-height: 1.8;
    text-align: left;
    padding: 1rem;
    background-color: #f8f8f8;
    border-radius: 8px;
    border-left: 4px solid var(--gold-color);
}

/* Changing Lines Info */
.changing-lines-info {
    margin-top: 2rem;
    padding: 1rem;
    background-color: var(--card-background);
    border-radius: 8px;
    text-align: center;
}

.changing-lines-info .line-info {
    margin: 0.5rem 0;
    font-size: 0.95rem;
}

/* Coins Section */
.coins-section {
    background: var(--card-background);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.coins-section h3 {
    text-align: center;
    margin-bottom: 1rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.coin-tosses {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.coin-toss {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background-color: #f8f8f8;
    border-radius: 6px;
}

.coin-toss .line-num {
    font-weight: 600;
    color: var(--text-light);
    min-width: 60px;
}

.coin-toss .coins {
    display: flex;
    gap: 0.25rem;
}

.coin-toss .coin {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    font-size: 0.75rem;
    font-weight: 600;
}

.coin-toss .coin.heads {
    background-color: var(--gold-color);
    color: white;
}

.coin-toss .coin.tails {
    background-color: #bdc3c7;
    color: white;
}

.coin-toss .sum {
    font-weight: 600;
    color: var(--primary-color);
}

.coin-toss .line-type {
    margin-left: auto;
    font-size: 0.875rem;
    color: var(--text-light);
}

.coin-toss .line-type.changing {
    color: var(--changing-color);
    font-weight: 600;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
    color: var(--text-light);
    font-size: 0.875rem;
}

footer .copyright {
    margin-top: 0.5rem;
    opacity: 0.7;
}

/* Responsive */
@media (max-width: 600px) {
    header h1 {
        font-size: 2rem;
    }

    .cast-button {
        padding: 1.25rem 2rem;
        font-size: 1.25rem;
    }

    .hexagram-card {
        min-width: 100%;
    }

    .hexagram-line {
        width: 100px;
    }

    .hexagram-line.yin::before,
    .hexagram-line.yin::after {
        width: 40px;
    }
}
