/* ==========================================================================
   CULINARY LABYRINTH - GLAVNI STIL (Bez Headera)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. GLOBALNA PRAVILA (VARIJABLE, RESET, TIPOGRAFIJA)
   -------------------------------------------------------------------------- */
:root {
  --primary-color: #4f46e5;
  --accent-color: #f59e0b;
  --text-color: #1f2937;
  --text-light: #f3f4f6;
  --text-muted: #6b7280;
  --background-color: #f3f4f6;
  --surface-color: #ffffff;
  --border-color: #e5e7eb;
  --success-color: #10b981;
  --error-color: #e74c3c;
  --font-family: "Poppins", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--background-color);
  color: var(--text-color);
  line-height: 1.6;
}

section,
.page-container,
.main-content {
  max-width: 1200px;
  margin: 50px auto;
  padding: 0 20px;
}

h1,
h2,
h3,
h4 {
  color: var(--text-color);
  line-height: 1.3;
}
h1,
.page-title {
  font-size: 2.8rem;
}
h2 {
  font-size: 2rem;
}
h3 {
  font-size: 1.5rem;
}
h4 {
  font-size: 1.2rem;
}

.page-title,
.page-subtitle {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}
.page-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  margin-bottom: 50px;
  max-width: 600px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --------------------------------------------------------------------------
   2. KOMPONENTE (HERO, KARTICE, FORME, DUGMIĆI)
   -------------------------------------------------------------------------- */

/* HERO SEKCIJA */
.hero {
  padding: 100px 20px;
  text-align: center;
  color: var(--text-light);
  background-size: cover;
  background-position: center;
  position: relative;
  z-index: 1;
  background-image: url("https://images.unsplash.com/photo-1605092609498-6093cccc0468?q=80&w=1170&auto=format&fit=crop&ixlib.rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D");
}
body > .hero {
  margin-top: 0;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: -1;
}
.hero h1 {
  font-size: 3rem;
  color: var(--text-light);
}
.hero p {
  font-size: 1.2rem;
  max-width: 600px;
  margin: 1em auto 1.5em;
}

/* DUGMIĆI */
.button {
  display: inline-block;
  background: var(--accent-color);
  color: var(--text-light);
  padding: 12px 28px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1em;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
}
.button:hover {
  background: #d97706;
  transform: translateY(-2px);
}

/* KARTICE (Grid & Stil) */
.card-grid,
.category-grid,
.ad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  list-style: none;
  padding: 0;
}

.card,
.category-card,
.ad-card {
  background: var(--surface-color);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card:hover,
.category-card:hover,
.ad-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.card .content,
.ad-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.card img,
.ad-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* OPŠTE FORME */
form {
  background: var(--surface-color);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.07);
  max-width: 600px;
  margin: 30px auto;
}
form input,
form textarea,
form select {
  width: 100%;
  padding: 12px;
  margin-top: 15px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 1em;
  font-family: var(--font-family);
}
form input:focus,
form textarea:focus,
form select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}
form button {
  margin-top: 20px;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s;
  font-weight: bold;
  background: var(--success-color);
  color: var(--text-light);
}
form button:hover {
  background: #059669;
}

/* FOOTER */
footer {
  background: #1f2937;
  color: var(--text-light);
  padding: 40px 20px;
  text-align: center;
  margin-top: 50px;
  font-size: 0.9em;
}

/* --------------------------------------------------------------------------
   3. SPECIFIČNI STILOVI ZA STRANICE
   -------------------------------------------------------------------------- */

