/**
 * Frontend Calculator CSS for Tinh Gia In Catalogue
 */

/* Calculator Container */
.tgic-calculator-container {
    max-width: 900px;
    margin: 30px auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(220, 20, 60, 0.15);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    border: 2px solid #ff6b6b;
}

/* Header */
.tgic-header {
    background: linear-gradient(135deg, #dc143c 0%, #ff6347 50%, #ffa500 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.tgic-header h2 {
    color: white;
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tgic-subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.95;
    font-weight: 300;
}

/* Form */
.tgic-form {
    padding: 40px;
}

.tgic-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.tgic-col {
    display: flex;
    flex-direction: column;
}

.tgic-col label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #dc143c;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tgic-col input,
.tgic-col select {
    width: 100%;
    /* padding: 14px 16px; */
    border: 2px solid #ffe4e1;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.tgic-col input:focus,
.tgic-col select:focus {
    outline: none;
    border-color: #dc143c;
    box-shadow: 0 0 0 3px rgba(220, 20, 60, 0.1);
    transform: translateY(-1px);
}

.tgic-col input:hover,
.tgic-col select:hover {
    border-color: #ff6347;
}

/* Submit Section */
.tgic-submit-row {
    text-align: center;
    margin: 20px 0 40px 0;
    padding-top: 30px;
    border-top: 1px solid #ffe4e1;
}

.tgic-calculate-btn {
    background: linear-gradient(135deg, #dc143c 0%, #ff6347 50%, #ffa500 100%);
    color: white;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 200px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.tgic-calculate-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(220, 20, 60, 0.4);
}

.tgic-calculate-btn:active {
    transform: translateY(0);
}

.tgic-calculate-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.tgic-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.tgic-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Results Section */
.tgic-results {
    margin-top: 40px;
    background: #fef7f0;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #ffe4e1;
}

.tgic-results-header {
    background: linear-gradient(135deg, #dc143c 0%, #ff6347 100%);
    color: white;
    padding: 20px 30px;
    text-align: center;
}

.tgic-results-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.tgic-results-content {
    padding: 30px;
}

/* Price Summary - Above Calculate Button */
.tgic-price-summary {
    background: linear-gradient(135deg, #dc143c 0%, #ff6347 50%, #ffa500 100%);
    color: white;
    border-radius: 8px;
    text-align: left;
    box-shadow: 0 4px 15px rgba(220, 20, 60, 0.3);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tgic-price-info {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
    padding: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.tgic-total-price {
    font-size: 24px;
    color: white !important;
    margin-bottom: 8px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tgic-unit-price {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

/* Calculation Details */
.tgic-calculation-details {
    background: white;
    border-radius: 12px;
    padding: 30px;
    border: 2px solid #ffe4e1;
    box-shadow: 0 2px 10px rgba(220, 20, 60, 0.1);
}

.tgic-details-header h4 {
    margin: 0 0 25px 0;
    color: #dc143c;
    font-size: 20px;
    font-weight: 600;
    padding-bottom: 15px;
    border-bottom: 3px solid #ffe4e1;
    text-align: center;
}

.tgic-basic-info {
    background: #fef5f4;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
}

.tgic-price-breakdown {
    background: #fff9f9;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #ffe4e1;
}

.tgic-price-breakdown h5 {
    margin: 0 0 20px 0;
    color: #ff6347;
    font-size: 16px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #ffe4e1;
    text-align: center;
}

.tgic-details-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
}

.tgic-price-breakdown {
    border-top: 1px solid #ffe4e1;
    padding-top: 20px;
}

.tgic-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #fef7f0;
}

.tgic-detail-row:last-child {
    border-bottom: none;
}

.tgic-detail-row span {
    color: #ff8c69;
    font-weight: 500;
}

.tgic-detail-row strong {
    color: #dc143c;
    font-weight: 600;
}

.tgic-total-row {
    border-top: 2px solid #ffe4e1;
    padding-top: 15px;
    margin-top: 10px;
    font-size: 16px;
}

.tgic-total-row span,
.tgic-total-row strong {
    color: #dc143c;
    font-weight: 700;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tgic-calculator-container {
        margin: 20px 10px;
        border-radius: 8px;
    }
    
    .tgic-header {
        padding: 25px 20px;
    }
    
    .tgic-header h2 {
        font-size: 24px;
    }
    
    .tgic-form {
        padding: 30px 20px;
    }
    
    .tgic-row {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 20px;
    }
    
    .tgic-calculate-btn {
        font-size: 16px;
        min-width: 180px;
    }
    
    .tgic-total-price {
        font-size: 28px;
    }
    
    .tgic-results-content {
        padding: 25px 20px;
    }
    
    .tgic-calculation-details {
        padding: 20px;
    }
    
    .tgic-detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .tgic-header h2 {
        font-size: 20px;
    }
    
    .tgic-subtitle {
        font-size: 14px;
    }
    
    .tgic-form {
        padding: 25px 15px;
    }
    
    .tgic-total-price {
        font-size: 24px;
    }
    
    .tgic-calculate-btn {
        padding: 12px 25px;
        font-size: 14px;
        min-width: 160px;
    }
}

/* Help Text */
.help-text {
    font-size: 12px;
    color: #ff8c69;
    margin-top: 5px;
    font-style: italic;
}

/* Error States */
.tgic-col input.error,
.tgic-col select.error {
    border-color: #b91c1c;
    box-shadow: 0 0 0 3px rgba(185, 28, 28, 0.15);
}

/* Success Animation */
.tgic-results {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading State */
.tgic-calculate-btn.loading {
    pointer-events: none;
}

/* Accessibility */
.tgic-col input:focus-visible,
.tgic-col select:focus-visible {
    outline: 2px solid #dc143c;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .tgic-calculator-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .tgic-header {
        background: #f5f5f5 !important;
        color: #333 !important;
    }
    
    .tgic-calculate-btn {
        display: none;
    }
}
