/* Modern Medimap.ch Styles */

:root {
    --primary-gradient: linear-gradient(135deg, #6c7b7f 0%, #5a6c7d 100%);
    --secondary-gradient: linear-gradient(135deg, #8b9dc3 0%, #7b8fa3 100%);
    --success-gradient: linear-gradient(135deg, #7ba7bc 0%, #5d8aa8 100%);
    --card-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.12);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ensure sidebar goes below main content up to tablet/desktop width */
@media (max-width: 1199.98px) {
    .mobile-container {
        display: flex;
        flex-direction: column !important;
    }
    .mobile-container > .main-content {
        order: -9999 !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    .mobile-container > .sidebar {
        order: 9999 !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Modern sidebar styles */
.sidebar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    min-height: 100vh;
    box-shadow: var(--card-shadow);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    border-right: 1px solid rgba(200, 200, 200, 0.3);
    transition: var(--transition);
}

/* Modern header for sidebar */
.sidebar-header {
    background: var(--primary-gradient);
    color: white;
    padding: 1.5rem;
    border-radius: 0;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    opacity: 0.9;
}

.sidebar-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.05);
    opacity: 0;
    transition: var(--transition);
}

.sidebar-header:hover::before {
    opacity: 1;
}

.sidebar-header h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (max-width: 767.98px) {
    .sidebar {
        min-height: 0;
        height: auto;
        position: relative;
        margin-bottom: 2rem;
        order: 2 !important;
        border-top: none;
        margin-top: 2rem;
        border-radius: var(--border-radius);
        margin-left: 1rem;
        margin-right: 1rem;
        width: calc(100% - 2rem);
        background: rgba(255, 255, 255, 0.98);
        padding: 1rem 0;
    }
    
    .main-content {
        order: 1 !important;
        padding: 1rem;
        width: 100%;
    }
    
    .mobile-container {
        display: flex;
        flex-direction: column !important;
        background: transparent;
    }
    
    .sidebar-header {
        padding: 1rem;
        border-radius: var(--border-radius) var(--border-radius) 0 0;
        margin-bottom: 0;
    }
    
    .sidebar-header h1 {
        font-size: 1.25rem;
    }
    
    .sidebar-header::after {
        content: " - Filtreler";
        font-size: 0.875rem;
        opacity: 0.9;
        margin-left: 0.5rem;
    }
    
    .sidebar-section {
        margin: 0.75rem 1rem !important;
    }
}

/* Modern scrollbar */
.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(240, 240, 240, 0.3);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 10px;
    transition: var(--transition);
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-gradient);
}

/* Modern section styling */
.sidebar-section {
    margin: 1rem;
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--border-radius);
    padding: 1rem;
    backdrop-filter: blur(3px);
    border: 1px solid rgba(220, 220, 220, 0.4);
    transition: var(--transition);
}

.sidebar-section:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

.sidebar-section h2 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #4a5568;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section h2 i {
    color: #6c757d;
}

/* Modern list items */
.list-group-item-action {
    border: none;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    background: rgba(248, 249, 250, 0.8);
    transition: var(--transition);
    padding: 0.75rem;
}

.list-group-item-action:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateX(3px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.list-group-item-action:active {
    transform: translateX(3px);
}

/* Modern buttons */
.btn {
    border-radius: 25px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: var(--transition);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--primary-gradient);
    box-shadow: 0 2px 8px rgba(108, 123, 127, 0.2);
    opacity: 0.9;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 123, 127, 0.25);
    opacity: 1;
}

.btn-outline-primary {
    border: 1px solid #6c7b7f;
    color: #6c7b7f;
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-gradient);
    color: white;
    transform: translateY(-1px);
    opacity: 0.9;
}

.btn-outline-secondary {
    background: rgba(248, 249, 250, 0.9);
    color: #6c757d;
    border: 1px solid rgba(220, 220, 220, 0.5);
    backdrop-filter: blur(2px);
}

.btn-outline-secondary:hover {
    background: #e9ecef;
    color: #495057;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.btn-sm {
    padding: 0.375rem 1rem;
    font-size: 0.825rem;
}