/* LOGIN & SIGNUP STRANICE */
.auth-page-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background-color: #eef2ff;
  padding: 20px;
}
.login-form,
.signup-form {
  width: 100%;
  max-width: 420px;
  padding: 40px;
  text-align: center;
}
.login-form h1,
.signup-form h1 {
  font-size: 2rem;
  margin-bottom: 10px;
}
.login-form p,
.signup-form p {
  margin-bottom: 30px;
  color: var(--text-muted);
}
.login-form input,
.signup-form input {
  margin-top: 10px;
  padding: 15px;
  font-size: 1rem;
}
.login-form button,
.signup-form button {
  background: var(--primary-color);
  padding: 15px;
  font-size: 1.1rem;
}
.login-form button:hover,
.signup-form button:hover {
  background: #4338ca;
}
.login-form .form-footer,
.signup-form .form-footer {
  margin-top: 25px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.login-form .form-footer a,
.signup-form .form-footer a {
  color: var(--primary-color);
  font-weight: bold;
  text-decoration: none;
}
.login-form .form-footer a:hover,
.signup-form .form-footer a:hover {
  text-decoration: underline;
}
.signup-form .form-terms {
  display: flex;
  align-items: center;
  text-align: left;
  margin-top: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.signup-form .form-terms input[type="checkbox"] {
  width: auto;
  margin-right: 10px;
  accent-color: var(--primary-color);
}
.signup-form .form-terms a {
  font-weight: 500;
}

/* INBOX / FRIENDS STRANICA */
.friends-page-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}
.card-style {
  padding: 25px;
}
.card-style h2 {
  margin-top: 0;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
  font-size: 1.5rem;
}
.user-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.user-list-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 10px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s ease;
}
.user-list-item:last-child {
  border-bottom: none;
}
.user-list-item:hover {
  background-color: #f8f9fa;
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.user-name {
  font-weight: 500;
  word-break: break-all;
}
.status {
  font-size: 1.2rem;
}
.status.online {
  color: var(--success-color);
}
.status.offline {
  color: #ccc;
}
.user-actions {
  display: flex;
  gap: 8px;
}
.user-actions form {
  margin: 0;
  padding: 0;
  background: none;
  box-shadow: none;
}
.btn-action {
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 36px;
  height: 36px;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}
.btn-action:hover {
  transform: scale(1.1);
  border-color: var(--primary-color);
}
.btn-action.chat {
  color: var(--primary-color);
}
.btn-action.accept {
  color: var(--success-color);
}
.btn-action.add {
  color: var(--primary-color);
}
.btn-action.remove,
.btn-action.reject {
  color: var(--error-color);
}
.btn-action.block {
  color: var(--text-muted);
}

/* KATEGORIJE & ANTIKVARNICA */
.category-card a {
  display: block;
  padding: 40px 30px;
  text-decoration: none;
  color: var(--text-color);
  height: 100%;
  text-align: center;
}
.category-icon {
  font-size: 3.5rem;
  line-height: 1;
  margin-bottom: 20px;
}
.category-card h3 {
  font-size: 1.4rem;
  margin: 0 0 10px 0;
  color: var(--primary-color);
}
.category-card p {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin: 0;
}
.ad-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 10px 0;
}
.ad-description {
  font-size: 0.95rem;
  color: var(--text-muted);
  flex-grow: 1;
  margin-bottom: 20px;
}
.ad-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.ad-price {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--primary-color);
}
.ad-contact-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px;
  background-color: var(--primary-color);
  color: var(--text-light);
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.2s ease;
}
.ad-contact-btn:hover {
  background-color: #4338ca;
}

/* AD-SENSE BANER */
.adsense-right {
  position: fixed;
  top: 90px;
  right: 20px;
  width: 160px;
  height: 600px;
  z-index: 99;
}
/* Stilovi za akcije na kartici oglasa */
.ad-actions {
  display: flex;
  gap: 10px;
  margin-top: auto; /* Gura akcije na dno kartice */
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}
.ad-actions a,
.ad-actions button {
  flex-grow: 1;
  text-align: center;
  padding: 10px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}
.ad-actions .btn-action-edit {
  background-color: #f0f0f0;
  color: var(--text-color);
  border-color: #ddd;
}
.ad-actions .btn-action-edit:hover {
  background-color: #e0e0e0;
}
.ad-actions .btn-action-delete {
  background-color: #fff1f2;
  color: var(--error-color);
  border-color: #ffb8bf;
}
.ad-actions .btn-action-delete:hover {
  background-color: var(--error-color);
  color: white;
}

/* ==========================================================================
   STILOVI ZA STATUS BAR (QUICK POST)
   ========================================================================== */

.quick-post-section {
  background-color: var(--surface-color);
  border-radius: 12px;
  padding: 25px;
  margin: -60px auto 50px auto; /* Negativna margina da se podvuče pod hero */
  max-width: 800px;
  position: relative;
  z-index: 10;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

#quick-post-form input[type="text"],
#quick-post-form textarea {
  width: 100%;
  padding: 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 1.1rem;
  font-family: var(--font-family);
  margin-bottom: 15px;
}

