/* ===================================
   Hair Growth Calculator - Custom Styles
   CalWhat Calculator Platform
   Created: 2025-11-03
   Version: 2.0
   =================================== */

/* ========================================
   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;
}


@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   4. 輸入欄位
======================================== */

.input-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    margin-bottom: 0;
}

.input-group label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-group label i:first-child {
    margin-right: 8px;
    color: #667eea;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #48bb78;
    border-radius: 12px;
    font-family: 'Roboto Mono', monospace;
    font-size: 1rem;
    background: #f0fff4;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

/* Add padding for number inputs to prevent overlap with unit labels */
input[type="number"].form-input {
    padding-right: 55px;
}

.form-input:focus {
    outline: none;
    border-color: #38a169;
    box-shadow: 0 0 0 4px rgba(72, 187, 120, 0.2);
    transform: translateY(-2px);
    background: #ffffff;
}

.form-input:hover {
    border-color: #38a169;
}

/* Select dropdown styling */
select.form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2348bb78' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.unit-label {
    position: absolute;
    right: 15px;
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
    color: #48bb78;
    pointer-events: none;
}

/* ========================================
   5. Tooltips
======================================== */

.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    font-size: 0.75rem;
    margin-left: 8px;
    cursor: help;
    position: relative;
}

/* ========================================
   6. 按鈕樣式
======================================== */

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button-group button {
    flex: 1;
    min-width: 140px;
}

.btn {
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
}


/* ========================================
   7. 結果顯示
======================================== */

.result-card {
    position: sticky;
    top: 20px;
}

.result-item {
    padding: 15px 0;
    border-bottom: 1px solid #e2e8f0;
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    display: flex;
    align-items: center;
    font-weight: 600;
    color: #4a5568;
    font-size: 1rem;
    margin-bottom: 8px;
}

.result-label i {
    margin-right: 10px;
    color: #667eea;
    font-size: 1.2rem;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.result-unit {
    font-size: 1rem;
    color: #718096;
    margin-top: 5px;
}

.result-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    font-family: 'Roboto Mono', monospace;
}

/* ========================================
   8. Warning Box
======================================== */

.warning-box {
    background: linear-gradient(135deg, #fef5e7 0%, #fdebd0 100%);
    border-left: 4px solid #f59e0b;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.warning-box i {
    color: #f59e0b;
    font-size: 1.2rem;
}

.warning-box span {
    color: #744210;
    font-weight: 500;
}

/* ========================================
   9. Milestones List
======================================== */

.milestones-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.milestone-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #48bb78;
    transition: all 0.3s ease;
}

.milestone-item:hover {
    background: #f0fff4;
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.milestone-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    margin-right: 15px;
    font-size: 0.9rem;
}

.milestone-info {
    flex: 1;
}

.milestone-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.95rem;
}

.milestone-time {
    font-size: 0.85rem;
    color: #718096;
    margin-top: 3px;
}

/* ========================================
   10. Chart Container
======================================== */

.chart-container {
    position: relative;
    height: 300px;
    margin: 20px 0;
}

/* FAQ Items */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.faq-item {
    padding: 20px;
    background: white;
    border-radius: 12px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.faq-item:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.1);
}

.faq-item h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-top: 0;
    margin-bottom: 10px;
}

.faq-item p {
    margin-bottom: 0;
}

/* ========================================
   12. Keyboard Shortcuts Info
======================================== */

.keyboard-shortcuts-info {
    text-align: center;
    margin-top: 30px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    font-size: 0.9rem;
    color: #718096;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.keyboard-shortcuts-info i {
    color: #667eea;
}

/* ========================================
   13. 響應式設計
======================================== */

/* 平板 (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .page-header h1 {
        font-size: 2.5rem;
    }

    .glass-card {
        padding: 18px;
    }

    .result-value {
        font-size: 2rem;
    }
}

/* 手機 (< 768px) */
@media (max-width: 767px) {
    body {
        padding: 10px 0;
    }

    .main-container {
        padding: 0 15px;
    }

    .page-header {
        margin-bottom: 25px;
    }

    .page-header h1 {
        font-size: 2rem;
    }

    .page-header .subtitle {
        font-size: 1rem;
    }

    .glass-card {
        padding: 15px;
        margin-bottom: 12px;
    }

    .glass-card h3 {
        font-size: 1.2rem;
    }

    .form-input {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    .button-group {
        flex-direction: column;
    }

    .button-group button {
        width: 100%;
        min-width: auto;
    }

    .result-value {
        font-size: 2rem;
    }

    .result-text {
        font-size: 1rem;
    }

    .chart-container {
        height: 250px;
    }

    .seo-section {
        padding: 25px 20px;
        margin-top: 30px;
    }

    .seo-section h2 {
        font-size: 1.6rem;
    }

    .seo-section h3 {
        font-size: 1.3rem;
    }

    .seo-section h4 {
        font-size: 1.1rem;
    }

    .keyboard-shortcuts-info {
        font-size: 0.85rem;
        padding: 12px;
    }
}

/* Extra small devices (< 576px) */
@media (max-width: 575px) {
    .page-header h1 {
        font-size: 1.6rem;
    }

    .result-value {
        font-size: 1.8rem;
    }

    .milestone-icon {
        width: 35px;
        height: 35px;
        font-size: 0.85rem;
    }

    .milestone-name {
        font-size: 0.85rem;
    }

    .milestone-time {
        font-size: 0.75rem;
    }
}

/* Print styles */
@media print {
    .button-group,
    .btn-sponsor,
    .keyboard-shortcuts-info {
        display: none;
    }

    .glass-card {
        box-shadow: none;
        border: 1px solid #e2e8f0;
        page-break-inside: avoid;
    }

    .page-header h1 {
        color: #2d3748;
        -webkit-text-fill-color: #2d3748;
    }

    .result-value {
        color: #667eea;
        -webkit-text-fill-color: #667eea;
    }

    .seo-section {
        page-break-inside: avoid;
    }
}