/* Modern map container */
.leaflet-container {
    border-radius: var(--border-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

/* Modern badges */
.badge {
    border-radius: 20px;
    font-weight: 500;
    padding: 0.35rem 0.8rem;
    font-size: 0.75rem;
}

.badge.bg-primary {
    background: #6c7b7f !important;
    border: none;
    opacity: 0.9;
}

.badge.bg-secondary {
    background: linear-gradient(135deg, #a8a8a8 0%, #7d7d7d 100%) !important;
    border: none;
}

/* Status badges for opening hours */
.status-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.4rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: var(--transition);
    min-width: 65px;
    text-align: center;
}

.status-badge.bg-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%) !important;
    color: white;
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3);
}

.status-badge.bg-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e74c3c 100%) !important;
    color: white;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.status-badge.bg-secondary {
    background: #6c757d !important;
    color: white;
}

/* Small status badge for opening hours table */
.status-badge-small {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.3rem 0.5rem;
    border-radius: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 60px;
    text-align: center;
}

/* Modern cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(5px);
    box-shadow: var(--card-shadow);
    transition: var(--transition);
    overflow: hidden;
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: #6c7b7f;
    transform: scaleX(0);
    transition: var(--transition);
    opacity: 0.7;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--card-shadow-hover);
}

.card:hover::before {
    transform: scaleX(1);
}

.card-header {
    background: rgba(255, 255, 255, 0.8);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: rgba(248, 249, 250, 0.8);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem 1.5rem;
}

/* Modern markers */
.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 3px solid white;
    transition: var(--transition);
}

.custom-marker.open {
    background: #28a745;
    opacity: 0.9;
}

.custom-marker.closed {
    background: #dc3545;
    opacity: 0.9;
}

.custom-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* Modern language selector */
.language-selector {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.language-selector .btn {
    min-width: 45px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modern footer */
footer {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(3px);
    border-top: 1px solid rgba(220, 220, 220, 0.3);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.03);
}

/* Main content improvements */
.main-content {
    background: transparent;
    padding: 2rem;
}

/* Modern form controls */
.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid rgba(220, 220, 220, 0.5);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(2px);
    transition: var(--transition);
    padding: 0.75rem 1rem;
}

.form-control:focus, .form-select:focus {
    border-color: #6c7b7f;
    box-shadow: 0 0 0 0.15rem rgba(108, 123, 127, 0.15);
    background: white;
}

/* Responsive grid improvements */
@media (max-width: 575.98px) {
    .main-content {
        padding: 1rem 0.5rem;
    }
    
    .card {
        margin: 0.5rem;
    }
    
    .sidebar-section {
        margin: 0.5rem;
    }
    
    .row {
        flex-direction: column;
    }
    
    .col-md-6 {
        width: 100%;
    }
}

/* Loading animation */
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.loading-shimmer {
    position: relative;
    overflow: hidden;
}

.loading-shimmer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: shimmer 1.5s infinite;
}

/* Smooth page transitions */
.page-transition {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modern search form */
.search-form {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(3px);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(220, 220, 220, 0.4);
}

/* Glassmorphism effect for containers */
.glass-container {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(2px);
    border-radius: var(--border-radius);
    border: 1px solid rgba(220, 220, 220, 0.3);
    box-shadow: var(--card-shadow);
}

/* --- Pharmacy Detail Page --- */

.pharmacy-card .status-badge {
    flex-shrink: 0; /* Prevents the badge from shrinking if the title is long */
}

/* Mobile map height optimization */
@media (max-width: 767.98px) {
    #map {
        height: 300px !important;
    }
}

.opening-hours-list .list-group-item {
    background: transparent;
    border-color: rgba(0, 0, 0, 0.05);
    padding: 0.75rem 0.25rem;
}

.opening-hours-list .list-group-item:first-child {
    border-top: none;
}

.opening-hours-list .list-group-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.opening-hours-list .list-group-item span:first-child {
    color: #6c757d; /* Muted color for the day */
}

.opening-hours-list .list-group-item.text-primary,
.opening-hours-list .list-group-item.text-primary span {
    color: #6366f1 !important; /* Use a color from the logo gradient */
}

/* --- FINAL MOBILE ORDER ENFORCEMENT --- */
@media (max-width: 1199.98px) {
    .row.mobile-container {
        display: flex !important;
        flex-direction: column !important;
    }
    .row.mobile-container > main.main-content {
        order: -100000 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
    .row.mobile-container > div.sidebar {
        order: 100000 !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
    }
}
