/* --- CALIBRATION MODAL (LUXURY) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(8px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #ffffff;
    padding: 40px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    width: 90%;
    max-width: 500px;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    text-align: center;
    position: relative;
    color: var(--text-primary);
}

.modal-title {
    font-family: var(--font-serif);
    color: var(--text-primary);
    margin-top: 0;
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.modal-desc {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* VISUAL REFERENCE */
.card-comparison-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 260px;
    background: #f9f9f9;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.credit-card-visual {
    width: 323px;
    /* Default ~96PPI width */
    height: 204px;
    background: #111;
    /* Matte Black Card */
    /* Subtle texture */
    background-image: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border-radius: 12px;
    position: relative;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    transition:
        width 0.1s,
        height 0.1s;
    will-change: width, height;
    border: 1px solid #333;
}

.card-chip {
    width: 45px;
    height: 35px;
    background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
    /* Gold Chip */
    border-radius: 6px;
    position: absolute;
    top: 40px;
    left: 30px;
}

.card-text {
    position: absolute;
    bottom: 25px;
    left: 30px;
    color: #ffffff;
    font-family: monospace;
    font-size: 0.8rem;
    letter-spacing: 2px;
}

/* SLIDER */
.slider-container {
    margin-bottom: 30px;
    padding: 0 20px;
}

/* BUTTONS */
.action-btn {
    background: var(--text-primary);
    color: #fff;
    border: none;
    padding: 16px 30px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    width: 100%;
}

.action-btn:hover {
    background: #2a2a45;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* --- CALIBRATION METHOD SELECTOR --- */
.calibration-method-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.method-toggle-btn {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.method-toggle-btn:hover {
    border-color: var(--text-primary);
}

.method-toggle-btn.active {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
}

/* Coin, etc - reusing same logic but cleaner styles */
.coin-visual {
    width: 91.5px;
    height: 91.5px;
    background: #f5f5f5;
    border-radius: 50%;
    position: relative;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #cccccc;
}

.coin-text {
    color: #555;
    font-weight: bold;
}

.calibration-mode {
    display: none;
}

.calibration-mode.active {
    display: block;
}

/* Coin Selector Options */
.coin-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
}

.coin-option label {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.85rem;
    cursor: pointer;
}

.coin-option input[type='radio']:checked + label {
    color: var(--text-primary);
    font-weight: 600;
}

/* -- Modal close button -- */
.modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 10;
    padding: 0;
}
.modal-close-btn:hover {
    background: rgba(220, 38, 38, 0.08);
    border-color: rgba(220, 38, 38, 0.3);
    color: #dc2626;
}

/* -- Modal skip button -- */
.modal-skip-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    margin-top: 10px;
    text-decoration: underline;
    display: block;
    width: 100%;
    text-align: center;
    padding: 6px;
    font-family: var(--font-sans);
    transition: color 0.2s;
    opacity: 0.75;
}
.modal-skip-btn:hover {
    color: var(--text-primary);
    opacity: 1;
}

/* -- Light mode: auto-fixed dark elements -- */
[data-theme='light'] .credit-card-visual {
    background: #ffffff;
    color: #0f172a;
    border-color: rgba(0, 0, 0, 0.12);
}

/* -- Dark mode: calibration modal -- */
[data-theme='dark'] .modal-content {
    background: #17151e;
    border-color: rgba(212, 175, 55, 0.15);
    color: #f0ead6;
}
[data-theme='dark'] .modal-title {
    color: #f0ead6;
}
[data-theme='dark'] .modal-desc {
    color: #b8a88a;
}
[data-theme='dark'] .card-comparison-container {
    background: rgba(255, 255, 255, 0.03);
    border-color: rgba(212, 175, 55, 0.1);
}
[data-theme='dark'] .action-btn {
    background: #d4af37;
    color: #0d0d18;
}
[data-theme='dark'] .action-btn:hover {
    background: #c09b20;
}
[data-theme='dark'] .method-toggle-btn {
    border-color: rgba(212, 175, 55, 0.2);
    color: #b8a88a;
}
[data-theme='dark'] .method-toggle-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
}
[data-theme='dark'] .method-toggle-btn.active {
    background: #d4af37;
    color: #0d0d18;
    border-color: #d4af37;
}
[data-theme='dark'] .coin-option {
    background: rgba(255, 255, 255, 0.04);
}
[data-theme='dark'] .coin-option label {
    color: #b8a88a;
}
[data-theme='dark'] .coin-option input[type='radio']:checked + label {
    color: #f0ead6;
}
[data-theme='dark'] .modal-close-btn {
    border-color: rgba(255, 255, 255, 0.12);
    color: #b8a88a;
}
[data-theme='dark'] .modal-close-btn:hover {
    background: rgba(220, 38, 38, 0.12);
    border-color: rgba(220, 38, 38, 0.35);
    color: #fca5a5;
}
[data-theme='dark'] .modal-skip-btn {
    color: #b8a88a;
}
[data-theme='dark'] .modal-skip-btn:hover {
    color: #f0ead6;
}
