/* HorizontalTankVolumeCalculator.css
 * 臥式儲槽容量計算器 - 專用樣式
 * 注意：不可重新定義全域類別 (.glass-card, .form-input, .btn-custom 等)
 * 參考：GLOBAL_CSS_CLASSES.md
 */

/* ========================================
   輸入區樣式
   ======================================== */

.input-row {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.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;
}

.input-wrapper {
    position: relative;
}

.input-range {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: 4px;
}

.tooltip-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: bold;
    cursor: help;
    margin-left: 5px;
}

.tooltip-icon .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 130%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: normal;
    white-space: nowrap;
    z-index: 100;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.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-main {
    text-align: center;
    padding: 20px 0;
}

.result-label {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.result-value {
    font-size: 2.8rem;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.result-divider {
    border-color: rgba(255, 255, 255, 0.3);
    margin: 15px 0;
}

.result-details {
    margin-top: 20px;
}

.result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.result-item:last-child {
    border-bottom: none;
}

.result-item-label {
    opacity: 0.9;
}

.result-item-value {
    font-family: 'Roboto Mono', monospace;
    font-weight: 600;
}

/* ========================================
   槽體截面視覺化 (SVG)
   ======================================== */

.tank-visual-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 20px;
}

.tank-svg {
    width: 100%;
    height: auto;
}

.tank-outline {
    fill: none;
    stroke: #4a5568;
    stroke-width: 3;
}

.tank-liquid {
    fill: url(#liquidGradient);
    transition: d 0.3s ease;
}

.tank-air {
    fill: rgba(226, 232, 240, 0.5);
}

.tank-dimension-line {
    stroke: #a0aec0;
    stroke-width: 1;
    stroke-dasharray: 4, 4;
}

.tank-dimension-text {
    fill: #4a5568;
    font-size: 12px;
    font-family: 'Roboto Mono', monospace;
}

.tank-label {
    fill: #2d3748;
    font-size: 14px;
    font-weight: 600;
}

.tank-fill-text {
    fill: white;
    font-size: 24px;
    font-weight: 700;
    font-family: 'Roboto Mono', monospace;
    text-anchor: middle;
    dominant-baseline: middle;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ========================================
   量尺刻度表樣式
   ======================================== */

.dipstick-chart-container {
    max-height: 400px;
    overflow-y: auto;
    margin-top: 15px;
}

.dipstick-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.dipstick-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 8px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dipstick-table td {
    padding: 8px;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    font-family: 'Roboto Mono', monospace;
}

.dipstick-table tr:nth-child(even) {
    background-color: #f7fafc;
}

.dipstick-table tr:hover {
    background-color: #edf2f7;
}

.dipstick-table tr.highlight-row {
    background-color: rgba(102, 126, 234, 0.15);
    font-weight: 600;
}

/* 50% 標記列 */
.dipstick-table tr.half-mark {
    background-color: rgba(72, 187, 120, 0.15);
    border-top: 2px solid #48bb78;
    border-bottom: 2px solid #48bb78;
}

/* ========================================
   反向計算區塊
   ======================================== */

.reverse-calc-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
}

.reverse-calc-title {
    font-weight: 600;
    color: #667eea;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.reverse-calc-result {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    text-align: center;
}

.reverse-calc-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
    font-family: 'Roboto Mono', monospace;
}

/* ========================================
   單位切換
   ======================================== */

.unit-toggle {
    display: flex;
    background: #e2e8f0;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 15px;
}

.unit-toggle-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #4a5568;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.unit-toggle-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.unit-toggle-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

/* ========================================
   槽形切換
   ======================================== */

.shape-toggle {
    display: flex;
    background: #e2e8f0;
    border-radius: 8px;
    padding: 4px;
}

.shape-toggle-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #4a5568;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.shape-toggle-btn i {
    font-size: 0.9rem;
}

.shape-toggle-btn.active {
    background: white;
    color: #667eea;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.shape-toggle-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.5);
}

/* ========================================
   間隔選擇器
   ======================================== */

.interval-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.interval-btn {
    padding: 6px 12px;
    border: 2px solid #e2e8f0;
    background: white;
    color: #4a5568;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.interval-btn.active {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.interval-btn:hover:not(.active) {
    border-color: #667eea;
    color: #667eea;
}

/* ========================================
   圖表容器
   ======================================== */

.chart-container {
    position: relative;
    height: 300px;
    margin-top: 15px;
}

/* ========================================
   頭類型圖示
   ======================================== */

.head-type-icons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.head-type-icon {
    width: 60px;
    height: 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.head-type-icon.active {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

.head-type-icon svg {
    width: 40px;
    height: 30px;
}

/* ========================================
   響應式設計
   ======================================== */

@media (max-width: 768px) {
    .input-row {
        flex-direction: column;
        gap: 0;
    }

    .result-value {
        font-size: 2.2rem;
    }

    .tank-visual-container {
        padding: 10px;
    }

    .dipstick-table {
        font-size: 0.8rem;
    }

    .dipstick-table th,
    .dipstick-table td {
        padding: 6px 4px;
    }

    .unit-toggle-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .interval-selector {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .result-value {
        font-size: 1.8rem;
    }

    .reverse-calc-value {
        font-size: 1.4rem;
    }
}

/* ========================================
   列印樣式
   ======================================== */

@media print {
    .tank-visual-container {
        max-width: 300px;
    }

    .dipstick-chart-container {
        max-height: none;
        overflow: visible;
    }

    .dipstick-table th {
        background: #667eea !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
