/* 
 * Rate Estimate Tool Page Styles
 * Specific styles for the TP Freight rate estimate tool page
 * Extends the main styles.css with page-specific components
 */

/* Rate Hero Section */
.rate-hero {
    position: relative;
    height: 50vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    overflow: hidden;
}

.rate-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('../../imgs/calculator-pattern.svg') no-repeat center center;
    background-size: cover;
    opacity: 0.1;
    z-index: 1;
}

.rate-hero .container {
    position: relative;
    z-index: 3;
}

.tool-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background-color: rgba(255, 255, 255, 0.15);
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 1.5rem;
    backdrop-filter: blur(10px);
}

.tool-badge i {
    font-size: 1.25rem;
    color: var(--white);
}

.tool-badge span {
    color: var(--white);
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.rate-hero h1 {
    font-size: 3rem;
    color: var(--white);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.rate-hero p {
    font-size: 1.2rem;
    color: var(--white);
    opacity: 0.95;
}

/* Rate Calculator Section */
.rate-calculator {
    padding: 4rem 0;
    background-color: var(--dark-bg);
    min-height: calc(100vh - 50vh);
}

.calculator-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Service Selection */
.service-selection {
    margin-bottom: 2rem;
}

.service-selection h2 {
    color: var(--primary-color);
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
}

.service-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.service-tab {
    background: var(--dark-surface-2);
    border: 2px solid var(--dark-surface-3);
    color: var(--text-muted);
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 120px;
}

.service-tab.active {
    border-color: var(--primary-color);
    background-color: rgba(30, 144, 255, 0.1);
    color: var(--primary-color);
}

.service-tab:hover:not(.active) {
    border-color: var(--primary-light);
    color: var(--text-color);
}

.service-tab i {
    font-size: 1.5rem;
}

.service-tab span {
    font-weight: 600;
    font-size: 0.9rem;
}

/* Rate Form */
.rate-form {
    background-color: var(--dark-surface-2);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--dark-surface-3);
    width: 100%;
    max-width: none;
}

/* Form Progress */
.form-progress {
    margin-bottom: 2rem;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--dark-surface-3);
    border-radius: 2px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    width: 25%;
    transition: width 0.3s ease;
    border-radius: 2px;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    text-align: center;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--dark-surface-3);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.progress-step.active .step-number,
.progress-step.completed .step-number {
    background-color: var(--primary-color);
    color: var(--black);
}

.step-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

.progress-step.active .step-label,
.progress-step.completed .step-label {
    color: var(--primary-color);
}

/* Form Steps */
.form-step {
    display: none;
    animation: fadeSlideIn 0.4s ease forwards;
}

.form-step.active {
    display: block;
}

.step-header {
    text-align: center;
    margin-bottom: 2rem;
}

.step-header h3 {
    color: var(--black);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.step-header p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Location Inputs */
.location-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.location-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.location-group label {
    color: var(--black);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.location-group label i {
    color: var(--primary-color);
}

.input-group {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

.input-with-icon input,
.input-with-icon select {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background-color: var(--dark-surface-3);
    border: 1px solid var(--black);
    border-radius: var(--border-radius);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-with-icon input:focus,
.input-with-icon select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(30, 144, 255, 0.2);
}

.input-with-icon input:focus + i,
.input-with-icon select:focus + i {
    color: var(--primary-color);
}

.location-swap {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
}

.location-swap button {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: none;
    color: var(--black);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.location-swap button:hover {
    background-color: var(--primary-dark);
    transform: rotate(180deg);
}

/* Shipment Inputs */
.shipment-inputs {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    align-items: end;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    color: var(--black);
    font-weight: 500;
    font-size: 0.95rem;
}

.help-text {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.help-text a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.help-text a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* Service Options */
.service-options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.option-group h4 {
    color: var(--black);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--dark-surface-3);
}

.checkbox-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    transition: background-color 0.3s ease;
}

.checkbox-label:hover {
    background-color: var(--dark-surface);
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-muted);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--black);
    font-size: 0.9rem;
    font-weight: bold;
}

.option-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.option-title {
    color: var(--text-color);
    font-weight: 500;
}

.option-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Step Actions */
.step-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    gap: 1rem;
}

