/* CCTVLensCalculator.css - CCTV 鏡頭焦距計算器專用樣式 */
/*
 * 注意：全域類別 (.glass-card, .form-input, .btn-custom, .btn-sponsor 等)
 * 已在 layout.css 定義，不在此重複定義
 */

/* ========== 計算模式切換 ========== */
.mode-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.mode-btn {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid #667eea;
    border-radius: 12px;
    background: white;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.mode-btn:hover {
    background: rgba(102, 126, 234, 0.1);
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
}

/* ========== 輸入群組 ========== */
.input-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.input-row .input-group-custom {
    flex: 1;
}

.input-group-custom {
    margin-bottom: 15px;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.input-label i {
    color: #667eea;
    width: 18px;
    text-align: center;
}

.input-wrapper {
    position: relative;
}

.input-range {
    font-size: 0.75rem;
    color: #718096;
    margin-top: 4px;
}

/* ========== Tooltip ========== */
.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: #4a5568;
    cursor: help;
    position: relative;
}

.tooltip-icon .tooltip-text {
    visibility: hidden;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 400;
    white-space: nowrap;
    max-width: 250px;
    white-space: normal;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tooltip-icon:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ========== 結果卡片 ========== */
.result-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.result-card .card-title {
    color: white;
}

.result-card .card-title i {
    background: white;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.result-main {
    text-align: center;
    padding: 20px 0;
}

.result-label {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.result-value {
    font-family: 'Poppins', 'Noto Sans TC', sans-serif;
    font-size: 3rem;
    font-weight: 700;
}

.result-unit {
    font-size: 1.2rem;
    opacity: 0.8;
    margin-left: 5px;
}

.result-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    margin: 20px 0;
}

/* ========== 結果詳細項目 ========== */
.result-details {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px;
    margin-top: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.result-item-value {
    font-weight: 600;
    font-size: 1.1rem;
}

/* ========== PPM 狀態指示 ========== */
.ppm-status {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    border-radius: 12px;
    margin-top: 15px;
}

.ppm-status.excellent {
    background: rgba(72, 187, 120, 0.2);
    border: 1px solid rgba(72, 187, 120, 0.5);
}

.ppm-status.good {
    background: rgba(66, 153, 225, 0.2);
    border: 1px solid rgba(66, 153, 225, 0.5);
}

.ppm-status.fair {
    background: rgba(237, 137, 54, 0.2);
    border: 1px solid rgba(237, 137, 54, 0.5);
}

.ppm-status.poor {
    background: rgba(245, 101, 101, 0.2);
    border: 1px solid rgba(245, 101, 101, 0.5);
}

.ppm-icon {
    font-size: 1.5rem;
}

.ppm-text {
    flex: 1;
}

.ppm-title {
    font-weight: 600;
    font-size: 1rem;
}

.ppm-desc {
    font-size: 0.85rem;
    opacity: 0.9;
}

/* ========== 視野示意圖 ========== */
.fov-diagram {
    position: relative;
    width: 100%;
    height: 300px;
    background: linear-gradient(180deg, #e8f4fd 0%, #f7fafc 100%);
    border-radius: 16px;
    overflow: hidden;
    margin-top: 15px;
}

.fov-camera {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 30px;
    background: #2d3748;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fov-camera::before {
    content: '';
    width: 12px;
    height: 12px;
    background: #667eea;
    border-radius: 50%;
}

.fov-cone {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform-origin: bottom center;
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.3) 0%, rgba(102, 126, 234, 0.05) 100%);
    clip-path: polygon(50% 100%, 0% 0%, 100% 0%);
    border-top: 2px dashed #667eea;
}

.fov-target {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.9);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.fov-distance {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-size: 0.8rem;
    color: #667eea;
    font-weight: 600;
}

/* ========== 場景分類標題 ========== */
.scenario-category {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #667eea;
    margin: 20px 0 10px 0;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(102, 126, 234, 0.3);
}

.scenario-category:first-of-type {
    margin-top: 10px;
}

.scenario-category i {
    width: 18px;
    text-align: center;
}

/* ========== 場景建議卡片 ========== */
.scenario-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.scenario-card {
    padding: 15px;
    background: rgba(102, 126, 234, 0.05);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.scenario-card:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    transform: translateY(-2px);
}

.scenario-card.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
    border-color: #667eea;
}

.scenario-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #667eea;
}

.scenario-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #2d3748;
    margin-bottom: 4px;
}

.scenario-desc {
    font-size: 0.8rem;
    color: #718096;
}

/* ========== 焦距對照表 ========== */
.lens-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
}

.lens-table th,
.lens-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
}

.lens-table th {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    font-weight: 600;
    color: #2d3748;
}

.lens-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.lens-table .highlight {
    background: rgba(102, 126, 234, 0.15);
    font-weight: 600;
}

/* ========== 圖表容器 ========== */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
    margin-top: 15px;
}

/* ========== 響應式設計 ========== */
@media (max-width: 768px) {
    .input-row {
        flex-direction: column;
        gap: 0;
    }

    .mode-toggle {
        flex-direction: column;
    }

    .scenario-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .scenario-category {
        font-size: 0.85rem;
        margin: 15px 0 8px 0;
    }

    .result-value {
        font-size: 2.5rem;
    }

    .fov-diagram {
        height: 250px;
    }

    .lens-table {
        font-size: 0.8rem;
    }

    .lens-table th,
    .lens-table td {
        padding: 8px;
    }
}

/* ========== 動畫 ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.calculating {
    animation: pulse 1s ease infinite;
}
