/**
 * Provably Fair Panel Styles
 * Premium cryptographic verification UI for all casino games
 *
 * Design: Glass-morphism with Bitcoin orange accents
 * Feel: Technical but approachable - "under the hood" transparency
 */

/* JetBrains Mono for cryptographic values */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

/* ============================================
   PANEL CONTAINER
   ============================================ */

.fairness-panel {
    display: none;
    position: relative;
    background: linear-gradient(
        165deg,
        rgba(20, 20, 25, 0.97) 0%,
        rgba(12, 12, 15, 0.99) 100%
    );
    border: 1px solid rgba(247, 147, 26, 0.15);
    border-radius: 16px;
    padding: 0;
    margin-top: 1rem;
    overflow: hidden;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset,
        0 0 60px rgba(247, 147, 26, 0.03);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.fairness-panel.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* Subtle grid pattern overlay */
.fairness-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.01) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.01) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
    opacity: 0.5;
}

/* ============================================
   HEADER
   ============================================ */

.fairness-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: linear-gradient(
        180deg,
        rgba(247, 147, 26, 0.08) 0%,
        rgba(247, 147, 26, 0) 100%
    );
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
}

.fairness-panel-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.01em;
}

.fairness-panel-title svg {
    color: #f7931a;
    filter: drop-shadow(0 0 4px rgba(247, 147, 26, 0.4));
}

/* Animated lock glow */
.fairness-panel-title svg {
    animation: lockPulse 3s ease-in-out infinite;
}

@keyframes lockPulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(247, 147, 26, 0.4)); }
    50% { filter: drop-shadow(0 0 8px rgba(247, 147, 26, 0.6)); }
}

.fairness-close,
.fairness-panel-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fairness-close:hover,
.fairness-panel-close:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    transform: scale(1.05);
}

/* ============================================
   CONTENT AREA
   ============================================ */

.fairness-panel-content {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
}

/* ============================================
   INFO ROWS (Blackjack style)
   ============================================ */

.fairness-info-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fairness-info-item label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
}

.fairness-info-item code {
    display: block;
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', 'Monaco', monospace;
    font-size: 0.8125rem;
    color: #f7931a;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    word-break: break-all;
    line-height: 1.5;
    position: relative;
    overflow: hidden;
}

/* Subtle shimmer on hash */
.fairness-info-item code::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(247, 147, 26, 0.05),
        transparent
    );
    animation: hashShimmer 4s ease-in-out infinite;
}

