/**
 * TME Fuel Calculator - Frontend Styles
 */

.tme-fuel-calculator-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tme-calculator-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.calculator-icon {
    color: #2d7a5e;
}

/* Lucide Icons - Yellow on Green Backgrounds */
[data-lucide] {
    stroke: #FFD700 !important;
    color: #FFD700 !important;
}

.tme-calculator-header h2 {
    margin: 0;
    color: #2d7a5e;
    font-size: 1.8rem;
}

.calculator-description {
    color: #666;
    margin-bottom: 2rem;
}

.tme-fuel-calc-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.form-group select,
.form-group input {
    padding: 0.75rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: border-color 0.3s;
}

.form-group select:focus,
.form-group input:focus {
    outline: none;
    border-color: #2d7a5e;
}

.form-hint {
    font-size: 0.875rem;
    color: #666;
    margin: 0.25rem 0 0;
}

.tme-calc-submit-btn {
    background: #2d7a5e;
    color: #fff;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.tme-calc-submit-btn:hover {
    background: #245a48;
}

.tme-calc-result {
    margin-top: 2rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #2d7a5e;
}

.tme-calc-result h3 {
    margin-top: 0;
    color: #2d7a5e;
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.result-row.result-total {
    border-bottom: none;
    border-top: 2px solid #2d7a5e;
    margin-top: 0.5rem;
    padding-top: 1rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: #2d7a5e;
}

.result-label {
    font-weight: 600;
}

.result-value {
    color: #2d7a5e;
    font-weight: 600;
}

.result-note {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #666;
    font-style: italic;
}

.tme-calc-loading {
    text-align: center;
    padding: 2rem;
}

.loading-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2d7a5e;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.tme-calc-error {
    padding: 1rem;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    margin-top: 1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tme-fuel-calculator-container {
        padding: 1.5rem;
    }
    
    .tme-calculator-header h2 {
        font-size: 1.5rem;
    }
    
    .result-row {
        flex-direction: column;
        gap: 0.25rem;
    }
}

/* Modal Styles */
.tme-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.tme-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tme-modal-content {
    background-color: #fff;
    margin: auto;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideIn 0.3s ease;
    overflow: visible;
}

.tme-modal-content.tme-modal-large {
    max-width: 700px;
}

.tme-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    z-index: 1;
    transition: color 0.2s;
}

.tme-modal-close:hover,
.tme-modal-close:focus {
    color: #000;
}

.tme-modal-header {
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.tme-modal-header i {
    margin-bottom: 1rem;
}

.tme-modal-header h2 {
    margin: 0;
    color: #2d7a5e;
    font-size: 1.5rem;
}

.tme-modal-body {
    padding: 2rem;
}

.tme-modal-body p {
    margin: 0.5rem 0;
    color: #555;
    line-height: 1.6;
}

.tme-modal-footer {
    padding: 1.5rem 2rem;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    border-radius: 0 0 12px 12px;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background-color: #2d7a5e;
    color: white;
}

.btn-primary:hover {
    background-color: #235f49;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(45, 122, 94, 0.3);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background-color: #5a6268;
}

/* Wizard Styles */
.wizard-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
}

.wizard-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 10%;
    right: 10%;
    height: 2px;
    background-color: #e0e0e0;
    z-index: 0;
}

.wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    position: relative;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #e0e0e0;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: all 0.3s ease;
}

.wizard-step.active .step-number {
    background-color: #2d7a5e;
    color: white;
    box-shadow: 0 0 0 4px rgba(45, 122, 94, 0.2);
}

.wizard-step.completed .step-number {
    background-color: #10b981;
    color: white;
}

.step-label {
    font-size: 0.875rem;
    color: #666;
    text-align: center;
}

.wizard-step.active .step-label {
    color: #2d7a5e;
    font-weight: 600;
}

.wizard-content {
    display: none;
}

.wizard-content.active {
    display: block;
}

.wizard-content .form-group {
    margin-bottom: 1.5rem;
}

.form-note {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

/* Google Maps Autocomplete Dropdown Fix */
.pac-container {
    z-index: 10050 !important;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pac-item {
    padding: 10px;
    cursor: pointer;
}

.pac-item:hover {
    background-color: #f0f0f0;
}

#quote-location {
    position: relative;
    z-index: 10040;
}

.wizard-loading {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    border-radius: 12px;
}

.wizard-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2d7a5e;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.wizard-loading p {
    color: #2d7a5e;
    font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .tme-modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .wizard-steps {
        flex-direction: column;
        gap: 1rem;
    }
    
    .wizard-steps::before {
        display: none;
    }
    
    .tme-modal-footer {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
}

/* File Upload Styles */
.file-upload-area {
    border: 2px dashed #2d7a5e;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    background-color: #f0f0f0;
    border-color: #235f49;
}

.file-upload-area.drag-over {
    background-color: #e8f5e9;
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.file-upload-area i {
    display: block;
    margin-bottom: 0.5rem;
}

.file-upload-area p {
    margin: 0;
    color: #2d7a5e;
    font-weight: 500;
}

.file-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #2d7a5e;
}

.file-item-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
}

.file-item-name {
    font-weight: 500;
    color: #333;
    word-break: break-word;
}

.file-item-size {
    font-size: 0.875rem;
    color: #666;
}

.file-item-remove {
    background: none;
    border: none;
    color: #ef4444;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1.2rem;
    transition: color 0.2s;
}

.file-item-remove:hover {
    color: #dc2626;
}

.file-upload-error {
    padding: 0.75rem;
    background-color: #fee2e2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    color: #991b1b;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.file-upload-success {
    padding: 0.75rem;
    background-color: #dcfce7;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    color: #166534;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}


/* Error Modal Styles */
#error-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

#error-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

#error-modal .tme-modal-content {
    background-color: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideIn 0.3s ease;
}

#error-modal h2 {
    color: #d63638;
    margin-top: 0;
    margin-bottom: 1rem;
}

#error-modal #error-message {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    word-wrap: break-word;
}

#error-modal .modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

#error-modal .tme-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

#error-modal .tme-modal-close:hover {
    color: #000;
}

@media (max-width: 768px) {
    #error-modal .tme-modal-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    #error-modal h2 {
        font-size: 1.25rem;
    }
    
    #error-modal .modal-actions {
        flex-direction: column;
    }
    
    #error-modal .modal-actions button {
        width: 100%;
    }
}
