/* ============================================
   Calculator Page Styles
   Extracted from calculator-leaflet.html inline styles
   ============================================ */

/* Hero Section */
.calc-hero {
    background: var(--gradient-primary, linear-gradient(135deg, #0f172a 0%, #1e293b 100%));
    color: white;
    padding: 80px 20px 40px;
    text-align: center;
    margin-top: 20px;
}

.calc-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    color: white;
}

.calc-hero p {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    color: white;
}

.calc-hero-subtitle {
    font-size: 1.125rem;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto 24px;
    line-height: 1.6;
}

.calc-hero-features {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin-top: 24px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.calc-feature-badge {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 768px) {
    .calc-hero h1 {
        font-size: 1.75rem;
    }

    .calc-hero-subtitle {
        font-size: 1rem;
    }

    .calc-feature-badge {
        font-size: 0.8rem;
        padding: 6px 12px;
    }
}

/* Calculator Section */
.calculator-container {
    max-width: 800px;
    margin: 0 auto 80px;
    padding: 0 20px;
}

.calculator-card {
    background: white;
    border-radius: 12px;
    padding: 32px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    border: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    .calculator-card {
        padding: 20px;
    }
}

.calc-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.route-section {
    background: #f8fafc;
    padding: 24px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.route-group {
    margin-bottom: 15px;
    position: relative;
}

.route-group:last-child {
    margin-bottom: 0;
}

.route-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.route-input-group {
    display: flex;
    gap: 6px;
    align-items: stretch;
    position: relative;
}

.route-input-group input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: all 0.15s;
}

.route-input-group input:focus {
    outline: none;
    border-color: #1e293b;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-point-mini-btn {
    background: var(--gradient-primary, linear-gradient(135deg, #0f172a 0%, #1e293b 100%));
    color: white;
    border: none;
    width: 38px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.15s;
    flex-shrink: 0;
}

.add-point-mini-btn:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.cargo-params-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
}

.cargo-params-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.dimensions-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding-top: 16px;
    margin-top: 16px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.dimensions-row.expanded {
    max-height: 200px;
    opacity: 1;
    padding-top: 16px;
}

.dimensions-toggle {
    grid-column: 1 / -1;
    background: transparent;
    border: 2px dashed #cbd5e1;
    color: #64748b;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.dimensions-toggle:hover {
    border-color: #1e293b;
    color: #1e293b;
    background: #f8fafc;
}

.dimensions-toggle-icon {
    transition: transform 0.3s;
    font-size: 1rem;
}

.dimensions-toggle.active .dimensions-toggle-icon {
    transform: rotate(180deg);
}

/* Settings button */
.toggle-settings-btn {
    grid-column: 1 / -1;
    background: transparent;
    border: 2px dashed #cbd5e1;
    color: #64748b;
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 15px 0;
    position: relative;
    z-index: 10;
    pointer-events: auto !important;
}

.toggle-settings-btn:hover {
    border-color: #1e293b;
    color: #1e293b;
    background: #f8fafc;
}

.toggle-settings-btn.active {
    border-color: #1e293b;
    color: #1e293b;
    background: #ede9fe;
}

.settings-arrow {
    transition: transform 0.3s;
    font-size: 1rem;
}

/* Additional settings block */
.additional-settings {
    margin: 0 0 20px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.settings-section {
    margin-bottom: 20px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #475569;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dimensions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

@media (max-width: 768px) {
    .dimensions-grid {
        grid-template-columns: 1fr;
    }
}

.dimensions-label {
    grid-column: 1 / -1;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

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

.compact-group label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    font-size: 1.1rem;
    pointer-events: none;
}

.input-unit {
    position: absolute;
    right: 12px;
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 600;
    pointer-events: none;
}

.compact-group input,
.compact-group select {
    width: 100%;
    padding: 10px 40px 10px 40px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s;
    font-weight: 500;
}

.compact-group input:focus,
.compact-group select:focus {
    outline: none;
    border-color: #1e293b;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.compact-group select {
    padding-left: 40px;
    padding-right: 30px;
    cursor: pointer;
}

@media (max-width: 768px) {
    .cargo-params-row,
    .dimensions-row {
        grid-template-columns: 1fr;
    }

    .dimensions-label {
        margin-top: 8px;
    }
}

.calc-form .form-group {
    position: relative;
}

.calc-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1e293b;
}

.calc-form .form-group input,
.calc-form .form-group select {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
}

.calc-form .form-group.full-width {
    grid-column: 1 / -1;
}

.calc-form .form-group input:focus,
.calc-form .form-group select:focus {
    outline: none;
    border-color: #64748b;
    box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.1);
}

.suggestions {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-top: 4px;
    max-height: 250px;
    overflow-y: auto;
    display: none;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.suggestions.active {
    display: block;
}

.suggestion-item {
    padding: 12px 18px;
    cursor: pointer;
    transition: background 0.2s;
    pointer-events: auto;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.5;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background: #f8fafc;
}

.calc-button {
    background: var(--gradient-primary, linear-gradient(135deg, #0f172a 0%, #1e293b 100%));
    color: white;
    border: none;
    padding: 14px 40px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    margin: 24px auto 0;
    display: block;
    box-shadow: 0 4px 15px rgba(15, 23, 42, 0.3);
    position: relative;
    z-index: 70;
}

.calc-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.4);
}

.calc-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.button-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 24px;
}

.clear-all-button {
    background: #6b7280;
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

.clear-all-button:hover {
    background: #4b5563;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4);
}

.clear-input-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 8px;
    font-size: 18px;
    position: absolute;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
    transition: color 0.2s;
    z-index: 10;
}

.clear-input-btn:hover {
    color: #ef4444;
}

.swap-route-btn {
    background: none;
    border: none;
    color: #1e293b;
    cursor: pointer;
    padding: 8px;
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.swap-route-btn:hover {
    color: #0f172a;
    transform: translateY(-50%) scale(1.15);
}

.swap-route-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 12px 0;
    padding: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.intermediate-point {
    margin: 8px 0;
    position: relative;
}

.intermediate-point input {
    pointer-events: auto;
    cursor: text;
}

.remove-point-mini-btn {
    background: #ef4444;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    flex-shrink: 0;
}

.remove-point-mini-btn:hover {
    background: #dc2626;
    transform: scale(1.05);
}

/* Order button - Primary CTA */
.btn-order {
    padding: 14px 32px;
    background: var(--gradient-primary, linear-gradient(135deg, #0f172a 0%, #1e293b 100%));
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

.btn-order:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

/* Save button - Secondary */
.btn-save {
    padding: 14px 28px;
    background: transparent;
    color: #1e293b;
    border: 2px solid #1e293b;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

.btn-save:hover {
    background: #f5f3ff;
    border-color: #5a67d8;
    color: #5a67d8;
    transform: translateY(-1px);
}

/* Share button - Secondary */
.btn-share {
    padding: 14px 28px;
    background: transparent;
    color: #1e293b;
    border: 2px solid #1e293b;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

.btn-share:hover {
    background: #f5f3ff;
    border-color: #5a67d8;
    color: #5a67d8;
    transform: translateY(-1px);
}

.frequent-routes {
    margin-top: 30px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    position: relative;
    z-index: 2;
}

.frequent-routes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.frequent-route-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 20px;
    color: #475569;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    pointer-events: auto !important;
    position: relative;
    z-index: 3;
}

.frequent-route-btn:hover {
    border-color: #1e293b;
    color: #1e293b;
    transform: translateY(-2px);
}

/* Calculator Order Modal (page-specific) */
.calc-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.calc-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.calc-modal .calc-modal-content {
    background: white;
    border-radius: 12px;
    padding: 32px;
    max-width: 480px;
    width: 90%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: calcModalSlideIn 0.2s ease-out;
}

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

.calc-modal .close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 30px;
    font-weight: bold;
    color: #94a3b8;
    cursor: pointer;
    transition: color 0.2s;
    background: none;
    border: none;
}

.calc-modal .close-modal:hover {
    color: #64748b;
}

.calc-modal .modal-subtitle {
    color: #64748b;
    margin-bottom: 25px;
}

.calc-order-form {
    display: grid;
    gap: 20px;
}

.calc-order-form textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s;
    resize: vertical;
}

.calc-order-form textarea:focus {
    outline: none;
    border-color: #64748b;
    box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.1);
}

.calc-checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.calc-checkbox-group input[type="checkbox"] {
    margin-top: 4px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.calc-checkbox-group label {
    font-size: 0.9rem;
    color: #64748b;
    cursor: pointer;
}

.calc-checkbox-group a {
    color: #1e293b;
    text-decoration: none;
}

.calc-checkbox-group a:hover {
    text-decoration: underline;
}

.success-message {
    text-align: center;
    padding: 30px;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.success-message h3 {
    color: #10b981;
    margin-bottom: 10px;
}

.success-message p {
    color: #64748b;
}

/* Map Section */
.map-section {
    margin-top: 30px;
    padding: 30px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.map-section h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #1e293b;
}

.route-map {
    width: 100%;
    height: 500px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Results */
.results {
    margin-top: 24px;
    padding: 0;
    display: none;
    position: relative;
    z-index: 1;
}

.results.show {
    display: block;
}

/* Allow text selection in results */
.results *, .result-card *, .result-value {
    user-select: text !important;
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
}

.results h3 {
    font-size: 1.25rem;
    margin-bottom: 20px;
    color: #1e293b;
    font-weight: 700;
    text-align: center;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.result-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 2px solid #e2e8f0;
    transition: all 0.2s ease;
}

.result-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

.result-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.result-label {
    color: #64748b;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.2;
}

.result-card.primary .result-value {
    background: var(--gradient-primary, linear-gradient(135deg, #0f172a 0%, #1e293b 100%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@media (max-width: 1024px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .results-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .result-card {
        padding: 16px;
    }

    .result-value {
        font-size: 1.3rem;
    }
}

/* Action buttons */
.results-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
    position: relative;
    z-index: 10;
}

.results-actions button {
    pointer-events: auto !important;
    cursor: pointer !important;
    position: relative;
    z-index: 11;
}

/* Trust Stats */
.calc-trust-stats {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.calc-stat-item {
    text-align: center;
    padding: 30px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.calc-stat-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.calc-stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-primary, linear-gradient(135deg, #0f172a 0%, #1e293b 100%));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.calc-stat-label {
    font-size: 0.95rem;
    color: #64748b;
    font-weight: 500;
}

@media (max-width: 768px) {
    .calc-trust-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .calc-stat-number {
        font-size: 2rem;
    }

    .calc-stat-label {
        font-size: 0.85rem;
    }
}

/* SEO Content */
.calc-seo-content {
    max-width: 1200px;
    margin: 0 auto 80px;
    padding: 0 20px;
}

.seo-block {
    background: white;
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.seo-block h2 {
    font-size: 2rem;
    margin-bottom: 20px;
    color: #1e293b;
}

.seo-block h3 {
    font-size: 1.5rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #1e293b;
}

.seo-block p {
    color: #64748b;
    line-height: 1.8;
    margin-bottom: 15px;
}

.seo-block ul {
    list-style-position: inside;
    color: #64748b;
    line-height: 2;
}

.seo-block ol {
    color: #64748b;
    padding-left: 20px;
}

.seo-block a {
    color: #1e293b;
    text-decoration: none;
}

.seo-block a:hover {
    text-decoration: underline;
}

/* Logist-specific blocks */
.logist-block {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #1e293b;
}

.logist-signup {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
}

.logist-signup h2 {
    color: #92400e;
}

.logist-signup ul {
    margin: 20px 0;
}

/* Tooltip */
.tooltip-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: #94a3b8;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
    cursor: help;
    transition: all 0.2s ease;
    position: relative;
}

.tooltip-icon:hover {
    background: #1e293b;
    transform: scale(1.1);
}

/* Mobile overrides */
@media (max-width: 768px) {
    .calculator-card {
        padding: 30px 20px;
    }

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

/* Popular routes table */
.calc-seo-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.calc-seo-content table th,
.calc-seo-content table td {
    padding: 12px;
    text-align: left;
    border: 1px solid #e2e8f0;
}

.calc-seo-content table thead tr {
    background: #f8fafc;
}

.calc-seo-content table tr:nth-child(even) {
    background: #f8fafc;
}