@keyframes hashShimmer {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

.fairness-info-item span {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Revealed seed styling */
.fairness-info-item code.revealed-seed,
.fairness-value .revealed-seed {
    color: #4ade80;
}

.fairness-info-item code.revealed-seed {
    border-color: rgba(74, 222, 128, 0.2);
    background: rgba(74, 222, 128, 0.05);
}

/* Revealed seed container gets green border */
.fairness-value:has(.revealed-seed) {
    border-color: rgba(74, 222, 128, 0.2);
    background: rgba(74, 222, 128, 0.05);
}

.fairness-info-item .fairness-hint,
.fairness-row .fairness-hint,
.fairness-hint {
    display: block;
    font-size: 0.75rem;
    color: rgba(74, 222, 128, 0.7);
    margin-top: 0.25rem;
    font-style: italic;
}

/* ============================================
   CLIENT SEED INPUT
   ============================================ */

.fairness-info-item input[type="text"],
.fairness-client-seed input {
    flex: 1;
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.fairness-info-item input[type="text"]:focus,
.fairness-client-seed input:focus {
    outline: none;
    border-color: rgba(247, 147, 26, 0.5);
    box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.1);
    background: rgba(0, 0, 0, 0.6);
}

.fairness-info-item input[type="text"]::placeholder,
.fairness-client-seed input::placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

/* Input + Button row */
.fairness-info-item .input-row {
    display: flex;
    gap: 0.5rem;
}

.fairness-info-item .input-row input {
    flex: 1;
}

.fairness-info-item .btn-sm,
.fairness-client-seed button {
    padding: 0.75rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #0c0c0f;
    background: linear-gradient(180deg, #f7931a 0%, #e8850f 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.fairness-info-item .btn-sm:hover,
.fairness-client-seed button:hover {
    background: linear-gradient(180deg, #ffa42e 0%, #f7931a 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(247, 147, 26, 0.3);
}

.fairness-info-item .btn-sm:active,
.fairness-client-seed button:active {
    transform: translateY(0);
}

/* ============================================
   FAIRNESS ROWS (Slots style)
   ============================================ */

.fairness-row {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.fairness-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
}

.fairness-value {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    font-size: 0.8125rem;
    color: #f7931a;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    word-break: break-all;
}

.fairness-value span {
    flex: 1;
    color: #f7931a;
}

.fairness-value .copy-btn {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.fairness-value .copy-btn:hover {
    background: rgba(247, 147, 26, 0.15);
    border-color: rgba(247, 147, 26, 0.3);
    opacity: 1;
}

.fairness-value .copy-btn.copied {
    background: rgba(74, 222, 128, 0.15);
    border-color: rgba(74, 222, 128, 0.3);
}

/* Client seed input row */
.fairness-client-seed {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   NONCE DISPLAY
   ============================================ */

.fairness-nonce-row {
    display: flex;
    align-items: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 10px;
}

.fairness-nonce-value {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-right: 0.75rem;
    min-width: 3ch;
}

.fairness-nonce-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.3;
}

/* ============================================
   LAST SPIN INFO (Slots)
   ============================================ */

.last-spin-fairness {
    padding: 1rem;
    background: linear-gradient(
        135deg,
        rgba(247, 147, 26, 0.08) 0%,
        rgba(247, 147, 26, 0.02) 100%
    );
    border: 1px solid rgba(247, 147, 26, 0.12);
    border-radius: 10px;
    margin-bottom: 0.5rem;
}

.last-spin-fairness-title {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 0.5rem;
}

.last-spin-roll {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
}

.last-spin-roll-value {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 1.75rem;
    font-weight: 700;
    color: #f7931a;
    text-shadow: 0 0 20px rgba(247, 147, 26, 0.3);
}

.last-spin-roll-label {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   EXPLANATION TEXT
   ============================================ */

.fairness-explanation {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.55);
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 10px;
    border-left: 3px solid rgba(247, 147, 26, 0.4);
    margin: 0.5rem 0;
}

.fairness-explanation code {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 0.75rem;
    color: #f7931a;
    background: rgba(0, 0, 0, 0.3);
    padding: 0.125rem 0.375rem;
    border-radius: 4px;
}

/* ============================================
   ROTATE BUTTON
   ============================================ */

.btn-rotate-seed,
.fairness-rotate-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.04) 100%
    );
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.btn-rotate-seed::before,
.fairness-rotate-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(247, 147, 26, 0.15) 0%,
        rgba(247, 147, 26, 0.05) 100%
    );
    opacity: 0;
    transition: opacity 0.25s ease;
}

.btn-rotate-seed:hover,
.fairness-rotate-btn:hover {
    border-color: rgba(247, 147, 26, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.btn-rotate-seed:hover::before,
.fairness-rotate-btn:hover::before {
    opacity: 1;
}

.btn-rotate-seed:active,
.fairness-rotate-btn:active {
    transform: translateY(0);
}

.btn-rotate-seed:disabled,
.fairness-rotate-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* ============================================
   HELP LINK
   ============================================ */

.fairness-help-link {
    text-align: center;
    margin-top: 0.5rem;
}

.fairness-help-link a {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.fairness-help-link a:hover {
    color: #f7931a;
}

/* ============================================
   TOGGLE BUTTON (Compact footer style)
   ============================================ */

.fairness-toggle-compact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 0.625rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.fairness-toggle-compact:hover {
    background: rgba(247, 147, 26, 0.08);
    border-color: rgba(247, 147, 26, 0.2);
    color: #fff;
}

.fairness-toggle-compact .fairness-lock {
    display: flex;
    align-items: center;
}

.fairness-toggle-compact .fairness-lock svg {
    color: #f7931a;
}

.fairness-toggle-compact .fairness-label-text {
    font-weight: 500;
}

.fairness-toggle-compact .fairness-seed-preview {
    font-family: 'JetBrains Mono', 'SF Mono', monospace;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    padding: 0.125rem 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.fairness-toggle-compact .fairness-info-icon {
    font-size: 0.875rem;
    opacity: 0.5;
}

/* ============================================
   CLIENT SEED HELP (Collapsible)
   ============================================ */

.client-seed-help {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

.client-seed-help summary {
    cursor: pointer;
    color: rgba(247, 147, 26, 0.8);
    font-weight: 500;
    padding: 0.25rem 0;
    transition: color 0.2s ease;
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.client-seed-help summary::-webkit-details-marker {
    display: none;
}

.client-seed-help summary::before {
    content: '?';
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    background: rgba(247, 147, 26, 0.2);
    border-radius: 50%;
    font-size: 0.625rem;
    font-weight: 700;
    color: #f7931a;
}

.client-seed-help summary:hover {
    color: #f7931a;
}

.client-seed-help[open] summary::before {
    content: '−';
}

.client-seed-help p {
    margin: 0.5rem 0 0 0;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border-left: 2px solid rgba(247, 147, 26, 0.4);
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.6);
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */

@media (max-width: 640px) {
    .fairness-panel {
        border-radius: 12px;
        margin-top: 0.75rem;
    }

    .fairness-panel-header {
        padding: 0.875rem 1rem;
    }

    .fairness-panel-title {
        font-size: 0.875rem;
    }

    .fairness-panel-content {
        padding: 1rem;
        gap: 0.875rem;
    }

    .fairness-info-item code,
    .fairness-value {
        font-size: 0.75rem;
        padding: 0.625rem 0.875rem;
    }

    .fairness-info-item input[type="text"],
    .fairness-client-seed input {
        font-size: 0.8125rem;
        padding: 0.625rem 0.875rem;
    }

    .fairness-client-seed {
        flex-direction: column;
    }

    .fairness-client-seed button,
    .fairness-info-item .btn-sm {
        width: 100%;
        padding: 0.75rem;
    }

    .fairness-nonce-value {
        font-size: 1.25rem;
    }

    .last-spin-roll-value {
        font-size: 1.5rem;
    }

    .fairness-explanation {
        font-size: 0.75rem;
        padding: 0.875rem;
    }

    .btn-rotate-seed,
    .fairness-rotate-btn {
        padding: 0.75rem 1rem;
        font-size: 0.8125rem;
    }

    .fairness-toggle-compact {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }

    .fairness-toggle-compact .fairness-seed-preview {
        width: 100%;
        text-align: center;
        margin-top: 0.25rem;
    }
}
