/* Base Styles */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    color: #333;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    overflow-x: hidden;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.auth-buttons button {
    margin-left: 1rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

#login-btn {
    background-color: #3498db;
    color: white;
}

#logout-btn {
    background-color: #e74c3c;
    color: white;
}

#logout-btn:hover {
    background-color: #c0392b;
}

#back-to-home {
    background-color: #95a5a6;
    color: white;
}

#back-to-home:hover {
    background-color: #7f8c8d;
}

#subscribe-btn {
    background-color: #e74c3c;
    color: white;
}

#subscribe-btn:hover {
    background-color: #c0392b;
}

#profile-btn {
    background-color: #3498db;
    color: white;
}

#profile-btn:hover {
    background-color: #2980b9;
}

.period-selector {
    display: flex;
    justify-content: center;
    background-color: #34495e;
    padding: 1rem;
}

.period-btn {
    padding: 0.8rem 1.5rem;
    margin: 0 0.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.period-btn.active {
    background-color: #e74c3c;
    color: white;
}

.period-btn:not(.active) {
    background-color: #ecf0f1;
    color: #2c3e50;
}

.timeline-container {
    background-color: white;
    padding: 2rem;
    margin: 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.year-input-container {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.filter-container {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.filter-container label {
    font-weight: bold;
}

.tag-filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 0.5rem;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-width: 600px;
}

.tag-checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.tag-checkbox-item:hover {
    background-color: #e8f4f8;
}

.tag-checkbox-item input[type="checkbox"] {
    cursor: pointer;
    margin: 0;
}

.tag-checkbox-item label {
    cursor: pointer;
    margin: 0;
    font-weight: normal;
    font-size: 0.9rem;
}

.filter-container select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
}

.location-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.location-filter label {
    font-weight: bold;
}

.location-filter select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    font-size: 0.9rem;
    min-width: 200px;
}

.infrastructure-filter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.infrastructure-filter label {
    font-weight: bold;
}

.infrastructure-filter select {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    font-size: 0.9rem;
    min-width: 200px;
}

.infrastructure-marker {
    cursor: pointer;
    transition: transform 0.2s;
}

.infrastructure-marker:hover {
    transform: scale(1.2);
}

#clear-selection-btn {
    padding: 0.5rem 1rem;
    background-color: #95a5a6;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

#clear-selection-btn:hover {
    background-color: #7f8c8d;
}

#toggle-distance-mode {
    padding: 0.5rem 1rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

#toggle-distance-mode:hover {
    background-color: #2980b9;
}

#distance-info {
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.distance-label {
    z-index: 1000;
}

#year-input {
    width: 200px;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

#date-input {
    width: 200px;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

#go-btn {
    padding: 0.8rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

#go-btn:hover {
    background-color: #2980b9;
}

#reset-year-btn {
    padding: 0.8rem 1.5rem;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

#reset-year-btn:hover {
    background-color: #c0392b;
}

/* Slideshow Controls */
.slideshow-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
    background-color: #f9f9f9;
    padding: 0.8rem 1.2rem;
    border-radius: 8px;
    border: 2px solid #3498db;
    flex-wrap: wrap;
}

.slideshow-btn {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.slideshow-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
}

.slideshow-btn:active {
    transform: scale(0.95);
}

.timer-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.timer-controls label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
}

#slideshow-timer {
    width: 70px;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    text-align: center;
}

.timer-controls span {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.slideshow-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

#slideshow-status-text {
    font-size: 0.9rem;
    color: #7f8c8d;
    font-weight: 500;
}

.slideshow-status.playing #slideshow-status-text {
    color: #27ae60;
    font-weight: 600;
}


.slider-container {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

#timeline-slider {
    width: 100%;
    height: 10px;
    -webkit-appearance: none;
    appearance: none;
    background: #ddd;
    border-radius: 5px;
    outline: none;
}

#timeline-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #e74c3c;
    border-radius: 50%;
    cursor: pointer;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
    color: #7f8c8d;
}

.content-container {
    display: flex;
    margin: 1rem;
    height: 60vh;
}

.map-container {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-right: 1rem;
    position: relative;
    min-height: 400px;
}

