/**
 * Frontend Styles
 * Styles for the quiz interface
 * 
 * @package Soul_Questions_Quiz
 */

/* === ISOLATION CHAMBER === */
#st-iso-root {
    all: initial;
    font-family: "Songti TC", "Noto Serif TC", serif;
    box-sizing: border-box;
    display: block;
    width: 100%;
    height: 650px;
    background: radial-gradient(circle at center, #232526 0%, #000000 100%);
    color: #e0e0e0;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    text-align: center;
    -webkit-font-smoothing: antialiased;
    transition: all 0.5s ease-in-out;
}

#st-iso-root * {
    box-sizing: border-box;
    font-family: inherit;
}

/* === FULLSCREEN MODE === */
#st-iso-root.st-fullscreen-active {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2147483647;
    border-radius: 0;
    margin: 0;
}

/* === TYPOGRAPHY === */
#st-iso-root h1 {
    font-weight: 300;
    letter-spacing: 8px;
    margin: 0 0 20px 0;
    color: #d4af37;
    font-size: 36px;
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}

#st-iso-root p {
    line-height: 1.8;
    color: #a0a0a0;
    margin-bottom: 25px;
    font-size: 16px;
    font-weight: 300;
    letter-spacing: 1px;
}

/* === FULLSCREEN TOGGLE BUTTON === */
#st-fs-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.3s;
    z-index: 100;
    padding: 5px;
}

#st-fs-toggle:hover {
    opacity: 1;
}

#st-fs-toggle svg {
    width: 24px;
    height: 24px;
    fill: #d4af37;
}

/* === BUTTONS === */
#st-iso-root .st-btn-group {
    display: flex;
    justify-content: center;
    margin-top: 30px;
    min-height: 50px;
}

#st-iso-root button.st-btn {
    background: rgba(212, 175, 55, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: #d4af37;
    padding: 12px 35px;
    cursor: pointer;
    border-radius: 2px;
    font-size: 15px;
    letter-spacing: 2px;
    transition: all 0.5s ease;
    margin-top: 15px;
    position: relative;
    overflow: hidden;
}

#st-iso-root button.st-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: #d4af37;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.2);
    color: #fff;
}

/* === UTILITY CLASSES === */
#st-iso-root .st-hidden {
    display: none !important;
    opacity: 0;
}

#st-iso-root .st-fade-in {
    animation: stFadeIn 1.5s forwards;
}

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

/* === CENTER WRAPPER === */
.st-center-wrapper {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    width: 100%;
    z-index: 2;
}

/* === RULES BOX === */
.st-rules-box {
    text-align: left;
    background: rgba(0, 0, 0, 0.3);
    padding: 25px;
    border-radius: 4px;
    margin-bottom: 25px;
    width: 85%;
    max-width: 380px;
    border-left: 1px solid #d4af37;
}

.st-rules-box p {
    font-size: 14px;
    margin-bottom: 15px;
    color: #ccc;
}

/* === CARD CONTAINER === */
#st-iso-root .st-card-container {
    perspective: 1200px;
    width: 320px;
    height: 460px;
    margin: 0 auto;
    cursor: pointer;
    position: relative;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

#st-iso-root .st-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
}

#st-iso-root .st-card.st-flipped {
    transform: rotateY(180deg);
}

#st-iso-root .st-card-face {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 35px;
    flex-direction: column;
}

/* === CARD BACK === */
#st-iso-root .st-card-back {
    background-color: #101010;
    background-image: linear-gradient(rgba(212, 175, 55, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 175, 55, 0.15) 1px, transparent 1px);
    background-size: 30px 30px;
    border: 1px solid #d4af37;
    outline: 4px solid rgba(212, 175, 55, 0.1);
    outline-offset: -10px;
    color: #d4af37;
}

#st-iso-root .st-card-back::before {
    content: "✦";
    font-size: 60px;
    color: #d4af37;
    opacity: 0.8;
    filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
}

/* ========================================
   CARD FRONT - CLEAN FABRIC TEXTURE
   Linen/Canvas inspired design
   ======================================== */
#st-iso-root .st-card-front {
    /* Base color - natural linen */
    background-color: #f5f3ed;
    
    /* Fabric weave texture using subtle noise pattern */
    background-image: 
        /* Fine linen weave texture */
        url("data:image/svg+xml,%3Csvg width='200' height='200' viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3CfeColorMatrix values='0 0 0 0 0, 0 0 0 0 0, 0 0 0 0 0, 0 0 0 0.03 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E"),
        /* Vertical thread lines */
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 1px,
            rgba(139, 125, 107, 0.03) 1px,
            rgba(139, 125, 107, 0.03) 2px
        ),
        /* Horizontal thread lines */
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 1px,
            rgba(139, 125, 107, 0.03) 1px,
            rgba(139, 125, 107, 0.03) 2px
        );
    
    background-size: 200px 200px, 3px 3px, 3px 3px;
    background-position: 0 0, 0 0, 0 0;
    
    color: #2d2d2d;
    transform: rotateY(180deg);
    text-align: center;
    
    /* Clean elegant border */
    border: 1px solid #d4c4a8;
    
    /* Subtle fabric depth */
    box-shadow: 
        inset 0 0 40px rgba(139, 125, 107, 0.08),
        inset 0 1px 2px rgba(255, 255, 255, 0.5),
        0 20px 50px rgba(0, 0, 0, 0.8);
    
    /* Inner frame */
    outline: 1px solid rgba(212, 196, 168, 0.3);
    outline-offset: -15px;
}

/* Subtle paper/fabric edge effect */
#st-iso-root .st-card-front::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    background: radial-gradient(
        ellipse at top left,
        rgba(255, 255, 255, 0.3) 0%,
        transparent 50%
    ),
    radial-gradient(
        ellipse at bottom right,
        rgba(139, 125, 107, 0.1) 0%,
        transparent 50%
    );
    pointer-events: none;
}

#st-iso-root .st-question-id {
    position: absolute;
    top: 25px;
    font-size: 11px;
    color: #9a8970;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 400;
}

#st-iso-root .st-question-text {
    font-size: 22px;
    font-weight: 500;
    line-height: 1.6;
    margin: 0;
    color: #2d2d2d;
    text-shadow: 0 1px 1px rgba(255, 255, 255, 0.5);
}

#st-iso-root .st-guide-text {
    min-height: 25px;
    font-style: italic;
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
    opacity: 0.7;
}

#st-iso-root .st-progress-indicator {
    margin-top: 20px;
    font-size: 11px;
    color: #555;
    letter-spacing: 1px;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    #st-iso-root {
        height: 600px;
        padding: 10px;
    }

    #st-iso-root.st-fullscreen-active {
        height: 100vh;
    }

    #st-iso-root .st-card-container {
        width: 280px;
        height: 400px;
    }

    #st-iso-root h1 {
        font-size: 28px;
    }

    #st-iso-root .st-question-text {
        font-size: 20px;
    }
}