/**
 * Meralco Tools Styling
 */

/* Main Container */
.meralco-tools-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
}

.meralco-tool {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex: 1;
    min-width: 300px;
}

.meralco-tool-header {
    border-bottom: 2px solid #0073aa;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.meralco-tool-header h3 {
    margin: 0 0 5px 0;
    color: #0073aa;
    font-size: 22px;
}

.meralco-tool-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.meralco-tool-content {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Buttons */
.meralco-btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    text-decoration: none;
}

.meralco-btn-primary {
    background: #0073aa;
    color: #fff;
}

.meralco-btn-primary:hover {
    background: #005a87;
    text-decoration: none;
}

.meralco-btn-secondary {
    background: #f5f5f5;
    color: #0073aa;
    border: 2px solid #0073aa;
}

.meralco-btn-secondary:hover {
    background: #0073aa;
    color: #fff;
}

.meralco-btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Form Elements */
.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

.meralco-input,
.meralco-select {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.meralco-input:focus,
.meralco-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Search Section */
.search-section {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-section .meralco-input {
    flex: 1;
}

.search-section .meralco-btn {
    align-self: flex-end;
    white-space: nowrap;
}

/* Results Display */
.meralco-results {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
}

.meralco-results h4 {
    margin: 0 0 15px 0;
    color: #0073aa;
    font-size: 16px;
}

.meralco-results.hidden {
    display: none;
}

.hidden {
    display: none !important;
}

/* Lists */
.appliance-list,
.branch-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.appliance-item,
.branch-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.appliance-item:hover,
.branch-item:hover {
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.15);
    border-color: #0073aa;
}

.appliance-item strong,
.branch-item strong {
    color: #0073aa;
    display: block;
    margin-bottom: 5px;
}

.appliance-item .brand,
.appliance-item .wattage,
.branch-item .address,
.branch-item .city,
.branch-item .phone,
.branch-item .hours {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 3px;
}

.appliance-item .wattage {
    font-weight: 600;
    color: #333;
    margin-top: 5px;
}

.appliance-item button {
    margin-top: 10px;
}

/* Selected Info */
.meralco-selected {
    background: #e8f5e9;
    border-left-color: #4caf50;
    padding: 15px;
    border-radius: 4px;
    border-left: 4px solid #4caf50;
}

.meralco-selected.hidden {
    display: none;
}

.selected-info p {
    margin: 5px 0;
    font-size: 14px;
}

/* Results Table */
.results-table {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background: #fff;
    border-radius: 4px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
}

.result-row span:first-child {
    font-weight: 600;
    color: #333;
}

.result-row span:last-child {
    color: #0073aa;
    font-weight: 600;
    font-size: 16px;
}

.result-row.highlight {
    background: #e3f2fd;
    border-color: #0073aa;
}

.result-row.highlight span:last-child {
    font-size: 18px;
}

/* Disclaimer */
.disclaimer {
    font-size: 12px;
    color: #999;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
}

/* Responsive Design */
@media (max-width: 768px) {
    .meralco-tools-container {
        flex-direction: column;
    }

    .meralco-tool {
        min-width: 100%;
    }

    .search-section {
        flex-direction: column;
    }

    .search-section .meralco-btn {
        align-self: stretch;
    }

    .result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .result-row span:last-child {
        align-self: flex-end;
    }

    .meralco-tool-header h3 {
        font-size: 18px;
    }

    .meralco-btn {
        width: 100%;
    }
}

/* Loading State */
.meralco-loading {
    text-align: center;
    padding: 20px;
    background: #f0f8ff;
    border-radius: 4px;
    border-left: 4px solid #2196F3;
}

.meralco-loading p {
    margin: 0;
    color: #1976D2;
    font-weight: 600;
}

/* Rate Display */
.rate-display {
    display: flex;
    gap: 8px;
    align-items: center;
}

.rate-display .meralco-input {
    flex: 1;
    background: #f5f5f5;
    cursor: not-allowed;
}

.rate-display .rate-unit {
    font-weight: 600;
    color: #0073aa;
    white-space: nowrap;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-muted {
    color: #999;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Loading State */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
