/* Yes/No Chart Pro - Frontend Styles */

.yesno-pro-chart {
    --yesno-primary: #4F46E5;
    --yesno-secondary: #7C3AED;
    --yesno-bg: #F8FAFC;
    --yesno-text: #1E293B;
    --yesno-radius: 16px;
    --yesno-speed: 400ms;
    max-width: 640px;
    margin: 2rem auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

/* Progress Bar */
.yesno-pro-progress {
    background: #E2E8F0;
    border-radius: 100px;
    height: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    position: relative;
}
.yesno-pro-progress-bar {
    background: linear-gradient(135deg, var(--yesno-primary), var(--yesno-secondary));
    height: 100%;
    border-radius: 100px;
    transition: width var(--yesno-speed) cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-width: 40px;
}
.yesno-pro-progress-text {
    position: absolute;
    right: 0;
    top: -22px;
    font-size: 12px;
    color: var(--yesno-text);
    opacity: 0.6;
    white-space: nowrap;
}

/* Question Card */
.yesno-pro-card {
    background: var(--yesno-bg);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: var(--yesno-radius);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
    min-height: 160px;
}
.yesno-pro-question-wrap {
    transition: opacity var(--yesno-speed) ease, transform var(--yesno-speed) ease;
}
.yesno-pro-question-wrap.slide-out-left {
    opacity: 0;
    transform: translateX(-60px);
}
.yesno-pro-question-wrap.slide-in-right {
    opacity: 0;
    transform: translateX(60px);
}
.yesno-pro-question-wrap.slide-out-right {
    opacity: 0;
    transform: translateX(60px);
}
.yesno-pro-question-wrap.slide-in-left {
    opacity: 0;
    transform: translateX(-60px);
}

/* Badge (Q number) */
.yesno-pro-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--yesno-primary), var(--yesno-secondary));
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    padding: 0.4em 1em;
    border-radius: calc(var(--yesno-radius) * 0.6);
    margin-bottom: 1.2rem;
    letter-spacing: 0.02em;
}

/* Question Text */
.yesno-pro-question-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--yesno-text);
    line-height: 1.7;
}
.yesno-pro-question-text p {
    margin: 0;
}

/* Choices */
.yesno-pro-choices {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 1.25rem;
}

/* Button Styles */
.yesno-pro-choice-btn {
    display: block;
    width: 100%;
    padding: 1em 1.5em;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--yesno-radius);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-align: center;
    line-height: 1.4;
}
.yesno-pro-choice-btn:focus-visible {
    outline: 3px solid var(--yesno-primary);
    outline-offset: 2px;
}

/* Gradient style */
[data-button-style="gradient"] .yesno-pro-choice-btn {
    background: linear-gradient(135deg, var(--yesno-primary), var(--yesno-secondary));
    color: #fff;
    box-shadow: 0 4px 14px -3px rgba(79, 70, 229, 0.4);
}
[data-button-style="gradient"] .yesno-pro-choice-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(79, 70, 229, 0.5);
}
[data-button-style="gradient"] .yesno-pro-choice-btn:active {
    transform: translateY(0);
}

/* Solid style */
[data-button-style="solid"] .yesno-pro-choice-btn {
    background: var(--yesno-primary);
    color: #fff;
    box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.15);
}
[data-button-style="solid"] .yesno-pro-choice-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Outline style */
[data-button-style="outline"] .yesno-pro-choice-btn {
    background: transparent;
    color: var(--yesno-primary);
    border: 2px solid var(--yesno-primary);
}
[data-button-style="outline"] .yesno-pro-choice-btn:hover {
    background: var(--yesno-primary);
    color: #fff;
}

/* Ripple effect */
.yesno-pro-choice-btn .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: scale(0);
    animation: yesno-ripple 0.6s linear;
    pointer-events: none;
}
@keyframes yesno-ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Back Button */
.yesno-pro-back-wrap {
    margin-top: 0.75rem;
    text-align: center;
}
.yesno-pro-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0.5em 1.2em;
    font-size: 0.9rem;
    color: var(--yesno-text);
    opacity: 0.5;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}
.yesno-pro-back-btn:hover {
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.04);
}
.yesno-pro-back-btn svg {
    flex-shrink: 0;
}

/* Result Display */
.yesno-pro-result {
    margin-top: 1.5rem;
}
.yesno-pro-result-card {
    background: var(--yesno-bg);
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: var(--yesno-radius);
    padding: 2rem 1.75rem;
    text-align: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    animation: yesno-result-appear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes yesno-result-appear {
    0% { opacity: 0; transform: scale(0.95) translateY(16px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.yesno-pro-result-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--yesno-primary), var(--yesno-secondary));
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.35em 1.2em;
    border-radius: 100px;
    margin-bottom: 1rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.yesno-pro-result-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--yesno-text);
    line-height: 1.8;
    margin-bottom: 0.25rem;
}
.yesno-pro-result-text p {
    margin: 0;
}

