/**
 * Custom Styles for codpostal.h28.ro
 * Romanian Postal Code Directory
 */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-gray: #f8f9fa;
    --border-color: #dee2e6;
    --text-muted: #6c757d;
}

/* Global Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: #212529;
    background-color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* Header Styles */
header {
    background-color: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

header img {
    transition: transform 0.3s ease;
}

header img:hover {
    transform: scale(1.05);
}

/* Search Container */
.search-container {
    padding: 3rem 0;
}

.search-box {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-box .input-group {
    border-radius: 50px;
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.search-box .input-group:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.search-box .input-group-text {
    border: none;
    padding: 0.75rem 1rem;
}

.search-box .form-control {
    border: none;
    padding: 0.75rem 1rem;
    font-size: 1.1rem;
}

.search-box .form-control:focus {
    box-shadow: none;
    outline: none;
}

/* Autocomplete Results */
.ui-autocomplete {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    margin-top: 0.5rem;
    background: white;
    z-index: 1000;
}

.ui-menu-item {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ui-menu-item .ui-menu-item-wrapper {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--light-gray);
    transition: background-color 0.2s ease;
}

.ui-menu-item:last-child .ui-menu-item-wrapper {
    border-bottom: none;
}

.ui-menu-item .ui-menu-item-wrapper:hover,
.ui-menu-item .ui-menu-item-wrapper.ui-state-active {
    background-color: var(--light-gray);
}

.autocomplete-item {
    display: flex;
    flex-direction: column;
}

.autocomplete-item .fw-semibold {
    color: #212529;
    margin-bottom: 4px;
}

.autocomplete-item small {
    font-size: 0.875rem;
}

/* Search Tips */
.search-tips {
    padding: 1rem;
    background-color: var(--light-gray);
    border-radius: 8px;
    max-width: 600px;
    margin: 0 auto;
}

/* Feature Cards */
.feature-card {
    background: white;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    display: inline-block;
}

/* Result Page Styles */
.info-item {
    padding: 0.75rem;
    background-color: var(--light-gray);
    border-radius: 8px;
}

/* Button Styles */
.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    border-radius: 8px;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(13, 110, 253, 0.3);
}

.btn-success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn-success:hover {
    background-color: #157347;
    border-color: #146c43;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(25, 135, 84, 0.3);
}

/* Card Styles */
.card {
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.card-body {
    padding: 1.5rem;
}

/* Weather Widget */
.weather-info {
    padding: 1rem 0;
}

.weather-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    display: block;
}

.temperature {
    color: var(--primary-color);
    font-weight: 700;
    margin: 0.5rem 0;
}

.weather-detail {
    background-color: var(--light-gray);
    padding: 0.5rem;
    border-radius: 6px;
    text-align: center;
}

/* Map Styles */
#map {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

/* Footer Styles */
footer {
    margin-top: auto;
    background-color: var(--light-gray);
    border-top: 1px solid var(--border-color);
}

footer p, footer small {
    margin: 0;
    color: var(--text-muted);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card, .feature-card {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .search-container {
        padding: 2rem 0;
    }
    
    .search-box .form-control {
        font-size: 1rem;
    }
    
    .display-3 {
        font-size: 3rem;
    }
    
    .btn-lg {
        padding: 0.625rem 1.25rem;
        font-size: 1rem;
    }
    
    .d-grid.gap-2 {
        gap: 0.75rem !important;
    }
    
    #map {
        height: 250px;
    }
}

@media (max-width: 576px) {
    .search-box {
        padding: 0 1rem;
    }
    
    .feature-card {
        margin-bottom: 1rem;
    }
    
    .display-3 {
        font-size: 2.5rem;
    }
}

/* Loading State */
.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Utility Classes */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
}

.text-capitalize {
    text-transform: capitalize;
}

/* Print Styles */
@media print {
    header, footer, .btn, .weather-info, #map {
        display: none !important;
    }
    
    .card {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    body {
        background: white;
    }
}