/* Leaflet attribution z-index fix */
.leaflet-control-attribution {
    z-index: 1 !important;
}

/* Area event center marker styling */
.area-marker-icon {
    background: transparent !important;
    border: none !important;
    cursor: pointer;
}

.area-marker-icon:hover div {
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(52, 152, 219, 0.6) !important;
}

.area-marker-icon div {
    transition: all 0.2s ease;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 8px;
}

.summary-container {
    flex: 1;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.language-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.language-selector label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.language-selector select {
    padding: 0.5rem 1rem;
    border: 1px solid #cbd5e0;
    border-radius: 4px;
    background-color: white;
    color: #2c3e50;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.language-selector select:hover {
    border-color: #3498db;
}

.language-selector select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#event-title {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

#event-tags {
    margin: 1rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background-color: #3498db;
    color: white;
    padding: 0.3rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
}

.media-container {
    margin-top: 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.media-item {
    max-width: 100%;
    border-radius: 4px;
}

.event-item {
    margin-bottom: 1.5rem;
    padding: 1rem;
    border-bottom: 1px solid #ecf0f1;
    cursor: pointer;
    transition: background-color 0.3s;
    border-radius: 4px;
}

.event-item:hover {
    background-color: #f8f9fa;
}

.event-item.selected {
    background-color: #e3f2fd;
    border-left: 4px solid #3498db;
    padding-left: 1rem;
}

.event-item:last-child {
    border-bottom: none;
}

.event-item h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.event-item .event-tags {
    margin: 0.5rem 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.event-item p {
    color: #555;
    line-height: 1.6;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 50%;
    max-width: 600px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close,
.close-login,
.close-register,
.close-subscription {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #7f8c8d;
    transition: color 0.3s;
}

.close:hover,
.close-login:hover,
.close-register:hover,
.close-subscription:hover {
    color: #2c3e50;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-weight: bold;
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background-color: #7f8c8d;
}

.error-message {
    color: #e74c3c;
    margin-top: 1rem;
    padding: 0.5rem;
    background-color: #fadbd8;
    border-radius: 4px;
    display: none;
}

.error-message:not(:empty) {
    display: block;
}

.success-message {
    color: #27ae60;
    margin-top: 1rem;
    padding: 0.5rem;
    background-color: #d5f4e6;
    border-radius: 4px;
    display: none;
}

.success-message:not(:empty) {
    display: block;
}

/* Subscription Plan Styles */
.subscription-plans {
    display: flex;
    justify-content: space-between;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.plan {
    background-color: #ecf0f1;
    padding: 1.5rem;
    border-radius: 8px;
    width: 48%;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.plan:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.plan.featured {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.plan.featured .price,
.plan.featured h3 {
    color: white;
}

.badge {
    position: absolute;
    top: -10px;
    right: 10px;
    background-color: #f39c12;
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.plan h3 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.plan .price {
    font-size: 1.8rem;
    font-weight: bold;
    color: #3498db;
    margin: 0.5rem 0;
}

.plan .savings {
    color: #27ae60;
    font-weight: bold;
    margin: 0.5rem 0;
}

.plan.featured .savings {
    color: #f1c40f;
}

.plan .features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
    text-align: left;
}

.plan .features li {
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0,0,0,0.1);
}

.plan .features li:before {
    content: "✓ ";
    color: #27ae60;
    font-weight: bold;
    margin-right: 0.5rem;
}

.plan.featured .features li:before {
    color: #f1c40f;
}

.subscribe-plan {
    background-color: #2ecc71;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 1rem;
    font-weight: bold;
    font-size: 1rem;
    transition: all 0.3s;
    width: 100%;
}

.subscribe-plan:hover {
    background-color: #27ae60;
    transform: scale(1.05);
}

.plan.featured .subscribe-plan {
    background-color: #f39c12;
}

.plan.featured .subscribe-plan:hover {
    background-color: #e67e22;
}

/* Profile Button and Modal Styles */
#profile-btn {
    background-color: #16a085;
    color: white;
}

#profile-btn:hover {
    background-color: #1abc9c;
}

.profile-modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

.profile-container {
    padding: 1rem 0;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    margin-bottom: 2rem;
    color: white;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: bold;
    border: 3px solid white;
}

.profile-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
}

.profile-info p {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
}

.profile-section {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border-left: 4px solid #3498db;
}

.section-title {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.2rem;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row:last-child {
    margin-bottom: 0;
}

.profile-section .form-group {
    margin-bottom: 0;
}

.profile-section textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
}

.profile-section textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.profile-section input[type="text"],
.profile-section input[type="email"],
.profile-section input[type="tel"],
.profile-section input[type="number"],
.profile-section input[type="date"],
.profile-section select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.profile-section input[type="text"]:disabled {
    background-color: #ecf0f1;
    cursor: not-allowed;
    color: #7f8c8d;
}

.profile-section input:focus,
.profile-section select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.success-message {
    color: #27ae60;
    background-color: #d5f4e6;
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 1rem;
    display: none;
}

.success-message:not(:empty) {
    display: block;
}

/* Profile Page Styles */
.profile-page-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.profile-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 2rem;
}

.profile-content h2 {
    color: #2c3e50;
    margin-top: 0;
    margin-bottom: 2rem;
    font-size: 2rem;
    text-align: center;
}

/* Responsive Profile Styles */
@media (max-width: 768px) {
    .profile-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .profile-header {
        flex-direction: column;
        text-align: center;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .profile-section {
        padding: 1rem;
    }
    
    .profile-page-container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .profile-content {
        padding: 1rem;
    }
    
    .profile-content h2 {
        font-size: 1.5rem;
    }
}

/* Mobile Controls Toggle Button */
.mobile-controls-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    align-items: center;
    gap: 8px;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(102, 126, 234, 0.6), 0 0 0 8px rgba(102, 126, 234, 0.1);
    }
}