#quick-post-form textarea {
  min-height: 80px;
  resize: vertical;
}

.form-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.post-type-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.post-type-selector label {
  padding: 8px 15px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.post-type-selector input[type="radio"] {
  display: none;
}

.post-type-selector label.active,
.post-type-selector label:hover {
  background-color: var(--primary-color);
  color: var(--text-light);
  border-color: var(--primary-color);
}

#quick-post-form button[type="submit"] {
  background: var(--primary-color);
  color: var(--text-light);
  font-weight: bold;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s;
}

#quick-post-form button[type="submit"]:hover {
  background: #4338ca;
}

/* STILOVI ZA MODALNI PROZOR (KATEGORIJE) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.visible {
  opacity: 1;
  visibility: visible;
}
.modal-content {
  background: var(--surface-color);
  padding: 30px;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  transform: scale(0.95);
  transition: transform 0.3s ease;
}
.modal-overlay.visible .modal-content {
  transform: scale(1);
}
.modal-content h3 {
  margin-top: 0;
}
/* ... (ostatak stilova za dugmiće i select ostaje isti) ... */
.modal-content p {
  margin-bottom: 20px;
  color: var(--text-muted);
}

.modal-content select {
  width: 100%;
  padding: 12px;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 20px;
}

.modal-actions {
  display: flex;
  gap: 10px;
}
.modal-actions button {
  flex-grow: 1;
  padding: 12px;
  border-radius: 8px;
  border: none;
  font-weight: bold;
  cursor: pointer;
}
.modal-actions button.close {
  background-color: #eee;
  color: #333;
}
#modal-submit-btn {
  background-color: var(--primary-color);
  color: white;
}

/* ==========================================================================
   STILOVI ZA ADMIN PANEL
   ========================================================================== */

/* Dashboard statistika */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}
.stat-card {
  background: var(--surface-color);
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  text-align: center;
}
.stat-card h3 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.stat-card p {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Tabele */
.table-container {
  overflow-x: auto; /* Omogućava horizontalni skrol na malim ekranima */
}
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}
th,
td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
thead th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: var(--text-muted);
}
tbody tr:hover {
  background-color: #f8f9fa;
}
td.actions {
  text-align: right;
}

/* Uloge korisnika */
.role {
  padding: 4px 8px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: bold;
}
.role.admin {
  background-color: #fff1f2;
  color: var(--error-color);
}
.role.user {
  background-color: #eef2ff;
  color: var(--primary-color);
}

/* Malo dugme za akcije */
.btn-action-small {
  padding: 6px 12px;
  font-size: 0.85rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: background-color 0.2s ease;
}
.btn-action-small.delete {
  background-color: #fee2e2;
  color: var(--error-color);
}
.btn-action-small.delete:hover {
  background-color: var(--error-color);
  color: white;
}

/* Paginacija */
.pagination {
  margin-top: 20px;
  text-align: center;
}
.pagination a {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 4px;
  border-radius: 6px;
  background-color: var(--surface-color);
  color: var(--primary-color);
  text-decoration: none;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}
.pagination a:hover {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}
.pagination a.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
  cursor: default;
}
/* ==========================================================================
   STILOVI ZA KORISNIČKI PROFIL
   ========================================================================== */
.profile-page {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}
@media (min-width: 992px) {
  .profile-page {
    grid-template-columns: 300px 1fr; /* Sidebar i glavni sadržaj */
  }
}
.profile-sidebar {
  padding: 30px;
  text-align: center;
}
.profile-avatar img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--surface-color);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}
.profile-name {
  font-size: 1.8rem;
  margin-bottom: 5px;
}
.profile-location {
  color: var(--text-muted);
  margin-bottom: 15px;
}
.profile-bio {
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
}
.profile-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}
.profile-actions {
  margin-top: 20px;
}
.profile-actions .button {
  width: 100%;
}
.profile-actions .button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}
.profile-stories h2 {
  margin-top: 0;
  margin-bottom: 20px;
}

