/* === ZÁKLADNÁ VIZUÁLNA IDENTITA === */
:root {
    --primary-color: #007BFF; --primary-hover: #0056b3; --secondary-color: #6c757d;
    --accent-color: #FF8C00; --text-color: #343A40; --light-gray: #F8F9FA;
    --border-color: #DEE2E6; --success-color: #28a745; --danger-color: #dc3545;
    --font-heading: 'Nunito Sans', sans-serif; --font-body: 'Nunito Sans', sans-serif;
    --border-radius: 8px; --box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

/* === GLOBÁLNE ŠTÝLY A RESET === */
html { scroll-behavior: smooth; }
body { font-family: var(--font-body); margin: 0; background-color: var(--light-gray); color: var(--text-color); line-height: 1.6; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 600; }
a { color: var(--primary-color); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; height: auto; }

/* === HLAVIČKA A NAVIGÁCIA (Finálna opravená verzia) === */
.main-header { background-color: #fff; padding: 15px 0; box-shadow: 0 2px 10px rgba(0,0,0,0.05); border-bottom: 1px solid var(--border-color); position: sticky; top: 0; z-index: 900; }
.header-container { display: flex; justify-content: space-between; align-items: center; }
.logo { font-family: var(--font-heading); font-weight: 700; font-size: 1.8em; color: var(--text-color); z-index: 9999; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.mobile-nav-toggle { display: none; }
.main-nav { display: flex; align-items: center; gap: 20px; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.main-nav a { color: var(--text-color); font-weight: 500; white-space: nowrap; }
.welcome-message { font-weight: 600; color: var(--text-color); }
@media (max-width: 992px) {
    .welcome-message { display: none; }
    .mobile-nav-toggle { display: block; position: fixed; z-index: 9999; background-color: transparent; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.7)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: center; width: 2.5rem; aspect-ratio: 1; top: 1rem; right: 1.5rem; border: 0; cursor: pointer; }
    .mobile-nav-toggle[aria-expanded="true"] { background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(0, 0, 0, 0.7)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M6 6l18 18M6 24L24 6'/%3e%3c/svg%3e"); }
    .main-nav { position: fixed; z-index: 1000; inset: 0 0 0 30%; flex-direction: column; padding: min(20vh, 10rem) 2em; background: hsl(0 0% 100% / 0.95); backdrop-filter: blur(1rem); transform: translateX(100%); transition: transform 350ms ease-out; }
    .main-nav[data-visible="true"] { transform: translateX(0%); }
    .main-nav .nav-links { flex-direction: column; align-items: center; gap: 30px; }
    .main-nav .btn { width: 100%; text-align: center; }
}

/* === TLAČIDLÁ (BUTTONS) === */
.btn, .button-reserve, .hero-button, .button-cancel { display: inline-block; padding: 10px 20px; border-radius: var(--border-radius); font-family: var(--font-heading); font-weight: 500; text-align: center; cursor: pointer; border: none; transition: all 0.2s ease-in-out; }
.btn-primary, .button-reserve, .hero-button { background-color: var(--primary-color); color: white; }
.btn-primary:hover, .button-reserve:hover, .hero-button:hover { background-color: var(--primary-hover); color: white; transform: translateY(-2px); box-shadow: 0 4px 10px rgba(0, 123, 255, 0.3); }
.btn-secondary, .button-cancel { background-color: var(--secondary-color); color: white; }
.btn-secondary:hover, .button-cancel:hover { background-color: #5a6268; color: white; }
.btn-admin-link { padding: 5px 12px; border: 2px solid var(--accent-color); color: var(--accent-color); border-radius: 50px; font-weight: 600; font-size: 0.9em; margin: 0 10px; }
.btn-admin-link:hover { background-color: var(--accent-color); color: white; }

/* === HERO SEKCIA === */
.hero-section { background: linear-gradient(rgba(40, 50, 60, 0.6), rgba(40, 50, 60, 0.6)), url('/public/images/hero-background.jpg'); background-size: cover; background-position: center; color: white; text-align: center; padding: 120px 20px; margin: -20px -20px 40px -20px; }
.hero-content h1 { font-size: 3.2em; margin-bottom: 15px; border: none; }
.hero-content p { font-size: 1.3em; max-width: 650px; margin: 0 auto 30px auto; opacity: 0.9; }
.offer-section { padding-top: 20px; }
.offer-section h2 { text-align: center; font-size: 2.2em; margin-bottom: 40px; }

/* === FILTER FORM === */
.filter-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; padding: 25px; background-color: #fff; border-radius: var(--border-radius); box-shadow: var(--box-shadow); margin-bottom: 40px; }
.filter-group { display: flex; flex-direction: column; }
.filter-group label { font-weight: 600; margin-bottom: 8px; font-size: 0.9em; }

/* === KARTY PRODUKTOV === */
.items-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 25px; }
.item-card { background-color: #fff; border: 1px solid var(--border-color); border-radius: var(--border-radius); overflow: hidden; box-shadow: 0 2px 5px rgba(0,0,0,0.05); display: flex; flex-direction: column; transition: all 0.3s ease; color: var(--text-color); }
.item-card:hover { transform: translateY(-5px); box-shadow: var(--box-shadow); color: var(--text-color); }
.item-card img { width: 100%; height: 180px; object-fit: cover; }
.card-content { padding: 15px; display: flex; flex-direction: column; flex-grow: 1; }
.item-card h2 { font-size: 1.15em; margin: 0 0 5px 0; }
.item-card .price { margin: 0; font-size: 1em; }
.card-footer { margin-top: auto; padding-top: 10px; display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--light-gray); }
.item-card .deposit { margin: 0; color: #6c757d; font-size: 0.9em; }

/* === TOPOVANÉ INZERÁTY === */
.item-card--top { border: 2px solid var(--accent-color); background-color: #fffaf0; position: relative; }
.item-card--top:hover { border-color: var(--primary-hover); }
.top-badge { position: absolute; top: 10px; right: 10px; background-color: var(--accent-color); color: white; padding: 3px 10px; border-radius: 50px; font-size: 0.8em; font-weight: 700; z-index: 2; }

/* === POČET VIDENÍ === */
.item-views { font-size: 0.9em; color: var(--secondary-color); text-align: right; }
.item-views-detail { display: flex; align-items: center; gap: 8px; color: var(--secondary-color); margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.item-views-detail svg { flex-shrink: 0; }

/* === FORMULÁRE A STATICKÉ STRÁNKY === */
.auth-container, .form-container, .static-page-container, .profile-container, .chat-container, .admin-container { max-width: 800px; margin: 40px auto; background-color: #fff; padding: 30px 40px; border-radius: var(--border-radius); box-shadow: var(--box-shadow); }
.form-group { margin-bottom: 20px; }
.form-group label { display: block; margin-bottom: 8px; font-weight: 700; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 12px; border: 1px solid var(--border-color); border-radius: var(--border-radius); box-sizing: border-box; font-family: var(--font-body); font-size: 1em; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2); }
.form-group-inline { display: flex; gap: 20px; }
.form-group-inline .form-group { flex: 1; }
.auth-form button { width: 100%; padding: 12px; }
.auth-switch { text-align: center; margin-top: 20px; }
.faq-item { border-bottom: 1px solid var(--border-color); padding: 20px 0; }
.faq-item:last-child { border-bottom: none; }
.static-page-container h3, .faq-question { margin-top: 30px; font-size: 1.3em; }

/* === DETAIL PRODUKTU === */
.item-detail-container { display: flex; flex-wrap: wrap; gap: 40px; }
.item-image { flex: 1; min-width: 300px; }
.item-info { flex: 2; min-width: 300px; }
.status { padding: 5px 12px; border-radius: 50px; color: white; display: inline-block; font-size: 0.9em; font-weight: 700; }
.status-available { background-color: var(--success-color); }
.status-unavailable { background-color: var(--secondary-color); }
.owner-info { margin-top: 30px; padding-top: 20px; border-top: 1px solid #eee; }
.owner-rating { display: flex; align-items: center; gap: 8px; }
.login-prompt-buttons { margin-top: 20px; display: flex; gap: 15px; }
.login-prompt-buttons a { flex: 1; text-align: center; text-decoration: none; }
.back-button { display: inline-block; margin-top: 20px; }

/* === MODÁLNE OKNÁ === */
.modal__overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); display: flex; justify-content: center; align-items: center; z-index: 1000; }
.modal__container { background-color: #fff; padding: 30px; max-width: 500px; width: 100%; border-radius: var(--border-radius); box-shadow: 0 10px 30px rgba(0,0,0,0.2); position: relative; }
.modal__header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border-color); padding-bottom: 15px; margin-bottom: 20px; }
.modal__title { margin: 0; font-size: 1.5em; }
.modal__close { background: transparent; border: 0; cursor: pointer; width: 25px; height: 25px; position: relative; }
.modal__close:before, .modal__close:after { content: ''; position: absolute; top: 12px; left: 2px; width: 20px; height: 2px; background-color: var(--secondary-color); }
.modal__close:before { transform: rotate(45deg); } .modal__close:after { transform: rotate(-45deg); }
.modal__error { color: var(--danger-color); margin-bottom: 15px; text-align: center; font-weight: bold; min-height: 20px; }
.modal[aria-hidden="true"] { display: none; }

/* === SUPER-ADMIN SEKCIA === */
.admin-table { width: 100%; border-collapse: collapse; background-color: #fff; box-shadow: var(--box-shadow); border-radius: var(--border-radius); overflow: hidden; margin-bottom: 30px;}
.admin-table th, .admin-table td { padding: 15px; border-bottom: 1px solid var(--border-color); text-align: left; }
.admin-table th { background-color: var(--light-gray); font-family: var(--font-heading); }
.actions a { margin-right: 10px; } .edit-btn { color: #ffc107; } .delete-btn { color: var(--danger-color); } .confirm-btn { color: var(--success-color); }
.admin-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid #eee; padding-bottom: 10px; margin-bottom: 20px; }
.dashboard-main h2 { margin-top: 40px; margin-bottom: 20px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.stat-cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.stat-card { background-color: #fff; padding: 25px; border-radius: var(--border-radius); box-shadow: var(--box-shadow); border-left: 5px solid var(--primary-color); }
.stat-card h3 { margin: 0 0 10px 0; font-size: 1em; color: var(--secondary-color); }
.stat-card .stat-number { margin: 0; font-size: 2.5em; font-weight: 700; color: var(--text-color); }
.stat-card .stat-context { margin: 10px 0 0 0; font-size: 0.9em; color: var(--secondary-color); min-height: 1.2em; }
.action-panels-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.action-panel { display: block; background-color: #fff; padding: 30px; border-radius: var(--border-radius); box-shadow: var(--box-shadow); color: var(--text-color); transition: all 0.2s ease-in-out; border: 1px solid var(--border-color); }
.action-panel:hover { transform: translateY(-5px); border-color: var(--primary-color); box-shadow: 0 8px 20px rgba(0,0,0,0.1); color: var(--text-color); }
.action-panel h4 { margin: 0 0 10px 0; font-size: 1.3em; color: var(--primary-color); }
.action-panel p { margin: 0; line-height: 1.5; color: var(--secondary-color); }
.action-panel.disabled { background-color: var(--light-gray); opacity: 0.7; cursor: not-allowed; }
.action-panel.disabled:hover { transform: none; box-shadow: var(--box-shadow); border-color: var(--border-color); }

/* === VEREJNÝ PROFIL A HODNOTENIA === */
.profile-header { text-align: center; border-bottom: 1px solid var(--border-color); padding-bottom: 20px; margin-bottom: 30px; }
.profile-header h1 { margin-top: 0; }
.average-rating { display: inline-flex; align-items: center; gap: 10px; font-size: 1.2em; background-color: var(--light-gray); padding: 10px 20px; border-radius: 50px; }
.reviews-list { display: grid; gap: 20px; }
.review-card { background-color: var(--light-gray); padding: 20px; border-radius: var(--border-radius); border: 1px solid #e9ecef; }
.review-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; border-bottom: 1px solid var(--border-color); padding-bottom: 10px; }
.stars { --percent: calc(var(--rating) / 5 * 100%); display: inline-block; font-size: 1.5rem; font-family: Times; line-height: 1; vertical-align: middle; }
.stars::before { content: '★★★★★'; letter-spacing: 3px; background: linear-gradient(90deg, #ffc107 var(--percent), #e4e5e9 var(--percent)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.star-rating { display: flex; flex-direction: row-reverse; justify-content: center; margin-top: 10px; }
.star-rating input[type=radio] { display: none; }
.star-rating label.star { font-size: 2.5em; color: #ddd; cursor: pointer; transition: color 0.2s; }
.star-rating input[type=radio]:checked ~ label.star, .star-rating:not(:checked) > label.star:hover, .star-rating:not(:checked) > label.star:hover ~ label.star { color: #ffc107; }

/* === NOTIFIKÁCIE === */
.nav-link-with-badge { position: relative; padding-right: 20px; }
.unread-count { position: absolute; top: -8px; right: -5px; background-color: var(--danger-color); color: white; font-size: 0.7em; font-weight: bold; padding: 3px 7px; border-radius: 10px; line-height: 1; border: 2px solid white; min-width: 18px; text-align: center; }
.admin-table tr.has-unread-messages { background-color: #fffaf0; font-weight: bold; }
.btn-chat { position: relative; }
.unread-count-inline { position: absolute; top: -8px; right: -8px; background-color: var(--danger-color); color: white; font-size: 0.75em; width: 18px; height: 18px; border-radius: 50%; display: flex; justify-content: center; align-items: center; line-height: 1; border: 1px solid white; }

/* === CHAT === */
.chat-container { height: 70vh; }
.chat-header { padding: 20px; border-bottom: 1px solid var(--border-color); }
.chat-messages { flex-grow: 1; overflow-y: auto; padding: 20px; }
.message { display: flex; margin-bottom: 15px; }
.message-bubble { max-width: 70%; padding: 10px 15px; border-radius: 18px; }
.my-message { justify-content: flex-end; }
.my-message .message-bubble { background-color: var(--primary-color); color: white; border-radius: 18px 18px 5px 18px; }
.their-message { justify-content: flex-start; }
.their-message .message-bubble { background-color: var(--light-gray); border-radius: 18px 18px 18px 5px; }
.message-meta { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 5px; font-size: 0.75em; }
.my-message .message-time { color: rgba(255,255,255,0.7); }
.their-message .message-time { color: var(--secondary-color); }
.my-message .message-status { font-weight: bold; color: #a7d7ff; }
.chat-form-container { padding: 15px; border-top: 1px solid var(--border-color); }
.chat-form { display: flex; gap: 10px; }
.chat-form textarea { flex-grow: 1; resize: none; height: 45px; }

/* === GDPR & COOKIES === */
.form-group-consent { display: flex; align-items: flex-start; gap: 10px; font-size: 0.9em; margin-bottom: 20px; text-align: left; }
.form-group-consent input[type="checkbox"] { margin-top: 4px; flex-shrink: 0; width: auto; }
.form-group-consent label { display: inline; margin-bottom: 0; font-weight: normal; }
.cookie-banner { position: fixed; bottom: 0; left: 0; width: 100%; background-color: rgba(30, 30, 30, 0.95); backdrop-filter: blur(5px); color: white; padding: 15px 20px; z-index: 9999; display: none; align-items: center; justify-content: center; gap: 20px; flex-wrap: wrap; text-align: center; }
.cookie-banner p { margin: 0; }
.cookie-banner a { color: #a7d7ff; text-decoration: underline; }

/* === KALENDÁR A LEGENDA === */
.calendar-legend { display: flex; flex-wrap: wrap; gap: 15px; margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--border-color); font-size: 0.9em; }
.legend-item { display: flex; align-items: center; gap: 8px; }
.color-box { width: 15px; height: 15px; border-radius: 3px; border: 1px solid rgba(0,0,0,0.1); }
.flatpickr-day.flatpickr-disabled, .flatpickr-day.flatpickr-disabled:hover, .color-box.flatpickr-disabled { background: #e9ecef !important; color: #adb5bd !important; cursor: not-allowed; border-color: #e9ecef !important; }
.flatpickr-day.day-pending, .flatpickr-day.day-pending:hover, .color-box.day-pending { background: #f8d7da !important; color: #721c24 !important; border-color: #f5c6cb !important; }
.flatpickr-day.day-available, .flatpickr-day.day-available:hover, .color-box.day-available { background: #d4edda !important; color: #155724 !important; border-color: #c3e6cb !important; }
.flatpickr-day.day-pending:not(.selected):hover, .flatpickr-day.day-available:not(.selected):hover { transform: scale(1.1); }
.flatpickr-day.selected, .flatpickr-day.startRange, .flatpickr-day.endRange { background: var(--primary-color) !important; border-color: var(--primary-color) !important; color: white !important; }
/* === MODAL STYLES (MicroModal) === */
.modal__overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  
  /* KĽÚČOVÁ ZMENA: Povolí vertikálne scrollovanie, ak je obsah príliš vysoký */
  overflow-y: auto;
  /* Pridáme malý okraj hore a dole, aby sa okno nelepilo na okraje obrazovky */
  padding: 40px 0;
}
.modal__container {
  background-color: #fff;
  padding: 30px;
  max-width: 500px;
  width: 100%;
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  position: relative;
  margin: auto 15px; /* Pridá okraj na mobilných zariadeniach */
}
.modal__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 15px;
  margin-bottom: 20px;
}
.modal__title {
  margin: 0;
  font-size: 1.5em;
}
.modal__close {
  background: transparent;
  border: 0;
  cursor: pointer;
  width: 25px;
  height: 25px;
  position: relative;
}
.modal__close:before, .modal__close:after {
  content: '';
  position: absolute;
  top: 12px;
  left: 2px;
  width: 20px;
  height: 2px;
  background-color: var(--secondary-color);
}
.modal__close:before {
  transform: rotate(45deg);
}
.modal__close:after {
  transform: rotate(-45deg);
}
.modal__error {
  color: var(--danger-color);
  margin-bottom: 15px;
  text-align: center;
  font-weight: bold;
  min-height: 20px;
}
.modal[aria-hidden="true"] {
  display: none;
}