.mobile-controls-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    animation: none;
}

.mobile-controls-toggle:active {
    transform: scale(0.95);
}

.toggle-icon {
    font-size: 20px;
}

.toggle-text {
    font-size: 14px;
}

.controls-wrapper {
    position: relative;
}

.close-controls-btn {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 1002;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    align-items: center;
    justify-content: center;
}

.close-controls-btn:hover {
    background-color: #c0392b;
    transform: rotate(90deg) scale(1.1);
}

.close-controls-btn:active {
    transform: rotate(90deg) scale(0.95);
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    position: relative;
    z-index: 1001;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 28px;
}

.hamburger-icon span {
    display: block;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-icon span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile menu backdrop */
.auth-buttons::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: -1;
}

.auth-buttons.active::before {
    opacity: 1;
    visibility: visible;
}

/* Responsive Design - Tablet */
@media (max-width: 1024px) {
    .timeline-container {
        padding: 1.5rem;
        margin: 0.75rem;
    }
    
    .content-container {
        margin: 0.75rem;
        height: auto;
        flex-direction: column;
    }
    
    .map-container {
        height: 450px;
        min-height: 450px;
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .slideshow-controls {
        flex-wrap: wrap;
        padding: 0.6rem 1rem;
    }
    
    .filter-container {
        padding: 0 0.5rem;
    }
    
    .modal-content {
        width: 85%;
    }
    
    /* Keep controls wrapper normal on tablet */
    .mobile-controls-toggle {
        display: none;
    }
    
    .controls-wrapper {
        position: relative;
        display: block;
    }
    
    /* Keep auth buttons normal on tablet */
    .mobile-menu-toggle {
        display: none;
    }
    
    .auth-buttons {
        position: static;
        flex-direction: row;
        width: auto;
        padding: 0;
        box-shadow: none;
        transform: none;
        background-color: transparent;
    }
    
    .auth-buttons button {
        width: auto;
        margin: 0 0 0 0.75rem;
        padding: 0.5rem 1rem;
        border-radius: 4px;
    }
    
    header {
        flex-wrap: wrap;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
}

/* Responsive Design - Mobile */
@media (max-width: 768px) {
    /* Show mobile controls toggle button */
    .mobile-controls-toggle {
        display: flex;
    }
    
    /* Show close button in overlay */
    .controls-wrapper.active .close-controls-btn {
        display: flex;
    }
    
    /* Hide controls by default on mobile */
    .controls-wrapper {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 1001;
        background-color: rgba(0, 0, 0, 0.95);
        display: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-top: 0;
    }
    
    .controls-wrapper.active {
        display: block;
        animation: fadeIn 0.3s ease;
    }
    
    .controls-wrapper .period-selector,
    .controls-wrapper .timeline-container {
        background-color: white;
        margin: 0;
        border-radius: 0;
    }
    
    .controls-wrapper .period-selector {
        padding-top: 4.5rem;
        position: sticky;
        top: 0;
        z-index: 10;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }
    
    .controls-wrapper .timeline-container {
        box-shadow: none;
        margin-bottom: 80px;
    }
    
    /* Hide header when controls overlay is open on mobile */
    header.controls-open {
        transform: translateY(-100%);
    }
    
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
    
    /* Header adjustments */
    header {
        padding: 0.8rem 1rem;
        flex-wrap: nowrap;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 999;
        transition: transform 0.3s ease;
    }
    
    header.header-hidden {
        transform: translateY(-100%);
    }
    
    /* Add padding to body to compensate for fixed header */
    body {
        padding-top: 60px;
    }
    
    header h1 {
        font-size: 1.3rem;
        margin: 0;
        flex: 1;
    }
    
    /* Show hamburger menu on mobile */
    .mobile-menu-toggle {
        display: block;
        order: 2;
    }
    
    /* Hide auth buttons by default on mobile */
    .auth-buttons {
        position: fixed;
        top: 60px;
        right: 0;
        background-color: #34495e;
        flex-direction: column;
        width: 220px;
        padding: 1rem 0;
        box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.3);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        border-bottom-left-radius: 8px;
    }
    
    /* Show backdrop on mobile */
    .auth-buttons::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        z-index: -1;
    }
    
    .auth-buttons.active::before {
        opacity: 1;
        visibility: visible;
    }
    
    .auth-buttons.active {
        transform: translateX(0);
    }
    
    .auth-buttons button {
        width: 100%;
        margin: 0.5rem 0;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        border-radius: 0;
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: flex-start;
    }
    
    .auth-buttons button:hover {
        background-color: rgba(0, 0, 0, 0.2);
    }
    
    /* Period selector - adjust for mobile overlay */
    .period-selector {
        flex-wrap: wrap;
        padding: 0.75rem 0.5rem;
        gap: 0.5rem;
        justify-content: center;
    }
    
    .controls-wrapper.active .period-selector {
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    .period-btn {
        margin: 0;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
        flex: 1 1 calc(50% - 0.5rem);
        min-width: 140px;
    }
    
    /* Timeline container */
    .timeline-container {
        padding: 1rem;
        margin: 0;
        border-radius: 0;
    }
    
    .controls-wrapper .timeline-container {
        background-color: white;
    }
    
    /* Year input and controls */
    .year-input-container {
        width: 100%;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    #year-input,
    #date-input {
        width: 100%;
        max-width: 100%;
        padding: 0.7rem;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    #go-btn,
    #reset-year-btn {
        width: 100%;
        padding: 0.7rem;
    }
    
    /* Slideshow controls */
    .slideshow-controls {
        width: 100%;
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }
    
    .slideshow-btn {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
    
    .timer-controls {
        width: 100%;
        justify-content: center;
    }
    
    #slideshow-timer {
        width: 60px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    .slideshow-status {
        width: 100%;
        justify-content: center;
    }
    
    /* Slider */
    .slider-container {
        width: 100%;
        min-width: 100%;
        margin-top: 0.5rem;
    }
    
    .slider-labels {
        font-size: 0.85rem;
    }
    
    /* Filter container */
    .filter-container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 0;
    }
    
    .filter-container > label {
        text-align: center;
    }
    
    .tag-filter-checkboxes {
        justify-content: center;
    }
    
    .location-filter,
    .infrastructure-filter {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .location-filter select,
    .infrastructure-filter select {
        width: 100%;
        min-width: 100%;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    #toggle-distance-mode,
    #clear-selection-btn {
        width: 100%;
        padding: 0.7rem;
    }
    
    /* Distance mode - show persistent controls in summary container when active */
    @media (max-width: 768px) {
        body.distance-mode-active #distance-info {
            position: sticky !important;
            top: 0;
            left: 0;
            right: 0;
            z-index: 13;
            display: flex !important;
            background-color: #fff3cd;
            padding: 0.4rem 0.5rem;
            border-radius: 0;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            margin: -0.75rem -0.75rem 0 -0.75rem;
            border-bottom: 2px solid #ffc107;
            font-size: 11px;
            align-items: center;
            justify-content: space-between;
            gap: 0.4rem;
            min-height: 36px;
            flex-wrap: nowrap;
        }
        
        body.distance-mode-active #distance-info p {
            margin: 0;
            font-size: 10px;
            color: #856404;
            line-height: 1.2;
            flex: 1;
        }
        
        body.distance-mode-active #distance-info div {
            display: flex;
            align-items: center;
            gap: 0.3rem;
        }
        
        /* Push language selector down when distance mode active */
        body.distance-mode-active .language-selector {
            top: 38px !important;
        }
        
        body.distance-mode-active #toggle-distance-mode {
            position: static;
            padding: 0.35rem 0.6rem;
            font-size: 10px;
            margin: 0;
            background-color: #dc3545;
            white-space: nowrap;
            border-radius: 4px;
            flex-shrink: 0;
            line-height: 1.2;
        }
    }
    
    /* Slideshow mode - show persistent controls in summary container when active */
    @media (max-width: 768px) {
        body.slideshow-active .slideshow-controls {
            position: sticky !important;
            top: 0;
            left: 0;
            right: 0;
            z-index: 12;
            background-color: #d1ecf1;
            padding: 0.4rem 0.5rem;
            border-radius: 0;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
            margin: -0.75rem -0.75rem 0 -0.75rem;
            border-bottom: 2px solid #17a2b8;
            min-height: 56px;
        }
        
        /* Push language selector down when slideshow active */
        body.slideshow-active .language-selector {
            top: 64px !important;
        }
        
        /* If both distance and slideshow are active */
        body.distance-mode-active.slideshow-active .language-selector {
            top: 102px !important;
        }
        
        body.distance-mode-active.slideshow-active #distance-info {
            z-index: 14;
        }
        
        body.distance-mode-active.slideshow-active .slideshow-controls {
            top: 38px !important;
            z-index: 13;
        }
        
        body.slideshow-active .slideshow-controls {
            flex-direction: row !important;
            justify-content: flex-start;
            align-items: center;
            gap: 0.35rem;
            flex-wrap: wrap;
        }
        
        body.slideshow-active .slideshow-btn {
            width: 30px;
            height: 30px;
            font-size: 12px;
            flex-shrink: 0;
        }
        
        body.slideshow-active .timer-controls {
            width: auto;
            padding: 0.2rem 0.35rem;
            flex: 0 1 auto;
            min-width: auto;
            gap: 0.25rem;
        }
        
        body.slideshow-active .timer-controls label {
            font-size: 9px;
        }
        
        body.slideshow-active #slideshow-timer {
            width: 35px;
            padding: 0.15rem;
            font-size: 11px;
        }
        
        body.slideshow-active .timer-controls span {
            font-size: 9px;
        }
        
        body.slideshow-active .slideshow-status {
            width: 100%;
            flex: 1 1 100%;
            order: 3;
            justify-content: center;
            margin-top: 0.15rem;
            padding-top: 0.15rem;
            border-top: 1px dashed #17a2b8;
        }
        
        body.slideshow-active #slideshow-status-text {
            font-size: 9px;
            font-weight: 600;
        }
    }
    
    /* Content container */
    .content-container {
        flex-direction: column;
        height: auto;
        margin: 0;
        padding: 0;
    }
    
    .map-container {
        margin-right: 0;
        margin-bottom: 0;
        height: 50vh;
        min-height: 50vh;
        width: 100%;
        border-radius: 0;
    }
    
    #map {
        height: 100%;
        width: 100%;
    }
    
    .summary-container {
        min-height: 50vh;
        max-height: 50vh;
        padding: 0.75rem;
        border-radius: 0;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        position: relative;
    }
    
    /* Create a sticky control panel at top of summary */
    .summary-container .language-selector {
        position: sticky;
        top: 0;
        z-index: 10;
        background-color: white;
        margin: -0.75rem -0.75rem 0.75rem -0.75rem;
        padding: 0.5rem;
        border-radius: 0;
        border: none;
        border-bottom: 2px solid #e0e0e0;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        min-height: 42px;
    }
    
    /* Ensure content below controls is properly spaced */
    body.distance-mode-active .summary-container #event-title,
    body.slideshow-active .summary-container #event-title {
        margin-top: 0.5rem;
    }
    
    /* Add extra margin when controls are active */
    body.distance-mode-active .summary-container #event-title {
        padding-top: 42px;
    }
    
    body.slideshow-active .summary-container #event-title {
        padding-top: 75px;
    }
    
    body.distance-mode-active.slideshow-active .summary-container #event-title {
        padding-top: 117px;
    }
    
    /* Language selector - compact horizontal layout */
    .language-selector {
        flex-direction: row;
        align-items: center;
        text-align: left;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    
    .language-selector label {
        font-size: 12px;
        white-space: nowrap;
    }
    
    .language-selector select {
        flex: 1;
        min-width: 120px;
        font-size: 14px;
        padding: 0.4rem 0.6rem;
    }
    
    /* Event items */
    #event-title {
        font-size: 1.3rem;
    }
    
    .event-item {
        padding: 0.75rem;
    }
    
    .event-item h3 {
        font-size: 1.1rem;
    }
    
    /* Media container */
    .media-container {
        gap: 0.5rem;
    }
    
    .media-item {
        width: 100%;
    }
    
    /* Modal styles */
    .modal-content {
        width: 95%;
        margin: 5% auto;
        padding: 1.5rem;
    }
    
    .close,
    .close-login,
    .close-register,
    .close-subscription {
        right: 1rem;
        top: 0.5rem;
    }
    
    /* Form elements */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* Subscription plans */
    .subscription-plans {
        flex-direction: column;
    }
    
    .plan {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Buttons */
    .btn-primary,
    .btn-secondary {
        width: 100%;
        padding: 0.75rem;
    }
}

