/* CalWhat Calculator Platform - Subscription Calculator Styles */
/* 訂閱服務總成本計算器專用樣式 */

/* ========================================
   1. 全域樣式
======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    min-height: 100vh;
    padding: 15px 0;
}

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}


/* ========================================
   4. Subscription Checklist Styles
======================================== */

.subscription-category {
    margin-bottom: 25px;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.2);
}

.category-icon {
    font-size: 1.4rem;
}

.subscription-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.subscription-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.subscription-item:hover {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.subscription-item.checked {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
}

.subscription-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
}

.subscription-label {
    flex: 1;
    cursor: pointer;
    user-select: none;
}

.subscription-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
    margin-bottom: 3px;
}

.subscription-price {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: #667eea;
    font-weight: 600;
}

/* Billing Toggle (Monthly/Annual) */
.subscription-price-wrapper {
    margin-top: 6px;
}

.billing-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.billing-option {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.billing-option:hover {
    background: rgba(102, 126, 234, 0.05);
}

.billing-option input[type="radio"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.billing-option span {
    font-family: 'Roboto Mono', monospace;
    color: #4a5568;
    font-weight: 500;
}

.billing-option input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.savings-badge {
    background: linear-gradient(135deg, #48bb78 0%, #38b2ac 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-left: 4px;
}

.popular-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    font-size: 0.7rem;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

/* ========================================
   Custom Subscription Form
======================================== */

.custom-subscription-form {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr auto;
    gap: 10px;
    align-items: end;
    margin-top: 15px;
}

.form-group-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group-inline label {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
}

.btn-add-custom {
    background: linear-gradient(135deg, #48bb78 0%, #38b2ac 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.3);
}

.btn-add-custom:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(72, 187, 120, 0.4);
}

.btn-add-custom:active {
    transform: translateY(0);
}

/* ========================================
   Custom Subscriptions List
======================================== */

.custom-subscription-list {
    margin-top: 20px;
}

.custom-subscription-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.05) 0%, rgba(56, 178, 172, 0.05) 100%);
    border: 2px solid #48bb78;
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.custom-subscription-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.2);
}

.custom-subscription-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.custom-subscription-name {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 3px;
    font-size: 0.95rem;
}

.custom-subscription-price {
    font-family: 'Roboto Mono', monospace;
    font-size: 0.85rem;
    color: #48bb78;
    font-weight: 600;
}

.btn-remove-custom {
    background: white;
    border: 2px solid #ef4444;
    color: #ef4444;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-remove-custom:hover {
    background: #ef4444;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* ========================================
   Results Section
======================================== */

.result-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.result-box {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    transition: all 0.3s ease;
}

.result-box:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.2);
}

.result-box-label {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 10px;
    font-weight: 500;
}

.result-box-value {
    font-family: 'Poppins', 'Noto Sans TC', sans-serif;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 8px 0;
}

/* ========================================
   Chart Container
======================================== */

.chart-container {
    position: relative;
    height: 350px;
    margin-top: 20px;
}

/* ========================================
   Savings Recommendations
======================================== */

.savings-card {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.08) 0%, rgba(56, 178, 172, 0.08) 100%);
    border: 2px solid #48bb78;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.savings-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.2);
}

.savings-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #22543d;
    margin-bottom: 10px;
}

.savings-card-header i {
    color: #48bb78;
    font-size: 1.2rem;
}

.savings-card-body {
    font-size: 0.95rem;
    color: #2f855a;
    line-height: 1.5;
}

.savings-amount {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    color: #22543d;
}

/* ========================================
   Comparison Section
======================================== */

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.comparison-item {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.comparison-item:hover {
    border-color: #667eea;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.comparison-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.comparison-text {
    font-size: 1.05rem;
    font-weight: 600;
    color: #2d3748;
    line-height: 1.4;
}

.comparison-text span {
    font-family: 'Roboto Mono', monospace;
    color: #667eea;
    font-size: 1.3rem;
}

/* ========================================
   Action Buttons
======================================== */

.button-group,
.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.btn-action {
    flex: 1;
    min-width: 140px;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary-action {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-secondary-action {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary-action:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-sponsor {
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    width: 100%;
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
}

.btn-sponsor:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

/* ========================================
   Keyboard Shortcuts Hint
======================================== */

.shortcuts-hint {
    background: rgba(102, 126, 234, 0.08);
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 15px;
    font-size: 0.85rem;
    color: #4a5568;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.shortcut-key {
    display: inline-block;
    background: white;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    padding: 3px 8px;
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    font-size: 0.8rem;
    color: #667eea;
}

/* ========================================
   Empty State
======================================== */

.empty-state {
    text-align: center;
    padding: 50px 20px;
    color: #718096;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.4;
    color: #cbd5e0;
}

.empty-state-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 10px;
}

.empty-state-hint {
    font-size: 0.95rem;
    color: #718096;
}

/* ========================================
   Usage Rate Indicators
======================================== */

.usage-indicator {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 8px;
}

.usage-active {
    background: rgba(72, 187, 120, 0.15);
    color: #22543d;
}

.usage-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: #742a2a;
}

/* ========================================
   Responsive Design
======================================== */

@media (max-width: 991px) {
    .subscription-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .custom-subscription-form {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .result-breakdown {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }

    .result-box-value {
        font-size: 1.75rem;
    }

    .chart-container {
        height: 300px;
    }

    .seo-section {
        padding: 30px;
    }

    .seo-section h2 {
        font-size: 1.6rem;
    }

    .seo-section h3 {
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .subscription-grid {
        grid-template-columns: 1fr;
    }

    .category-header {
        font-size: 1rem;
    }

    .result-breakdown {
        grid-template-columns: 1fr;
    }

    .result-box-value {
        font-size: 1.6rem;
    }

    .button-group,
    .action-buttons {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
        min-width: auto;
    }

    .shortcuts-hint {
        flex-direction: column;
        gap: 10px;
    }

    .chart-container {
        height: 280px;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .seo-section {
        padding: 20px;
        margin-top: 30px;
    }

    .seo-section h2 {
        font-size: 1.4rem;
    }

    .seo-section h3 {
        font-size: 1.2rem;
        margin-top: 20px;
    }

    .seo-section h4 {
        font-size: 1.05rem;
    }

    .seo-section p,
    .seo-section li {
        font-size: 0.95rem;
    }
}

@media (max-width: 576px) {
    .result-box-value {
        font-size: 1.4rem;
    }

    .chart-container {
        height: 250px;
    }

    .comparison-icon {
        font-size: 2rem;
    }

    .comparison-text {
        font-size: 0.95rem;
    }
}


/* ========================================
   Print Styles
======================================== */

@media print {
    .btn-action,
    .btn-sponsor,
    .shortcuts-hint,
    .btn-add-custom,
    .btn-remove-custom {
        display: none !important;
    }

    .glass-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #e2e8f0;
    }

    .subscription-item {
        break-inside: avoid;
    }
}

/* ========================================
   Animations
======================================== */

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.subscription-item,
.result-box,
.savings-card {
    animation: fadeIn 0.4s ease;
}
