/* Schneelast Calculator WordPress CSS - WITH MAP STYLES */

.schneelast-calculator {
    max-width: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.slc-container {
    background: #ffffff;
}

.slc-info-link {
    color: #d9534f;
    text-decoration: none;
}

.slc-info-link:hover {
    text-decoration: underline;
}

/* ===================================
   ADDRESS SECTION & MAP - NEW!
   =================================== */

/* Address Section */
.slc-address-section {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.slc-address-section h3 {
    color: #000;
    font-size: 18px;
    margin: 0 0 10px 0;
}

.slc-help-text {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
}

.slc-address-form {
    margin-bottom: 20px;
}

.slc-form-col-small {
    flex: 0 0 150px;
}

/* Map Container */
.slc-map-container {
    margin: 20px 0 30px;
    /* padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1); */
}

/* Map itself */
.slc-map {
    height: 400px;
    width: 100%;
    border-radius: 8px;
    border: 2px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Map Info Box */
/* .slc-map-info {
    margin-top: 15px;
    padding: 12px 15px;
    background: white;
    border-left: 4px solid #28a745;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
}

.slc-map-info strong {
    color: #333;
    display: block;
    margin-bottom: 5px;
} */

/* .slc-map-icon {
    margin-right: 5px;
    font-style: normal;
} */

/* Leaflet Popup Styling */
.slc-map-popup {
    font-family: inherit;
    text-align: center;
}

.slc-map-popup strong {
    display: block;
    margin-bottom: 5px;
    color: #333;
    font-size: 14px;
}

/* Success Message */
.slc-success {
    margin: 15px 0;
    padding: 12px 20px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-left: 4px solid #28a745;
    border-radius: 4px;
    color: #155724;
    font-size: 14px;
    line-height: 1.6;
    animation: slideIn 0.3s ease-out;
}

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

/* Auto-filled indicator */
.slc-auto-filled {
    background-color: #d4edda !important;
    border-color: #28a745 !important;
}

#slc-height-auto {
    display: inline-block;
    /* margin-left: 8px; */
    padding: 2px 8px;
    background: #28a745;
    /* color: white; */
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
}

/* Button Loading State */
.slc-btn-loading {
    display: none;
}

#slc-address-lookup-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Leaflet Control positioning fix */
.leaflet-control-zoom {
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
}

.leaflet-control-zoom a {
    width: 30px;
    height: 30px;
    line-height: 30px;
    font-size: 18px;
}

/* Make sure map tiles load properly */
.leaflet-container {
    font-family: inherit;
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.leaflet-popup-content {
    margin: 13px 19px;
}

/* ===================================
   ZONE LOOKUP
   =================================== */

.slc-zone-lookup {
    background: #f8f8f8;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.slc-zone-lookup h3 {
    color: #000;
    font-size: 18px;
    margin: 0 0 15px 0;
}

.slc-zone-search {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.slc-zone-search input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}

.slc-zone-search button {
    padding: 8px 20px;
    background: #DC0C15;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.slc-zone-search button:hover {
    background: #cc101a;
}

.slc-zone-results {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    background: white;
    display: none;
}

.slc-zone-results.active {
    display: block;
}

.slc-zone-result-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.slc-zone-result-item:hover {
    background: #f5f5f5;
}

.slc-no-results {
    padding: 12px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* ===================================
   FORM STYLES
   =================================== */

.slc-form {
    margin-bottom: 30px;
}

.slc-form-grid {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
}

.slc-form-left {
    flex: 1;
    max-width: 500px;
}

.slc-form-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slc-form-group {
    display: grid;
    grid-template-columns: 230px 1fr;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.slc-form-group label {
    font-size: 13px;
    color: #333;
}

.slc-form-group .required {
    color: #d9534f;
}

.slc-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.slc-input {
    padding: 6px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 13px;
    width: 120px;
}

.slc-input:focus {
    outline: none;
    border-color: #66afe9;
}

.slc-input.error {
    border-color: #d9534f;
}

.slc-input[readonly] {
    background-color: #f5f5f5;
}

.slc-suffix {
    font-size: 13px;
    color: #333;
}

.slc-checkbox-group {
    grid-template-columns: 1fr;
}

.slc-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.slc-checkbox-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.slc-info-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #007cba;
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 20px;
    cursor: help;
    font-size: 12px;
    margin-left: 8px;
}

/* Illustration */
.slc-illustration {
    text-align: center;
}

.slc-illustration img {
    max-width: 100%;
    height: auto;
    max-height: 400px;
}

/* Section Headers */
.slc-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.slc-section h3 {
    color: #000;
    font-size: 18px;
    margin: 0 0 15px 0;
    font-weight: bold;
}

.slc-form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.slc-form-col {
    flex: 1;
}

.slc-form-col .slc-input {
    width: 100%;
}

/* Selection Grid */
.slc-selection-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.slc-selection-group {
    display: flex;
    flex-direction: column;
}

.slc-selection-group h4 {
    font-size: 14px;
    font-weight: bold;
    margin: 0 0 10px 0;
    color: #333;
}

.slc-selection-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    cursor: pointer;
    font-size: 13px;
}

.slc-selection-group input[type="radio"] {
    cursor: pointer;
}

/* Coating Group - Special handling */
.slc-coating-group {
    position: relative;
}

.slc-coating-group.disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

/* AGB Section */
.slc-agb-section {
    padding: 15px 0;
    background: transparent;
    margin: 0;
}

.slc-checkbox-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.slc-agb-label {
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    color: #333;
}

input[type="checkbox"]#slc-agb {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* Buttons */
.slc-button-container {
    padding: 15px 0;
}

.slc-button,
.cssbutton {
    padding: 8px 20px;
    border: none;
    border-radius: 3px;
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
    font-family: Arial, sans-serif;
}

.slc-button-primary {
    background-color: #DC0C15;
    color: white;
}

.slc-button-primary:hover {
    background-color: #cc101a;
}

.slc-button-secondary,
.cssbutton {
    background-color: #6c757d;
    color: white;
    display: inline-block;
}

.slc-button-secondary:hover,
.cssbutton:hover {
    background-color: #545b62;
}

/* ===================================
   RESULTS SECTION
   =================================== */

.slc-results {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
}

.slc-results-container {
    background: white;
}

.slc-results h2 {
    color: #000 !important;
    font-size: 28px !important;
    margin: 0 0 10px 0 !important;
    font-weight: bold;
}

.slc-results h3 {
    color: #000;
    font-size: 20px;
    margin: 0 0 15px 0;
    font-weight: bold;
}

/* Result Highlight Box - Exact Original Style */
.slc-result-highlight,
.Slres {
    padding: 10px 15px;
    font-size: 140%;
    border-radius: 2px;
    margin: 15px 0 30px;
    display: inline-block;
    background: #00FF7F;
    font-weight: 500;
}

/* User Data Display */
.slc-user-data {
    margin-bottom: 30px;
}

.slc-data-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    background: #f9f9f9;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 30px;
}

.slc-data-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 10px;
    padding: 5px 0;
}

.slc-data-label {
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.slc-data-value {
    font-size: 13px;
    color: #333;
}

/* Products Section - Matching Original Layout */
.slc-products {
    margin-top: 30px;
}

/* Product Header - Matching Original */
.slc-product-header {
    display: flex;
    background: #f0f0f0;
    padding: 10px;
    font-weight: bold;
    margin-bottom: 10px;
    border-radius: 3px;
}

.slc-product-header-left {
    flex: 1;
    padding-left: 10px;
}

.slc-product-header-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.slc-product-header-title {
    margin-bottom: 5px;
    font-size: 14px;
}

.slc-distance-grid {
    display: flex;
    gap: 0;
    width: 100%;
    justify-content: flex-end;
}

.slc-distance-label {
    width: 13%;
    min-width: 60px;
    text-align: center;
    padding: 8px 5px;
    font-weight: bold;
    font-size: 13px;
}

/* Product Item - Matching Original Shadow Style */
.slc-product-item {
    display: flex;
    margin-bottom: 15px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
    border-radius: 3px;
    transition: all 100ms;
    background: #ecf0f1;
}

.slc-product-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
}

.slc-product-info {
    flex: 1;
    padding: 15px;
}

.slc-product-art {
    color: #666;
    font-size: 12px;
    margin: 0 0 5px 0;
    font-weight: bold;
}

.slc-product-name {
    font-weight: bold;
    margin: 0 0 5px 0;
    font-size: 14px;
}

.slc-product-desc {
    font-size: 13px;
    line-height: 1.4;
    margin: 0 0 8px 0;
}

.slc-product-need {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #ddd;
    font-size: 13px;
}

/* Product Load Values - Matching Original Maxlast Design */
.slc-product-loads {
    flex: 1;
    display: flex;
    align-items: stretch;
    gap: 0;
    justify-content: flex-end;
}

.slc-load-value {
    width: 13%;
    min-width: 60px;
    text-align: center;
    padding: 8px 5px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1) inset;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    background: white;
}

