/* GachaExpectedValue.css
 * 抽卡期望值計算器 - Calculator-specific styles ONLY
 * DO NOT redefine global CSS classes (.form-input, .btn-custom, .glass-card, etc.)
 * See GLOBAL_CSS_CLASSES.md for reference
 */

/* ================================
   Input Layout Customization
   ================================ */
.gacha-input-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

@media (max-width: 575px) {
    .gacha-input-row {
        grid-template-columns: 1fr;
    }
}

.gacha-input-group {
    margin-bottom: 15px;
}

.gacha-input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.gacha-input-label i {
    color: #667eea;
}

.gacha-tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #e2e8f0;
    border-radius: 50%;
    font-size: 0.7rem;
    color: #718096;
    cursor: help;
}

/* ================================
   Mode Tabs
   ================================ */
.gacha-mode-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.gacha-mode-tab {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.gacha-mode-tab:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.gacha-mode-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: transparent;
    color: white;
}

.gacha-mode-tab .tab-title {
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 4px;
}

.gacha-mode-tab .tab-desc {
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ================================
   Game Preset Buttons
   ================================ */
.gacha-preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.gacha-preset-btn {
    padding: 12px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.gacha-preset-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateY(-2px);
}

.gacha-preset-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.gacha-preset-btn .preset-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #2d3748;
    margin-bottom: 4px;
}

.gacha-preset-btn .preset-info {
    font-size: 0.75rem;
    color: #718096;
}

/* ================================
   Result Display
   ================================ */
.gacha-result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 25px;
    color: white;
    margin-bottom: 20px;
}

.gacha-result-main {
    text-align: center;
    margin-bottom: 20px;
}

.gacha-result-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.gacha-result-value {
    font-size: 3rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    line-height: 1.2;
}

.gacha-result-value.small {
    font-size: 2rem;
}

.gacha-result-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin: 15px 0;
}

.gacha-result-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.gacha-result-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.gacha-result-item-label {
    font-size: 0.8rem;
    opacity: 0.9;
    margin-bottom: 4px;
}

.gacha-result-item-value {
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
}

/* ================================
   Cost Level Indicators
   ================================ */
.gacha-cost-cheap {
    color: #48bb78;
}

.gacha-cost-moderate {
    color: #f6e05e;
}

.gacha-cost-expensive {
    color: #f59e0b;
}

.gacha-cost-very-expensive {
    color: #f56565;
}

/* For dark background (result card) */
.gacha-result-card .gacha-cost-cheap {
    color: #9ae6b4;
}

.gacha-result-card .gacha-cost-moderate {
    color: #faf089;
}

.gacha-result-card .gacha-cost-expensive {
    color: #fbd38d;
}

.gacha-result-card .gacha-cost-very-expensive {
    color: #feb2b2;
}

/* ================================
   Probability Distribution
   ================================ */
.gacha-probability-list {
    margin-top: 15px;
}

.gacha-probability-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 8px;
}

.gacha-probability-item:last-child {
    margin-bottom: 0;
}

.gacha-probability-label {
    font-size: 0.9rem;
}

.gacha-probability-value {
    font-weight: 600;
    font-family: 'Roboto Mono', monospace;
}

/* ================================
   Probability Progress Bar
   ================================ */
.gacha-probability-bar {
    background: #e2e8f0;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
    margin: 15px 0;
}

.gacha-probability-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78 0%, #38a169 100%);
    border-radius: 10px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    font-weight: 600;
}

/* ================================
   Chart Container
   ================================ */
.gacha-chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

@media (max-width: 575px) {
    .gacha-chart-container {
        height: 250px;
    }
}

/* ================================
   Simulation Section
   ================================ */
.gacha-simulation-container {
    text-align: center;
}

.gacha-simulation-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.gacha-simulation-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.4);
}

.gacha-simulation-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.gacha-simulation-result {
    min-height: 60px;
    margin: 20px 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gacha-simulation-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    border-radius: 10px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    opacity: 0;
    transform: scale(0.5) rotateY(180deg);
    transition: all 0.3s ease;
}

.gacha-simulation-card.revealed {
    opacity: 1;
    transform: scale(1) rotateY(0);
}

.gacha-simulation-card.gold {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4a 100%);
    border-color: #f59e0b;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

/* Gold star animation */
.gacha-star-gold {
    color: #ffd700;
    text-shadow: 0 0 10px #ffd700, 0 0 20px #ffa500;
    animation: goldPulse 1s ease-in-out infinite;
}

@keyframes goldPulse {
    0%, 100% {
        transform: scale(1);
        text-shadow: 0 0 10px #ffd700, 0 0 20px #ffa500;
    }
    50% {
        transform: scale(1.1);
        text-shadow: 0 0 20px #ffd700, 0 0 40px #ffa500;
    }
}

.gacha-star-normal {
    color: #a0aec0;
}

.gacha-simulation-message {
    margin-top: 15px;
    padding: 15px;
    background: #f0fff4;
    border: 1px solid #48bb78;
    border-radius: 10px;
    color: #276749;
    font-weight: 600;
}

.gacha-simulation-message.no-hit {
    background: #fff5f5;
    border-color: #f56565;
    color: #c53030;
}

/* ================================
   Simulation Stats
   ================================ */
.gacha-simulation-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.gacha-stat-item {
    text-align: center;
}

.gacha-stat-label {
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 5px;
}

.gacha-stat-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
    font-family: 'Roboto Mono', monospace;
}

/* ================================
   Toggle Switch for 50/50
   ================================ */
.gacha-toggle-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.gacha-toggle {
    position: relative;
    width: 50px;
    height: 26px;
}

.gacha-toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.gacha-toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e0;
    transition: 0.3s;
    border-radius: 26px;
}

.gacha-toggle-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.gacha-toggle input:checked + .gacha-toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.gacha-toggle input:checked + .gacha-toggle-slider:before {
    transform: translateX(24px);
}

.gacha-toggle-label {
    font-weight: 500;
    color: #4a5568;
}

/* ================================
   Warning Alerts
   ================================ */
.gacha-warning {
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: 15px;
    font-size: 0.9rem;
}

.gacha-warning-high-cost {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
}

.gacha-warning-gambling {
    background: #e0e7ff;
    border: 1px solid #667eea;
    color: #3730a3;
}

/* ================================
   Reverse Calculation
   ================================ */
.gacha-reverse-result {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-radius: 10px;
    text-align: center;
}

.gacha-reverse-probability {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    font-family: 'Roboto Mono', monospace;
}

/* ================================
   Disclaimer Banner
   ================================ */
.gacha-disclaimer {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #856404;
}

.gacha-disclaimer i {
    margin-right: 8px;
}

/* ================================
   Responsive Adjustments
   ================================ */
@media (max-width: 767px) {
    .gacha-result-value {
        font-size: 2.5rem;
    }

    .gacha-result-value.small {
        font-size: 1.8rem;
    }

    .gacha-result-details {
        grid-template-columns: 1fr;
    }

    .gacha-simulation-stats {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .gacha-stat-value {
        font-size: 1.1rem;
    }

    .gacha-mode-tabs {
        flex-direction: column;
    }

    .gacha-mode-tab {
        min-width: auto;
    }
}
