/* CalWhat Calculator Platform - UnitConverter Specific Styles */
/* This file contains calculator-specific styles */


 

    /* 分類標籤 */
    .category-tabs {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-bottom: 20px;
    }

    .category-tab {
        padding: 10px 20px;
        border-radius: 12px;
        background: white;
        border: 2px solid #e2e8f0;
        cursor: pointer;
        transition: all 0.3s ease;
        font-weight: 500;
        font-size: 0.9rem;
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .category-tab:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
        }

        .category-tab.active {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            border-color: #667eea;
        }

            .category-tab.active i {
                color: white;
            }

        .category-tab i {
            font-size: 1.1rem;
        }

    /* 輸入區域 */
    .input-section {
        background: #f7fafc;
        padding: 20px;
        border-radius: 12px;
        margin-bottom: 20px;
    }

    .input-group-flex {
        display: flex;
        gap: 15px;
        align-items: center;
        margin-bottom: 15px;
    }

    .form-input {
        flex: 1;
        padding: 15px;
        border: 2px solid #48bb78;
        border-radius: 12px;
        font-size: 2rem;
        font-family: 'Roboto Mono', monospace;
        transition: all 0.3s ease;
        background: white;
        text-align: center;
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
    }

        .form-input:focus {
            outline: none;
            border-color: #38a169;
            box-shadow: 0 0 0 4px rgba(72, 187, 120, 0.2);
            transform: translateY(-2px);
        }

    .unit-select {
        padding: 15px;
        border: 2px solid #667eea;
        border-radius: 12px;
        font-size: 1rem;
        font-family: 'Roboto Mono', monospace;
        background: white;
        cursor: pointer;
        min-width: 150px;
        transition: all 0.3s ease;
    }

        .unit-select:focus {
            outline: none;
            border-color: #764ba2;
            box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.2);
        }

    /* 自動完成單位輸入 */
    .unit-autocomplete-wrapper {
        position: relative;
        margin-top: 10px;
    }

    .unit-autocomplete-input {
        width: 100%;
        padding: 12px 40px 12px 15px;
        border: 2px solid #cbd5e0;
        border-radius: 12px;
        font-size: 0.95rem;
        font-family: 'Roboto Mono', monospace;
        background: white;
        transition: all 0.3s ease;
    }

        .unit-autocomplete-input:focus {
            outline: none;
            border-color: #667eea;
            box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
        }

        .unit-autocomplete-input::placeholder {
            color: #a0aec0;
            font-size: 0.9rem;
        }

    .unit-autocomplete-icon {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        color: #667eea;
        font-size: 1rem;
        pointer-events: none;
    }

    .unit-autocomplete-suggestions {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        border: 2px solid #667eea;
        border-top: none;
        border-radius: 0 0 12px 12px;
        max-height: 250px;
        overflow-y: auto;
        z-index: 1000;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        margin-top: -10px;
        display: none;
    }

        .unit-autocomplete-suggestions.show {
            display: block;
        }

    .suggestion-item {
        padding: 12px 15px;
        cursor: pointer;
        transition: all 0.2s ease;
        border-bottom: 1px solid #e2e8f0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

        .suggestion-item:last-child {
            border-bottom: none;
        }

        .suggestion-item:hover {
            background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
        }

        .suggestion-item.active {
            background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
        }

    .suggestion-unit-code {
        font-family: 'Roboto Mono', monospace;
        font-weight: 600;
        color: #667eea;
        font-size: 0.95rem;
    }

    .suggestion-unit-name {
        color: #4a5568;
        font-size: 0.85rem;
        margin-left: 10px;
    }

    .suggestion-category-badge {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 3px 10px;
        border-radius: 12px;
        font-size: 0.75rem;
        font-weight: 500;
    }

    .autocomplete-helper-text {
        font-size: 0.8rem;
        color: #718096;
        margin-top: 5px;
        display: flex;
        align-items: center;
        gap: 5px;
    }

        .autocomplete-helper-text i {
            color: #667eea;
        }


    /* 結果卡片 */
    .result-card {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        padding: 25px;
        border-radius: 20px;
        margin-bottom: 15px;
    }

    .conversion-result {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        margin-bottom: 10px;
        transition: all 0.3s ease;
    }

        .conversion-result:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateX(5px);
        }

        .conversion-result:last-child {
            margin-bottom: 0;
        }

    .result-unit {
        font-weight: 600;
        font-size: 1rem;
        opacity: 0.9;
    }

    .result-value {
        font-family: 'Roboto Mono', monospace;
        font-size: 1.3rem;
        font-weight: 700;
    }

    /* 快速轉換 */
    .quick-convert {
        display: flex;
        gap: 10px;
        flex-wrap: wrap;
        margin-top: 15px;
    }

    .quick-btn {
        padding: 8px 15px;
        background: rgba(255, 255, 255, 0.2);
        border: 1px solid rgba(255, 255, 255, 0.3);
        border-radius: 20px;
        color: white;
        font-size: 0.85rem;
        cursor: pointer;
        transition: all 0.3s ease;
    }

        .quick-btn:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: translateY(-2px);
        }

    /* 按鈕組 */
    .btn-custom-outline {
        background: white;
        color: #667eea;
        border: 2px solid #667eea;
        padding: 12px 24px;
        border-radius: 12px;
        font-weight: 600;
        transition: all 0.3s ease;
    }

        .btn-custom-outline:hover {
            background: #667eea;
            color: white;
            transform: translateY(-2px);
        }


    /* 轉換表格 */
    .conversion-table {
        background: white;
        border-radius: 12px;
        overflow: hidden;
    }

        .conversion-table table {
            width: 100%;
            border-collapse: collapse;
        }

        .conversion-table th {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            color: white;
            padding: 15px;
            text-align: left;
            font-weight: 600;
        }

        .conversion-table td {
            padding: 12px 15px;
            border-bottom: 1px solid #e2e8f0;
        }

        .conversion-table tr:last-child td {
            border-bottom: none;
        }

        .conversion-table tr:hover {
            background: #f7fafc;
        }

    /* 動畫 */
    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-30px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    @keyframes pulse {
        0%, 100% {
            transform: scale(1);
        }

        50% {
            transform: scale(1.05);
        }
    }

    /* 響應式設計 */
    @media (max-width: 768px) {
        .page-header h1 {
            font-size: 2rem;
        }

        .category-tabs {
            gap: 8px;
        }

        .category-tab {
            padding: 8px 12px;
            font-size: 0.85rem;
        }

        .input-group-flex {
            flex-direction: column;
        }

        .form-input {
            font-size: 1.5rem;
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            min-width: 0;
        }

        .unit-select {
            width: 100%;
        }

        .glass-card {
            padding: 15px;
        }

        /* Mobile: 預設收合類別標籤以節省空間 */
        #categoryTabsCollapse {
            max-height: 400px;
            overflow-y: auto;
        }

        #categoryCollapseIcon {
            font-size: 1.2rem;
            margin-top: 2px;
        }

        .card-title[data-bs-toggle="collapse"] {
            display: flex;
            align-items: center;
            justify-content: space-between;
        }
    }

    .tooltip-icon {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 18px;
        height: 18px;
        border-radius: 50%;
        background: #667eea;
        color: white;
        font-size: 0.7rem;
        cursor: help;
        margin-left: 5px;
        position: relative;
    }

    .tooltip-text {
        visibility: hidden;
        opacity: 0;
        position: absolute;
        z-index: 1000;
        bottom: 125%;
        left: 50%;
        transform: translateX(-50%);
        background-color: #2d3748;
        color: white;
        text-align: center;
        padding: 8px 12px;
        border-radius: 8px;
        font-size: 0.85rem;
        white-space: nowrap;
        transition: opacity 0.3s;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        font-weight: 400;
    }

    .tooltip-icon:hover .tooltip-text {
        visibility: visible;
        opacity: 1;
    }

    .tooltip-text::after {
        content: "";
        position: absolute;
        top: 100%;
        left: 50%;
        margin-left: -5px;
        border-width: 5px;
        border-style: solid;
        border-color: #2d3748 transparent transparent transparent;
    }