/**
 * O型環溝槽計算器 (O-Ring Gland Calculator) - 專屬樣式
 *
 * ⚠️ 注意：本檔案只定義計算器特有的樣式
 * 全域類別 (.glass-card, .form-input, .btn-custom 等) 已在 layout.css 定義
 * 請勿在此重新定義全域類別
 */

/* 主要結果顯示 */
.gland-result-main {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 16px;
    margin-bottom: 20px;
}

.gland-result-main .main-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.2;
}

.gland-result-main .main-label {
    font-size: 0.95rem;
    color: #718096;
    margin-top: 5px;
}

.gland-result-main .sub-values {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.gland-result-main .sub-item {
    text-align: center;
}

.gland-result-main .sub-item .value {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
    font-family: 'Roboto Mono', monospace;
}

.gland-result-main .sub-item .label {
    font-size: 0.8rem;
    color: #718096;
}

/* 結果項目 */
.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.result-item:last-child {
    border-bottom: none;
}

.result-label {
    font-size: 0.95rem;
    color: #4a5568;
}

.result-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    font-family: 'Roboto Mono', monospace;
}

/* 設計檢核狀態 */
.validation-list {
    margin-top: 10px;
}

.validation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    background: #f8fafc;
}

.validation-item:last-child {
    margin-bottom: 0;
}

.validation-item .check-label {
    font-size: 0.9rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 8px;
}

.validation-item .check-status {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 12px;
}

.validation-item.status-ok {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1) 0%, rgba(56, 161, 105, 0.1) 100%);
}

.validation-item.status-ok .check-status {
    background: rgba(72, 187, 120, 0.2);
    color: #276749;
}

.validation-item.status-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
}

.validation-item.status-warning .check-status {
    background: rgba(245, 158, 11, 0.2);
    color: #92400e;
}

.validation-item.status-error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
}

.validation-item.status-error .check-status {
    background: rgba(239, 68, 68, 0.2);
    color: #991b1b;
}

/* O-Ring 規格詳情 */
.oring-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 15px;
}

.oring-detail-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.oring-detail-item .label {
    font-size: 0.75rem;
    color: #718096;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.oring-detail-item .value {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
    font-family: 'Roboto Mono', monospace;
}

/* 溝槽截面圖容器 */
.diagram-container {
    background: #f8fafc;
    border-radius: 12px;
    padding: 20px;
    margin-top: 15px;
    position: relative;
}

.diagram-canvas-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

#glandDiagram {
    max-width: 100%;
    height: auto;
}

/* 圖表容器 */
.chart-container {
    height: 250px;
    margin-top: 15px;
}

/* 輸入群組標籤 */
.input-group-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    margin-bottom: 6px;
}

/* 輸入行 - label 和 field 同一行 */
.input-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.input-row-label {
    flex: 0 0 140px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #4a5568;
    text-align: right;
}

.input-row-field {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.input-row-field .form-input {
    flex: 1;
}

/* 壓縮率欄位 - 滑桿和數字輸入並排 */
.compression-field {
    display: flex;
    align-items: center;
    gap: 10px;
}

.compression-field .form-range {
    flex: 1;
}

.compression-field .compression-input {
    width: 70px;
    flex: 0 0 70px;
}

/* O-Ring 推薦顯示 */
.oring-recommendation {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 16px;
    margin-bottom: 20px;
}

.oring-spec-name {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
}

.oring-dimensions {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.dim-item {
    text-align: center;
}

.dim-label {
    display: block;
    font-size: 0.75rem;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.dim-value {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    font-family: 'Roboto Mono', monospace;
}

/* 溝槽尺寸顯示 */
.groove-dimensions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.groove-item {
    background: #f8fafc;
    border-radius: 10px;
    padding: 12px;
    text-align: center;
}

.groove-label {
    display: block;
    font-size: 0.8rem;
    color: #718096;
    margin-bottom: 4px;
}

.groove-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    font-family: 'Roboto Mono', monospace;
}

/* 子標題 */
.section-subtitle {
    font-size: 1rem;
    font-weight: 600;
    color: #4a5568;
    margin: 20px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-subtitle i {
    color: #667eea;
}

/* 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: #718096;
    cursor: help;
    margin-left: 5px;
}

/* 自訂輸入區塊 */
.custom-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* 建議範圍提示 */
.range-hint {
    font-size: 0.8rem;
    color: #718096;
    margin-top: 5px;
    font-style: italic;
}

/* 壓力警告提示 */
.pressure-warning {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.1) 100%);
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #92400e;
}

.pressure-warning::before {
    content: "\f071";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: 8px;
}

/* 公式顯示區 */
.formula-display {
    background: #f8fafc;
    border-radius: 12px;
    padding: 16px;
    font-family: 'Roboto Mono', monospace;
    font-size: 0.9rem;
    color: #4a5568;
    border: 1px solid #e2e8f0;
    overflow-x: auto;
    margin-top: 10px;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .gland-result-main .main-value {
        font-size: 2rem;
    }

    .gland-result-main .sub-values {
        flex-direction: column;
        gap: 15px;
    }

    .custom-input-group {
        grid-template-columns: 1fr;
    }

    .oring-details {
        grid-template-columns: 1fr 1fr;
    }

    .result-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .result-value {
        align-self: flex-end;
    }

    .validation-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .validation-item .check-status {
        align-self: flex-end;
    }

    /* 輸入行響應式 */
    .input-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .input-row-label {
        flex: none;
        text-align: left;
    }

    /* 溝槽尺寸改為2列 */
    .groove-dimensions {
        grid-template-columns: repeat(2, 1fr);
    }

    /* O-Ring 尺寸改為縱向 */
    .oring-dimensions {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 576px) {
    .gland-result-main .main-value {
        font-size: 1.75rem;
    }

    .gland-result-main .sub-item .value {
        font-size: 1.25rem;
    }

    .oring-details {
        grid-template-columns: 1fr;
    }

    .chart-container {
        height: 200px;
    }

    .oring-spec-name {
        font-size: 1.5rem;
    }

    /* 溝槽尺寸改為1列 */
    .groove-dimensions {
        grid-template-columns: 1fr;
    }
}
