/* eCommerce.eZWM.pl - Main Index Styles */

:root {
    --bs-primary: #2055a4;
    --bs-primary-rgb: 32, 85, 164;
}

* {
    font-family: 'Roboto Condensed', sans-serif;
}

/* Bootstrap Primary Button Overrides */
.btn-primary {
    --bs-btn-bg: #2055a4;
    --bs-btn-border-color: #2055a4;
    --bs-btn-hover-bg: #1a4689;
    --bs-btn-hover-border-color: #1a4689;
    --bs-btn-active-bg: #153b75;
    --bs-btn-active-border-color: #153b75;
}

.btn-outline-primary {
    --bs-btn-color: #2055a4;
    --bs-btn-border-color: #2055a4;
    --bs-btn-hover-bg: #2055a4;
    --bs-btn-hover-border-color: #2055a4;
    --bs-btn-active-bg: #1a4689;
    --bs-btn-active-border-color: #1a4689;
}

.text-primary {
    color: #2055a4 !important;
}

.bg-primary {
    background-color: #2055a4 !important;
}

/* General Layout */
body {
    background: white;
}

/* Header Section */
.header-container {
    background: var(--bs-primary);
    color: white;
    padding: 8px 0;
    margin-bottom: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
}

/* Animated background with squares */
.header-container::before {
    content: '';
    position: absolute;
    top: -30px;
    left: -30px;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(255,255,255,0.08) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(255,255,255,0.08) 75%);
    background-size: 30px 30px;
    background-position: 0 0, 0 15px, 15px -15px, -15px 0px;
    animation: moveSquares 25s linear infinite;
    z-index: 1;
}

.header-container .container {
    position: relative;
    z-index: 2;
}

@keyframes moveSquares {
    0% {
        transform: translateX(0) translateY(0);
    }
    100% {
        transform: translateX(30px) translateY(30px);
    }
}

/* Search Form */
.search-form {
    background: white;
    padding: 20px 0;
    margin: 20px 0;
}

