* {
  box-sizing: border-box;
}
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  --novostnik-purple: #7B2CBF;
  --novostnik-purple-dark: #5A189A;
  --novostnik-purple-light: #9D4EDD;
  --novostnik-dark: #212529;
  --novostnik-light: #ffffff;
  --novostnik-muted: #6c757d;
  --novostnik-bg-light: #f8f9fa;
  --novostnik-border: #e9ecef;
}

html {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--novostnik-dark);
  background-color: var(--novostnik-light);
  scroll-behavior: smooth;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  min-height: 100vh;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Inter", sans-serif;
  font-weight: 700;
  color: var(--novostnik-dark);
  line-height: 1.2;
}

a {
  color: var(--novostnik-purple);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--novostnik-purple-dark);
}

.navbar {
  background-color: var(--novostnik-light) !important;
  border-bottom: 1px solid var(--novostnik-border);
  padding: 1rem 0;
}

.navbar-brand {
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--novostnik-purple) !important;
}

.nav-link {
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--novostnik-dark) !important;
  padding: 0.5rem 1rem !important;
  transition: color 0.3s ease;
}

.nav-link:hover {
  color: var(--novostnik-purple) !important;
}

.nav-link.active {
  color: var(--novostnik-purple) !important;
}

.btn-primary {
  background-color: var(--novostnik-purple);
  border: none;
  color: white;
}

.btn-primary:hover {
  background-color: var(--novostnik-purple-dark);
  color: white;
}

.btn-outline-primary {
  border-color: var(--novostnik-purple);
  color: var(--novostnik-purple);
}

.btn-outline-primary:hover {
  background-color: var(--novostnik-purple);
  color: white;
}

.category-label {
  display: inline-block;
  background-color: var(--novostnik-purple);
  color: white;
  padding: 0.5rem 1.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.article-card {
  background: white;
  border: 1px solid var(--novostnik-border);
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  box-shadow: 0 0.5rem 1.5rem rgba(123, 44, 191, 0.15);
  transform: translateY(-3px);
}

.article-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.article-card:hover img {
  transform: scale(1.05);
}

.article-card-body {
  padding: 1.25rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.article-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--novostnik-dark);
  line-height: 1.4;
}

.article-card-title a {
  color: inherit;
}

.article-card-title a:hover {
  color: var(--novostnik-purple);
}

.article-card-date {
  font-size: 0.875rem;
  color: var(--novostnik-muted);
  margin-bottom: 0.5rem;
}

.article-card-excerpt {
  font-size: 0.9375rem;
  color: var(--novostnik-muted);
  line-height: 1.6;
  margin-top: auto;
}

.featured-article {
  margin-bottom: 3rem;
}

.featured-article img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  margin-bottom: 1.5rem;
  transition: transform 0.3s ease;
  overflow: hidden;
}

.featured-article:hover img {
  transform: scale(1.03);
}

.featured-article-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.featured-article-date {
  font-size: 0.9375rem;
  color: var(--novostnik-muted);
  margin-bottom: 1rem;
}

.featured-article-excerpt {
  font-size: 1.125rem;
  color: var(--novostnik-dark);
  line-height: 1.7;
}

.advertisement-section {
  background-color: var(--novostnik-bg-light);
  padding: 2rem;
  margin: 3rem 0;
  border-top: 2px solid var(--novostnik-border);
  border-bottom: 2px solid var(--novostnik-border);
  text-align: center;
}

.advertisement-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--novostnik-muted);
  margin-bottom: 1rem;
}

section {
  padding-top: 4rem;
  padding-bottom: 4rem;
  flex: 1 0 auto;
}

main {
  flex: 1 0 auto;
}

nav {
  flex-shrink: 0;
}

#navbar {
  flex-shrink: 0;
}

/* Ensure content between nav and footer takes available space */
body > section,
body > header {
  flex: 1 0 auto;
}

/* Wrapper for all content - ensures it takes space */
body > *:not(nav):not(footer):not(script) {
  flex: 1 0 auto;
}


.bg-light {
  background-color: var(--novostnik-bg-light) !important;
}

.bg-primary {
  background-color: var(--novostnik-purple) !important;
}

.bg-dark {
  background-color: var(--novostnik-dark) !important;
}

.card {
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  border: 1px solid var(--novostnik-border);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
}

.form-control,
.form-check-input {
  border-radius: 0.5rem;
  box-shadow: none;
  border: 1px solid var(--novostnik-border);
}

.form-control:focus {
  border-color: var(--novostnik-purple);
  box-shadow: 0 0 0 0.2rem rgba(123, 44, 191, 0.25);
}

.form-check-input:checked {
  background-color: var(--novostnik-purple);
  border-color: var(--novostnik-purple);
}

footer {
  font-size: 0.9rem;
  background-color: white;
  color: var(--novostnik-dark);
  padding: 3rem 0 0;
  margin-top: auto;
  width: 100%;
  flex-shrink: 0;
  margin-bottom: 0;
}

/* Remove Bootstrap pb-2 padding that creates white space */
footer.pb-2 {
  padding-bottom: 0 !important;
}

footer .bg-dark {
  background-color: var(--novostnik-dark) !important;
  color: white;
  margin-bottom: 0 !important;
  padding-bottom: 0.5rem;
  padding-top: 0.5rem;
}

/* Remove margin/padding after footer */
footer .mt-4 {
  margin-bottom: 0 !important;
}

body > footer:last-child {
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
}


footer a {
  color: var(--novostnik-dark);
  transition: color 0.3s ease;
}

footer a:hover {
  color: var(--novostnik-purple);
}

footer .bg-dark a {
  color: white;
}