.btn-action-small.toggle-admin {
  background-color: #fefce8;
  color: #a16207;
}
.btn-action-small.toggle-admin:hover {
  background-color: #facc15;
  color: #422006;
}
.actions {
  display: flex;
  gap: 5px;
}
/* ==========================================================================
   STILOVI ZA TABOVE NA PROFIL STRANICI
   ========================================================================== */

.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 30px;
}

.tab-btn {
  padding: 15px 25px;
  cursor: pointer;
  background: none;
  border: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
  position: relative;
  bottom: -1px; /* Da se lepo spoji sa donjom linijom */
  border-bottom: 2px solid transparent;
}

.tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

.tab-pane {
  display: none; /* Sakriveni po defaultu */
}

.tab-pane.active {
  display: block; /* Prikazujemo samo aktivni tab */
}

/* Osigurava da 'empty-state' bude vidljiv unutar grida ako nema sadržaja */
.card-grid .empty-state,
.ad-grid .empty-state,
.video-grid .empty-state {
  grid-column: 1 / -1;
}
/* ==========================================================================
   STIL ZA DUGME KA ADMIN PANELU
   ========================================================================== */

.admin-link-container {
  text-align: center; /* Da dugme bude centrirano */
  margin: 50px 0;
}

.admin-panel-button {
  display: inline-block; /* Da se ponaša kao blok, ali da ne zauzme celu širinu */
  padding: 15px 30px;
  background-color: var(--text-color); /* Tamna pozadina */
  color: var(--text-light); /* Svetli tekst */
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1rem;
  border-radius: 8px;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.admin-panel-button:hover {
  background-color: #333; /* Malo svetlija tamna na hover */
  transform: translateY(-3px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
/* ==========================================================================
   STILOVI ZA VIDEO STRANICU
   ========================================================================== */

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.video-card {
  background: var(--surface-color);
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
  overflow: hidden;
}

.video-player-container {
  background-color: #000;
  position: relative;
  /* Održava razmeru 16:9 */
  padding-top: 56.25%;
}

.video-player-container video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 12px 12px 0 0;
}

.video-content {
  padding: 15px 20px;
}

.video-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0 0 5px 0;
}

.video-author {
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Dodatni stilovi za video polja u quick-post formi */
.video-fields {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}
.video-fields label {
  display: block;
  font-weight: 500;
  margin-bottom: 5px;
  font-size: 0.9rem;
}
.video-fields input[type="file"] {
  margin-bottom: 15px;
  font-size: 0.9rem;
}
/* STILOVI ZA COOKIE BANER */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #2d3748;
  color: #f7fafc;
  padding: 15px 20px;
  display: none; /* Po defaultu je sakriven */
  justify-content: space-between;
  align-items: center;
  z-index: 9999;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
}
.cookie-banner p {
  margin: 0;
  font-size: 0.9rem;
}
.cookie-banner a {
  color: #f59e0b; /* --accent-color */
  text-decoration: underline;
}
.cookie-banner button {
  margin-left: 20px;
  padding: 8px 20px;
}

/* Stil za isticanje korisnika sa nepročitanom porukom u inboxu */
.user-list-item.has-unread-message {
  background-color: #fefce8; /* Neka svetlo žuta pozadina */
}
.user-list-item.has-unread-message .user-name {
  font-weight: bold; /* Boldiraj ime */
  color: var(--color-primary); /* Može i plava boja */
}
/* Možeš dodati i ikonicu ako želiš */
/* .user-list-item.has-unread-message .user-info::before {
    content: '✉️';
    margin-right: 8px;
} */
/* --------------------------------------------------------------------------
   4. CENTRALIZOVANA RESPONSIVE PRAVILA
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  html {
    font-size: 17px;
  }
  section,
  .page-container,
  .main-content {
    margin-top: 30px;
    margin-bottom: 30px;
    padding: 0 15px;
  }
  .hero {
    padding: 60px 20px;
  }
  footer {
    padding: 30px 20px;
  }
  h1,
  .page-title {
    font-size: 2rem;
  }
  h2 {
    font-size: 1.7rem;
  }
  h3 {
    font-size: 1.3rem;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .login-form,
  .signup-form {
    padding: 30px 25px;
  }
}

@media (min-width: 992px) {
  .friends-page-layout {
    grid-template-columns: 2fr 1fr;
  }
}

@media (max-width: 1200px) {
  .adsense-right {
    display: none;
  }
}