/* Results Container */
.results-container {
    margin: 2rem 0;
    min-height: 400px;
    border: 3px dashed #dee2e6;
    border-radius: 15px;
    background: white;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.results-container.loaded {
    border-color: #28a745;
    border-style: solid;
    box-shadow: 0 0 20px rgba(40, 167, 69, 0.2);
}

.placeholder-text {
    color: #6c757d;
    font-size: 1.1rem;
    text-align: center;
    padding: 2rem;
}

/* Coordinates Display */
.coordinates-display {
    background: #e9ecef;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #495057;
    margin-top: 0.5rem;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2055a4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Geolocation Button */
.btn-geo {
    width: 40px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-width: 1px !important;
    font-weight: 400;
    box-sizing: border-box;
}

.btn-geo:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* Form Elements */
.form-text {
    font-size: 0.75rem;
}

.search-actions {
    border-top: 1px solid #e9ecef;
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

/* Typography */
h1 {
    font-weight: 700;
    font-size: 2.5rem;
}

h2 {
    font-weight: 700;
    font-size: 1.8rem;
}

.form-label {
    font-weight: 400;
}

/* Button Variants */
.btn-info {
    --bs-btn-bg: #17a2b8;
    --bs-btn-border-color: #17a2b8;
    --bs-btn-hover-bg: #138496;
    --bs-btn-hover-border-color: #117a8b;
    --bs-btn-active-bg: #0f6674;
    --bs-btn-active-border-color: #0e5c69;
}

/* Autocomplete Styling */
.autocomplete-dropdown {
    font-size: 0.9rem;
}

.autocomplete-option:last-child {
    border-bottom: none !important;
}

.autocomplete-option:hover,
.autocomplete-option.autocomplete-selected {
    background-color: #e3f2fd !important;
}

.autocomplete-loading {
    font-size: 0.85rem;
}

/* Input focus state when autocomplete is active */
.input-group:has(.autocomplete-dropdown) .form-control {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* Form Controls */
.form-control,
.form-select {
    box-sizing: border-box;
}

.form-control:focus,
.form-select:focus {
    box-shadow: none !important;
    outline: none !important;
}

.form-control::placeholder {
    color: #adb5bd !important;
    opacity: 1;
}

.form-control:focus::placeholder {
    color: #ced4da !important;
}

/* Results Layout Styles */
.results-layout {
    visibility: hidden;
    position: absolute;
    top: -9999px;
    margin-top: 2rem;
}

.results-layout.active {
    visibility: visible;
    position: static;
    top: auto;
    display: block;
}

.results-layout .row {
    margin: 0;
    border: 2px solid var(--bs-primary);
    border-radius: 8px;
    overflow: hidden;
    height: 600px;
    box-shadow: 0 4px 12px rgba(32, 85, 164, 0.15);
}

.results-layout .col-lg-8,
.results-layout .col-lg-4 {
    padding: 0;
}

/* Shops List Panel */
.shops-list-panel {
    background: white;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    border-left: 1px solid #dee2e6;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 300px;
    flex-shrink: 0;
}

.shops-list-header {
    background: white;
    color: #2055a4;
    padding: 0.4rem;
    margin: 0;
    border-bottom: 1px solid #dee2e6;
    flex-shrink: 0;
}

.shops-list-header h5 {
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0;
}

.shops-list-content {
    flex: 1;
    overflow-y: auto;
    padding: 0.15rem;
}

/* Map Container */
.map-container {
    background: white;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    border: none;
    height: 100%;
    flex: 1;
}

#mapComponent {
    width: 100%;
    height: 100%;
    border-radius: 0;
}

/* Shop Items */
.shop-item {
    padding: 0.35rem;
    border-radius: 4px;
    margin-bottom: 0.15rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.shop-item:hover {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.shop-item.selected {
    background-color: #e3f2fd;
    border-color: #2055a4;
}

.shop-name {
    font-weight: 500;
    color: #212529;
    margin-bottom: 0.1rem;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-address {
    color: #6c757d;
    font-size: 0.75rem;
    margin-bottom: 0.1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.shop-distance {
    color: #28a745;
    font-weight: 500;
    font-size: 0.75rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.shop-services {
    display: flex;
    flex-wrap: wrap;
    gap: 0.1rem;
    flex-shrink: 0;
}

.shop-services-distance {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: 0.2rem;
    gap: 0.3rem;
}

.service-badge {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 0.05rem 0.25rem;
    border-radius: 2px;
    font-size: 0.6rem;
    white-space: nowrap;
}

.no-shops-message {
    text-align: center;
    color: #6c757d;
    padding: 2rem;
}

/* Route Button */
.route-button {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.route-button:hover {
    background: #218838;
    color: white;
    text-decoration: none;
}

/* Header styles */
.header-container {
    background: var(--bs-primary);
    color: white;
    padding: 8px 0;
    box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    margin-bottom: 0;
}

/* Secondary Navigation styles */
.secondary-nav {
    background: white;
    padding: 3px 0;
    border-bottom: 1px solid #e9ecef;
}

.nav-links-left,
.nav-links-right {
    display: flex;
    align-items: center;
    gap: 25px;
}

.nav-links-right {
    justify-content: flex-end;
}

.nav-link {
    color: rgba(32, 85, 164, 0.6);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
    white-space: nowrap;
    padding: 2px 0;
}

.nav-link i {
    margin-right: 4px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--bs-primary);
    text-decoration: none;
}

.nav-separator {
    height: 2px;
    background: var(--bs-primary);
    width: 100%;
    margin-top: 3px;
}

@media (max-width: 768px) {
    .header-container .row {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .header-links {
        justify-content: center;
    }
    
    .header-link {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    /* Search form styles */
    .search-form {
        padding: 20px;
        margin: 20px 0;
    }

    .header-actions {
        margin-top: 15px;
        width: 100%;
        justify-content: center;
    }
    
    .header-actions .btn {
        flex: 1;
        min-width: 100px;
    }

    .header-nav-links {
        justify-content: center;
        margin-top: 15px;
        gap: 15px;
    }
    
    .header-nav-link {
        font-size: 0.8rem;
    }
}

/* Button States */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary:disabled {
    background-color: rgba(32, 85, 164, 0.6) !important;
    border-color: rgba(32, 85, 164, 0.6) !important;
    color: rgba(255, 255, 255, 0.8) !important;
}

.form-control:disabled {
    background-color: #f8f9fa !important;
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    border-color: #dee2e6 !important;
}

.form-control:disabled::placeholder {
    color: #6c757d !important;
    opacity: 0.8 !important;
    font-style: italic;
}

/* Transitions for smooth state changes */
.form-control {
    transition: opacity 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}