/**
 * YESORNOWHEEL.NET - Components Stylesheet
 * Buttons, Cards, Inputs, Modals, Result Showcase, and Toast Notifications.
 */

/* Standard Button System */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    line-height: 1.2;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-cyan));
    color: #ffffff;
    box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-primary:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 6px 16px var(--accent-glow);
}

.btn-outline {
    background: var(--surface);
    border-color: var(--border-subtle);
    color: var(--text-primary);
}
.btn-outline:hover {
    background: var(--surface-hover);
    border-color: var(--border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover {
    background: var(--surface);
    color: var(--text-primary);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: #ffffff;
}
.btn-danger:hover {
    filter: brightness(1.1);
}

.btn-danger-outline {
    background: transparent;
    border-color: rgba(239, 68, 68, 0.4);
    color: #ef4444;
}
.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: #ef4444;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
}

.btn-xs {
    padding: 5px 10px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

/* Form Controls */
.form-input,
.form-select,
.form-number {
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.92rem;
    transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-number:focus {
    border-color: var(--accent-primary);
    outline: none;
}

.form-range {
    width: 100%;
    accent-color: var(--accent-primary);
    cursor: pointer;
}

/* Question Input Panel */
.question-panel {
    background: var(--surface-glass);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    backdrop-filter: blur(8px);
    box-shadow: var(--shadow-sm);
}

.question-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}
.optional-tag {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
}

.question-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.question-input {
    width: 100%;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1.05rem;
    padding: 12px 70px 12px 16px;
    transition: all var(--transition-fast);
}

.question-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.btn-clear-input {
    position: absolute;
    right: 48px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}
.btn-clear-input:hover {
    color: var(--text-primary);
}

.char-counter {
    position: absolute;
    right: 14px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    pointer-events: none;
}

/* Result Showcase Card */
.result-showcase {
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    padding: 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    animation: resultPopIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes resultPopIn {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.result-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    padding-bottom: 10px;
}

.result-eyebrow {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.result-time {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.result-main {
    text-align: center;
    margin-bottom: 24px;
}

.result-badge-container {
    display: flex;
    justify-content: center;
    margin-bottom: 12px;
}

.result-badge {
    display: inline-block;
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 900;
    padding: 10px 48px;
    border-radius: var(--radius-lg);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal);
}

.badge-yes {
    background: linear-gradient(135deg, #10b981, #059669);
    color: #ffffff;
    box-shadow: 0 6px 20px var(--yes-glow);
}

.badge-no {
    background: linear-gradient(135deg, #f43f5e, #e11d48);
    color: #ffffff;
    box-shadow: 0 6px 20px var(--no-glow);
}

.badge-maybe {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #ffffff;
    box-shadow: 0 6px 20px var(--maybe-glow);
}

.result-question-display {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    max-width: 480px;
    margin: 0 auto;
    word-break: break-word;
}

.result-series-summary {
    font-size: 0.9rem;
    color: var(--accent-cyan);
    font-weight: 600;
    margin-top: 8px;
}

/* Result Action Buttons Grid */
.result-actions-grid {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
}

.action-btn {
    flex: 1 1 calc(33% - 10px);
    min-width: 120px;
}

/* Mystery Pending Curtain */
.mystery-pending-box {
    text-align: center;
    padding: 32px 16px;
}
.mystery-badge {
    display: inline-block;
    background: var(--accent-primary);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.85rem;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    margin-bottom: 12px;
}
.mystery-sub {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}
.btn-reveal {
    font-size: 1.15rem;
    padding: 14px 28px;
    border-radius: var(--radius-full);
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: 380px;
    width: calc(100% - 48px);
}

.toast {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 12px 18px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: auto;
    animation: toastSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.toast-success {
    border-left: 4px solid var(--yes-color);
}
.toast-error {
    border-left: 4px solid var(--no-color);
}
.toast-info {
    border-left: 4px solid var(--accent-primary);
}

/* Accessible Modal System */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: modalFadeIn 0.2s ease-out;
}

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

.modal-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-lg);
    animation: modalCardIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.modal-card-sm {
    max-width: 400px;
}

@keyframes modalCardIn {
    from { transform: scale(0.94) translateY(10px); }
    to { transform: scale(1) translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text-primary);
}

.btn-close-modal {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    border-radius: var(--radius-sm);
}
.btn-close-modal:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle);
}

/* Share Modal Card Preview */
.share-preview-card {
    background: var(--surface);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    margin: 16px 0 20px;
}

.share-preview-badge {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 900;
    margin-bottom: 8px;
}
.share-preview-badge.yes { color: var(--yes-color); }
.share-preview-badge.no { color: var(--no-color); }
.share-preview-badge.maybe { color: var(--maybe-color); }

.share-preview-question {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.share-preview-footer {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.share-link-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.share-privacy-note {
    font-size: 0.82rem;
    color: var(--text-muted);
}