#scrollToTop {
  cursor: pointer;
  transition: opacity 0.3s ease;
}

#scrollToTop:hover {
  opacity: 0.8;
}

[data-aos] {
  transition: all 0.75s ease;
}

.shadow-sm {
  box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08) !important;
}

.shadow {
  box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.1) !important;
}

.search-icon {
  cursor: pointer;
  font-size: 1.25rem;
  color: var(--novostnik-dark);
  transition: color 0.3s ease;
}

.search-icon:hover {
  color: var(--novostnik-purple);
}

/* Search Modal Styles */
.search-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-modal.active {
  opacity: 1;
  visibility: visible;
}

.search-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.search-modal-content {
  position: relative;
  background: white;
  border-radius: 0.75rem;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  z-index: 1;
}

.search-modal.active .search-modal-content {
  transform: translateY(0);
}

.search-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--novostnik-border);
}

.search-modal-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--novostnik-dark);
}

.search-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--novostnik-muted);
  cursor: pointer;
  padding: 0;
  width: 2rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
}

.search-modal-close:hover {
  background-color: var(--novostnik-bg-light);
  color: var(--novostnik-dark);
}

.search-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.search-input-wrapper {
  position: relative;
  margin-bottom: 1.5rem;
}

.search-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  font-size: 1rem;
  border: 2px solid var(--novostnik-border);
  border-radius: 0.5rem;
  transition: all 0.3s ease;
  outline: none;
}

.search-input:focus {
  border-color: var(--novostnik-purple);
  box-shadow: 0 0 0 3px rgba(123, 44, 191, 0.1);
}

.search-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--novostnik-muted);
  font-size: 1.125rem;
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-height: 50vh;
  overflow-y: auto;
}

.search-result-item {
  display: block;
  padding: 1rem;
  border: 1px solid var(--novostnik-border);
  border-radius: 0.5rem;
  text-decoration: none;
  transition: all 0.2s ease;
  background: white;
}

.search-result-item:hover {
  border-color: var(--novostnik-purple);
  box-shadow: 0 2px 8px rgba(123, 44, 191, 0.1);
  transform: translateY(-2px);
}

.search-result-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--novostnik-purple);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.search-result-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--novostnik-dark);
  line-height: 1.5;
}

.search-result-title mark {
  background-color: rgba(123, 44, 191, 0.2);
  color: var(--novostnik-purple);
  padding: 0 0.125rem;
  font-weight: 600;
}

.search-no-results {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--novostnik-muted);
}

.search-no-results p {
  margin: 0;
  font-size: 1.125rem;
}

@media (max-width: 768px) {
  .search-modal {
    padding-top: 2rem;
  }

  .search-modal-content {
    width: 95%;
    max-height: 85vh;
  }

  .search-modal-header {
    padding: 1rem;
  }

  .search-modal-header h3 {
    font-size: 1.25rem;
  }

  .search-modal-body {
    padding: 1rem;
  }

  .search-results {
    max-height: 60vh;
  }
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
}

.article-content img {
  width: 100%;
  height: auto;
  margin: 2rem 0;
  border-radius: 0.5rem;
}

.article-content p {
  margin-bottom: 1.5rem;
  font-size: 1.0625rem;
  line-height: 1.8;
  color: var(--novostnik-dark);
}

.article-content h2 {
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  font-size: 1.75rem;
}

.article-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.related-articles {
  margin-top: 4rem;
  padding-top: 3rem;
  border-top: 2px solid var(--novostnik-border);
}

/* Category Pages Styles */
.category-page-header {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--novostnik-dark);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.category-sidebar {
  margin-bottom: 2rem;
}

.advertisement-block {
  background-color: var(--novostnik-bg-light);
  border: 1px solid var(--novostnik-border);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border-radius: 0.5rem;
  text-align: center;
  min-height: 300px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.advertisement-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--novostnik-muted);
  margin-bottom: 1rem;
  font-weight: 600;
}

.advertisement-block-placeholder {
  color: var(--novostnik-muted);
  font-size: 0.9rem;
}

.newsletter-form-container {
  background-color: #2c2c2c;
  color: white;
  padding: 2rem;
  border-radius: 0.5rem;
  margin-top: 2rem;
}

.newsletter-form-container h3 {
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  line-height: 1.4;
}

.newsletter-form-container .form-control {
  background-color: #3a3a3a;
  border-color: #3a3a3a;
  color: white;
  margin-bottom: 1rem;
}

.newsletter-form-container .form-control::placeholder {
  color: #999;
}

.newsletter-form-container .form-control:focus {
  background-color: #3a3a3a;
  border-color: var(--novostnik-purple);
  color: white;
}

.newsletter-form-container .btn {
  background-color: var(--novostnik-purple);
  border-color: var(--novostnik-purple);
  color: white;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.75rem 2rem;
  width: 100%;
}

.newsletter-form-container .btn:hover {
  background-color: var(--novostnik-purple-dark);
  border-color: var(--novostnik-purple-dark);
}

.category-featured-article {
  margin-bottom: 3rem;
}

.category-articles-grid {
  margin-top: 3rem;
}

/* Improve image container to prevent overflow */
.article-card {
  overflow: hidden;
}

.featured-article {
  overflow: hidden;
}

@media (max-width: 768px) {
  .featured-article-title {
    font-size: 1.5rem;
  }
  
  .featured-article img {
    height: 250px;
  }
  
  .article-card img {
    height: 180px;
  }
  
  section {
    padding-top: 2rem;
    padding-bottom: 2rem;
  }

  .category-page-header {
    font-size: 1.75rem;
  }

  .advertisement-block {
    min-height: 200px;
  }
}