/* Responsive Design - Extra Small Mobile */
@media (max-width: 480px) {
    header h1 {
        font-size: 1.2rem;
    }
    
    .auth-buttons button {
        padding: 0.35rem 0.6rem;
        font-size: 0.85rem;
    }
    
    .period-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
        min-width: 120px;
    }
    
    .timeline-container {
        padding: 0.75rem;
    }
    
    .map-container {
        height: 300px;
        min-height: 300px;
    }
    
    .slideshow-btn {
        width: 40px;
        height: 40px;
        font-size: 16px;
    }
    
    .timer-controls label,
    .timer-controls span {
        font-size: 0.85rem;
    }
    
    #slideshow-timer {
        width: 50px;
    }
    
    .slider-labels {
        font-size: 0.75rem;
    }
    
    #event-title {
        font-size: 1.1rem;
    }
    
    .event-item h3 {
        font-size: 1rem;
    }
    
    .modal-content {
        width: 98%;
        padding: 1rem;
    }
    
    .modal-content h2 {
        font-size: 1.3rem;
    }
}

/* Footer Styles */
.site-footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 2rem 1rem;
    margin-top: 3rem;
    border-top: 3px solid #34495e;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: #3498db;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #5dade2;
    text-decoration: underline;
}

.footer-credit {
    border-top: 1px solid #34495e;
    padding-top: 1rem;
}

.footer-credit p {
    margin: 0;
    font-size: 0.9rem;
    color: #bdc3c7;
}

.footer-credit strong {
    color: #ecf0f1;
    font-weight: 600;
}

@media (max-width: 600px) {
    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .footer-links a {
        font-size: 0.9rem;
    }
    
    .site-footer {
        padding: 1.5rem 1rem;
        margin-top: 2rem;
    }
}