.step-actions .btn {
    min-width: 120px;
    padding: 0.75rem 1.5rem;
}

.calculate-rate {
    background: linear-gradient(135deg, var(--success), #45a049);
    border: none;
    color: var(--black);
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.calculate-rate:hover {
    background: linear-gradient(135deg, #45a049, #388e3c);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-hover);
}

/* Quote Results */
.quote-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.quote-card {
    background-color: var(--dark-surface-3);
    border-radius: var(--border-radius);
    padding: 2rem;
    border: 2px solid var(--dark-surface-3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.quote-card.recommended {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.quote-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.quote-card:hover::before,
.quote-card.recommended::before {
    transform: scaleX(1);
}

.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.service-type {
    color: var(--black);
    font-size: 1.3rem;
    font-weight: 600;
}

.recommended-badge {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: var(--black);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quote-price {
    text-align: center;
    margin-bottom: 1.5rem;
}

.price-amount {
    font-size: 3rem;
    font-weight: bold;
    color: var(--primary-color);
    line-height: 1;
}

.price-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.quote-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--dark-surface-2);
}

.detail-row:last-child {
    border-bottom: none;
    font-weight: 600;
    color: var(--black);
    border-top: 1px solid var(--primary-color);
    padding-top: 1rem;
    margin-top: 0.5rem;
}

.detail-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.detail-value {
    color: var(--text-color);
    font-weight: 500;
}

.quote-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.select-quote {
    background-color: var(--primary-color);
    color: var(--black);
    border: none;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.select-quote:hover {
    background-color: var(--primary-dark);
}

.quote-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Quote Sidebar */
.quote-sidebar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.quote-summary,
.help-section,
.tools-section {
    background-color: var(--dark-surface-2);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--dark-surface-3);
}

.quote-summary h3,
.help-section h4,
.tools-section h4 {
    color: var(--black);
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.summary-content {
    color: var(--text-color);
}

.empty-summary {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem 0;
    font-style: italic;
}

.help-options,
.tool-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.help-link,
.tool-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-color);
    text-decoration: none;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.help-link:hover,
.tool-link:hover {
    background-color: var(--dark-surface-3);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.help-link i,
.tool-link i {
    color: var(--primary-color);
    width: 20px;
    text-align: center;
}

/* Animations */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.calculate-rate.loading {
    animation: pulse 1s infinite;
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .calculator-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .quote-results {
        grid-template-columns: 1fr;
    }
    
    .quote-card.recommended {
        transform: none;
    }
}

@media screen and (max-width: 768px) {
    .rate-hero {
        height: auto;
        min-height: 250px;
        padding: 120px 1rem 2rem;
    }

    .tool-badge {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .rate-hero h1 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    .rate-hero p {
        font-size: 1rem;
        line-height: 1.5;
    }

    .service-tabs {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .service-tab {
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 140px;
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .progress-steps {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .location-inputs {
        flex-direction: column;
    }

    .location-swap {
        transform: rotate(90deg);
    }

    .input-row {
        grid-template-columns: 1fr;
    }

    .service-options-grid {
        grid-template-columns: 1fr;
    }
}

@media screen and (max-width: 576px) {
    .rate-hero {
        padding: 100px 1rem 2rem;
        min-height: 200px;
    }

    .tool-badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
    }

    .rate-hero h1 {
        font-size: 1.75rem;
        margin-bottom: 0.75rem;
    }

    .rate-hero p {
        font-size: 0.95rem;
    }

    .service-tab {
        flex: 1 1 100%;
        font-size: 0.85rem;
    }

    .calculator-container {
        padding: 1.5rem;
    }

    .step-actions {
        flex-direction: column;
    }

    .step-actions .btn {
        width: 100%;
    }
}