/* ===== Result Blocks ===== */
.yesno-pro-result-blocks {
    margin-top: 1.25rem;
    text-align: left;
}
.yesno-rb-heading {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--yesno-text);
    margin: 0.4rem 0 0.2rem;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid var(--yesno-primary);
    display: inline-block;
}
.yesno-rb-heading:first-child {
    margin-top: 0;
}
.yesno-rb-text {
    font-size: 0.9rem;
    color: var(--yesno-text);
    line-height: 1.85;
    margin-bottom: 0.2rem;
    opacity: 0.8;
}
.yesno-rb-text p {
    margin: 0 0 0.25em;
}
.yesno-rb-button-wrap {
    text-align: center;
    margin: 0.6rem 0;
}
.yesno-rb-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75em 2em;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    background: var(--yesno-primary);
    border: none;
    border-radius: var(--yesno-radius);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 14px -3px rgba(0, 0, 0, 0.25);
    line-height: 1.4;
    width: 100%;
    max-width: 400px;
    box-sizing: border-box;
}
.yesno-rb-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -4px rgba(0, 0, 0, 0.3);
    color: #fff;
    text-decoration: none;
    opacity: 0.92;
}
.yesno-rb-button:visited {
    color: #fff;
}
.yesno-rb-image-wrap {
    margin: 1rem 0;
    text-align: center;
}
.yesno-rb-image {
    max-width: 100%;
    height: auto;
    border-radius: calc(var(--yesno-radius) * 0.5);
    box-shadow: 0 2px 8px -2px rgba(0, 0, 0, 0.1);
}
.yesno-rb-divider {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin: 1.25rem 0;
}

/* ===== Table Block (SWELL-like) ===== */
.yesno-rb-table-wrap {
    margin: 0.6rem 0;
}
.yesno-rb-table-wrap.yesno-rb-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(0,0,0,0.15) transparent;
}
.yesno-rb-table-wrap.yesno-rb-table-scroll::-webkit-scrollbar {
    height: 6px;
}
.yesno-rb-table-wrap.yesno-rb-table-scroll::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.03);
    border-radius: 3px;
}
.yesno-rb-table-wrap.yesno-rb-table-scroll::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.12);
    border-radius: 3px;
}
.yesno-rb-table-wrap.yesno-rb-table-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.2);
}
.yesno-rb-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    line-height: 1.6;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.08);
}
.yesno-rb-table th,
.yesno-rb-table td {
    padding: 0.7em 1em;
    text-align: left;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    word-break: break-word;
}
.yesno-rb-table .yesno-rb-table-header th {
    background: var(--yesno-primary);
    color: #fff;
    font-weight: 600;
    font-size: 0.85rem;
    border-bottom: none;
    white-space: nowrap;
}
.yesno-rb-table .yesno-rb-table-stripe {
    background: rgba(0, 0, 0, 0.015);
}
.yesno-rb-table tr:last-child td {
    border-bottom: none;
}

/* Restart button */
.yesno-pro-restart-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 1.5rem;
    padding: 0.55em 1.6em;
    font-size: 0.85rem;
    font-weight: 600;
    background: transparent;
    color: var(--yesno-text);
    opacity: 0.4;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s;
}
.yesno-pro-restart-btn:hover {
    opacity: 0.7;
    background: rgba(0, 0, 0, 0.03);
}

/* Loading */
.yesno-pro-loading {
    text-align: center;
    padding: 2rem;
    color: var(--yesno-text);
    opacity: 0.5;
}
.yesno-pro-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--yesno-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: yesno-spin 0.8s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes yesno-spin {
    to { transform: rotate(360deg); }
}

/* Error */
.yesno-error {
    color: #DC2626;
    font-size: 0.9rem;
    padding: 1rem;
    background: #FEF2F2;
    border-radius: 8px;
    border: 1px solid #FECACA;
}

/* Mobile */
@media (max-width: 480px) {
    .yesno-pro-chart {
        margin: 1rem auto;
    }
    .yesno-pro-card {
        padding: 2rem 1.25rem;
    }
    .yesno-pro-question-text {
        font-size: 1.1rem;
    }
    .yesno-pro-choice-btn {
        font-size: 1rem;
        padding: 0.9em 1.2em;
    }
    .yesno-pro-result-card {
        padding: 1.5rem 1.25rem;
    }
    .yesno-rb-button {
        max-width: 100%;
        font-size: 0.9rem;
    }
}
