html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  max-width: 100%;
}

.main-content{
    padding-top: 64px; /* leave space for fixed navbar */
    overflow-x: hidden;
    max-width: 100%;
}

.btn-custom:hover {
    background: #1f024c;
    color: white;
}
/* Leaflet Map z-index fix - mapa nie może nachodzić na navbar */
.leaflet-container,
.leaflet-pane,
.leaflet-map-pane {
z-index: 1 !important;
}

.leaflet-control-container .leaflet-top,
.leaflet-control-container .leaflet-bottom {
z-index: 20 !important;
}

.leaflet-control {
z-index: 20 !important;
}

/* Popup i tooltip muszą być wyżej od kontrolek, ale niżej od navbara */
.leaflet-popup,
.leaflet-tooltip {
z-index: 25 !important;
}

/* Prevent zoom on input focus (iOS) - minimum 16px font-size */
@media screen and (max-width: 768px) {
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
textarea,
select,
.input,
.select,
.textarea {
font-size: 16px;
}
}

/* Messages Animation */
@keyframes slideInDown {
from {
transform: translateY(-100px);
opacity: 0;
}
to {
transform: translateY(0);
opacity: 1;
}
}

/* Django Messages */
.dj-messages-wrap {
position: fixed;
top: 80px;
left: 50%;
transform: translateX(-50%);
z-index: 10100;
width: 90%;
max-width: 640px;
display: flex;
flex-direction: column;
gap: 8px;
pointer-events: none;
}
.dj-alert {
display: flex;
align-items: center;
gap: 12px;
padding: 12px 16px;
border-radius: 10px;
border: 1px solid transparent;
box-shadow: 0 4px 24px rgba(0,0,0,.18);
font-size: 14px;
line-height: 1.5;
pointer-events: auto;
animation: dj-slide-in .22s ease;
}
@keyframes dj-slide-in {
from { opacity: 0; transform: translateY(-10px); }
to   { opacity: 1; transform: translateY(0); }
}
.dj-alert-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.dj-alert-error   { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.dj-alert-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.dj-alert-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }
.dj-alert-text    { flex: 1; }
.dj-alert-close {
background: none;
border: none;
cursor: pointer;
font-size: 18px;
line-height: 1;
padding: 0 2px;
color: inherit;
opacity: .6;
flex-shrink: 0;
}
.dj-alert-close:hover { opacity: 1; }

/* Cookie Consent Popup */
.cookie-consent {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
color: white;
padding: 20px;
box-shadow: 0 -5px 20px rgba(0,0,0,0.3);
z-index: 9999;
animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
from { transform: translateY(100%); }
to { transform: translateY(0); }
}

.cookie-consent-content {
max-width: 1200px;
margin: 0 auto;
display: flex;
align-items: center;
gap: 20px;
flex-wrap: wrap;
}

.cookie-icon {
font-size: 2.5rem;
color: #f39c12;
flex-shrink: 0;
}

.cookie-text {
flex: 1;
min-width: 300px;
}

.cookie-text h4 {
margin: 0 0 10px 0;
font-size: 1.2rem;
color: #ecf0f1;
}

.cookie-text p {
margin: 0;
line-height: 1.5;
color: #bdc3c7;
}

.cookie-text a {
color: #3498db;
text-decoration: underline;
}

.cookie-text a:hover {
color: #5dade2;
}

.cookie-buttons {
display: flex;
gap: 10px;
flex-wrap: wrap;
}

.btn-cookie {
padding: 12px 20px;
border: none;
border-radius: 25px;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
font-size: 0.9rem;
display: flex;
align-items: center;
}

.btn-accept {
background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
color: white;
}

.btn-accept:hover {
background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
transform: translateY(-2px);
}

.btn-reject {
background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
color: white;
}

.btn-reject:hover {
background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
transform: translateY(-2px);
}

.btn-customize {
background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
color: white;
}

.btn-customize:hover {
background: linear-gradient(135deg, #2980b9 0%, #3498db 100%);
transform: translateY(-2px);
}

/* Cookie Modal */
.cookie-modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.7);
z-index: 10000;
display: flex;
align-items: center;
justify-content: center;
animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}

.cookie-modal-content {
background: white;
border-radius: 15px;
max-width: 600px;
width: 90%;
max-height: 80vh;
overflow-y: auto;
box-shadow: 0 15px 35px rgba(0,0,0,0.3);
animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
from { transform: scale(0.9) translateY(-20px); }
to { transform: scale(1) translateY(0); }
}

/* Messages animation */
.message-slide-in {
animation: message-slide-in 0.4s ease-out;
}

@keyframes message-slide-in {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}

.cookie-modal-header {
padding: 25px 25px 15px 25px;
border-bottom: 1px solid #ecf0f1;
display: flex;
justify-content: space-between;
align-items: center;
}

.cookie-modal-header h3 {
margin: 0;
color: #2c3e50;
font-size: 1.3rem;
}

.close-modal {
background: none;
border: none;
font-size: 2rem;
color: #7f8c8d;
cursor: pointer;
padding: 0;
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
}

.close-modal:hover {
color: #e74c3c;
}

.cookie-modal-body {
padding: 20px 25px;
}

.cookie-category {
margin-bottom: 20px;
padding: 15px;
border: 1px solid #ecf0f1;
border-radius: 8px;
}

.cookie-category-header {
display: flex;
align-items: center;
margin-bottom: 10px;
}

.cookie-category-header input[type="checkbox"] {
margin-right: 10px;
transform: scale(1.2);
}

.cookie-category-header label {
font-weight: 600;
color: #2c3e50;
cursor: pointer;
}

.cookie-description {
color: #7f8c8d;
margin: 0;
font-size: 0.9rem;
line-height: 1.4;
}

.cookie-modal-footer {
padding: 15px 25px 25px 25px;
border-top: 1px solid #ecf0f1;
display: flex;
gap: 10px;
justify-content: flex-end;
}

/* Mobile Responsive */
@media (max-width: 768px) {
.cookie-consent-content {
flex-direction: column;
text-align: center;
}

.cookie-text {
min-width: auto;
}

.cookie-buttons {
justify-content: center;
}

.btn-cookie {
padding: 10px 16px;
font-size: 0.8rem;
}

.cookie-modal-content {
width: 95%;
}

.cookie-modal-footer {
flex-direction: column;
}
}

/* Help text w formularzach - mniejszy rozmiar */
.label-text-alt {
font-size: 0.7rem !important;
line-height: 1.3;
}

/* Help text w różnych miejscach */
.help-text,
form .text-xs.text-base-content\/70,
form .text-xs.text-base-content\/60,
.django-form .text-xs {
font-size: 0.7rem !important;
line-height: 1.3;
}

/* Opcjonalnie - lekko jaśniejszy kolor dla lepszej czytelności przy mniejszym tekście */
.label-text-alt,
.help-text {
opacity: 0.85;
}