.slc-load-value.ok {
    background: #00FF7F;
    font-weight: 500;
}

/* No Products Message */
.slc-no-products {
    padding: 20px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 3px;
    text-align: center;
}

/* ===================================
   LOADING & ERROR MESSAGES
   =================================== */

/* Loading */
.slc-loading {
    text-align: center;
    padding: 40px;
}

.slc-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #000;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: slc-spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Error Messages - Enhanced */
.slc-error {
    margin: 15px 0;
    padding: 12px 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-left: 4px solid #dc3545;
    border-radius: 4px;
    color: #721c24;
    font-size: 14px;
    line-height: 1.6;
    animation: slideIn 0.3s ease-out;
}

/* ===================================
   PRINT STYLES
   =================================== */

@media print {
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    
    /* When using printDiv(), the body only contains printableArea content */
    /* No need to hide anything - just style what's there */
    
    body {
        margin: 0;
        padding: 20px;
        font-family: Arial, Helvetica, sans-serif;
    }
    
    /* Page setup */
    @page {
        size: A4;
        margin: 1.5cm;
    }
    
    /* Typography for print */
    h2 {
        color: #000 !important;
        page-break-after: avoid;
        font-size: 22px !important;
        margin-bottom: 15px !important;
    }
    
    h3 {
        color: #000 !important;
        font-size: 18px !important;
        margin-top: 20px !important;
        margin-bottom: 12px !important;
        page-break-after: avoid;
    }
    
    /* Result highlight */
    .slc-result-highlight,
    .Slres {
        background: #00FF7F !important;
        color: #000 !important;
        padding: 12px 15px !important;
        font-size: 16px !important;
        page-break-after: avoid;
        display: block !important;
        margin: 15px 0 !important;
    }
    
    /* User data sections */
    .slc-user-data {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .slc-data-grid {
        page-break-inside: avoid;
        background: #f9f9f9 !important;
        border: 1px solid #ccc !important;
        padding: 15px !important;
        margin-bottom: 20px !important;
    }
    
    .slc-data-item {
        border-bottom: 1px solid #e0e0e0;
        page-break-inside: avoid;
        padding: 5px 0 !important;
    }
    
    .slc-data-item:last-child {
        border-bottom: none;
    }
    
    .slc-data-label {
        font-weight: bold !important;
    }
    
    /* Product section */
    .slc-products {
        page-break-before: auto;
        margin-top: 25px;
    }
    
    .slc-product-header {
        background: #e8e8e8 !important;
        border: 1px solid #999 !important;
        page-break-after: avoid;
        display: flex !important;
    }
    
    .slc-distance-label {
        font-weight: bold !important;
        background: #e8e8e8 !important;
    }
    
    /* Product items */
    .slc-product-item {
        page-break-inside: avoid;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        background: #f5f5f5 !important;
        margin-bottom: 10px;
        display: flex !important;
    }
    
    .slc-product-info {
        padding: 10px !important;
    }
    
    .slc-product-art {
        font-weight: bold !important;
    }
    
    .slc-product-desc {
        line-height: 1.6 !important;
        margin: 8px 0 !important;
    }
    
    .slc-product-need {
        border-top: 1px solid #ccc !important;
        padding-top: 8px !important;
        margin-top: 8px !important;
    }
    
    /* Load values */
    .slc-product-loads {
        display: flex !important;
    }
    
    .slc-load-value {
        border-left: 1px solid #ddd !important;
        background: white !important;
        display: flex !important;
    }
    
    .slc-load-value.ok {
        background: #00FF7F !important;
        font-weight: bold !important;
    }
    
    /* Ensure line breaks in product descriptions are visible */
    .slc-product-desc br {
        display: block;
        content: "";
        margin: 3px 0;
    }
    
    /* Hide map and interactive elements in print */
    .slc-map-container,
    .slc-address-section,
    .slc-zone-lookup,
    .slc-success,
    .slc-error {
        display: none !important;
    }
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 1024px) {
    .slc-selection-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .slc-data-grid {
        grid-template-columns: 1fr;
    }
    
    .slc-product-item {
        flex-direction: column;
    }
    
    .slc-product-loads {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start
    }
}

@media (max-width: 768px) {
    /* Map responsive */
    .slc-map {
        height: 300px;
    }
    
    .slc-map-container,
    .slc-address-section {
        padding: 15px;
    }
    
    .slc-form-grid {
        flex-direction: column;
    }
    
    .slc-form-group {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .slc-input {
        width: 100%;
        max-width: 200px;
    }
    
    .slc-selection-grid {
        grid-template-columns: 1fr;
    }
    
    .slc-form-row {
        flex-direction: column;
    }
    
    .slc-data-grid {
        grid-template-columns: 1fr;
    }
    
    .slc-data-item {
        grid-template-columns: 1fr;
    }
    
    .slc-product-header {
        flex-direction: column;
    }
    
    .slc-product-header-right {
        align-items: flex-start;
        margin-top: 10px;
    }
    
    .slc-distance-grid {
        justify-content: flex-start;
    }
    
    .slc-load-value,
    .slc-distance-label {
        min-width: 50px;
        font-size: 11px;
        padding: 6px 3px;
    }
}

@media (max-width: 480px) {
    .slc-button,
    .cssbutton {
        width: 100%;
    }
    
    .slc-zone-search {
        flex-direction: column;
    }
    
    .slc-zone-search button {
        width: 100%;
    }
    
    .slc-distance-label,
    .slc-load-value {
        width: auto;
        min-width: 45px;
        font-size: 10px;
        padding: 5px 2px;
    }
}