/* --- 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; }
