/* ==========================================
   TED1.AZ - Header & Footer Styles
   Modern, Responsive Design
   Primary Color: #4469ff
   ========================================== */

:root {
  --primary-color: #4469ff;
  --primary-dark: #2e4bcc;
  --primary-light: #6b88ff;
  --text-dark: #1a1a1a;
  --text-gray: #666;
  --text-light: #999;
  --border-color: #e0e0e0;
  --bg-light: #f8f9fa;
  --white: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', 'Montserrat', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ==========================================
   HEADER STYLES
   ========================================== */

/* Top Bar */
.modern-topbar {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  padding: 10px 0;
  color: var(--white);
  font-size: 13px;
}

.modern-topbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.topbar-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

.topbar-date i {
  font-size: 14px;
}

.topbar-social {
  display: flex;
  align-items: center;
  gap: 15px;
}

.topbar-social a {
  color: var(--white);
  font-size: 16px;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.topbar-social a:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  text-decoration: none;
}

/* Main Header */
.modern-header {
  background: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: var(--transition);
}

.modern-header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-main {
  padding: 15px 0;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Logo */
.header-logo {
  flex-shrink: 0;
}

.header-logo a {
  display: block;
  transition: var(--transition);
}

.header-logo img {
  height: 50px;
  width: auto;
  transition: var(--transition);
}

.header-logo a:hover img {
  transform: scale(1.05);
}

/* Navigation */
.header-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 5px;
  margin: 0;
  padding: 0;
}

.nav-menu > li {
  position: relative;
}

.nav-menu > li > a {
  display: block;
  padding: 12px 18px;
  color: var(--text-dark);
  font-weight: 500;
  font-size: 15px;
  text-decoration: none;
  border-radius: 8px;
  transition: var(--transition);
  position: relative;
}

.nav-menu > li > a::before {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 18px;
  right: 18px;
  height: 2px;
  background: var(--primary-color);
  transform: scaleX(0);
  transition: var(--transition);
}

.nav-menu > li > a:hover,
.nav-menu > li.active > a {
  color: var(--primary-color);
  background: rgba(68, 105, 255, 0.05);
}

.nav-menu > li > a:hover::before,
.nav-menu > li.active > a::before {
  transform: scaleX(1);
}

/* Dropdown Menu */
.nav-menu .dropdown {
  position: relative;
}

/* Add invisible bridge to prevent hover loss */
.nav-menu .dropdown::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  height: 15px;
  background: transparent;
  z-index: 999;
}

.nav-menu .dropdown-toggle::after {
  content: '\f107';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  border: none;
  margin-left: 5px;
  vertical-align: middle;
  transition: var(--transition);
}

.nav-menu .dropdown:hover .dropdown-toggle::after {
  transform: rotate(-180deg);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--white);
  border: none;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  margin-top: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: var(--transition);
  z-index: 1000;
}

.nav-menu .dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  display: block;
  padding: 10px 16px;
  color: var(--text-dark);
  text-decoration: none;
  border-radius: 8px;
  font-size: 14px;
  transition: var(--transition);
}

.dropdown-menu a:hover {
  background: rgba(68, 105, 255, 0.1);
  color: var(--primary-color);
  transform: translateX(5px);
}

/* Header Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-toggle,
.mobile-menu-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(68, 105, 255, 0.08);
  border: none;
  color: var(--primary-color);
  font-size: 18px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-toggle:hover,
.mobile-menu-toggle:hover {
  background: var(--primary-color);
  color: var(--white);
  transform: scale(1.1);
}

.mobile-menu-toggle {
  display: none;
}

/* Search Bar */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

.search-container {
  width: 90%;
  max-width: 700px;
  position: relative;
}

.search-form {
  display: flex;
  gap: 10px;
}

.search-input {
  flex: 1;
  padding: 18px 24px;
  font-size: 18px;
  border: 2px solid var(--white);
  border-radius: 50px;
  background: var(--white);
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(68, 105, 255, 0.1);
}

.search-submit {
  padding: 18px 32px;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.search-submit:hover {
  background: var(--primary-dark);
  transform: scale(1.05);
}

.search-close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--white);
  font-size: 32px;
  cursor: pointer;
  transition: var(--transition);
}

.search-close:hover {
  transform: rotate(90deg);
}

/* Mobile Menu */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  max-width: 85%;
  height: 100%;
  background: var(--white);
  z-index: 9999;
  overflow-y: auto;
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
}

.mobile-menu.active {
  right: 0;
}

.mobile-menu-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--primary-color);
  color: var(--white);
}

.mobile-menu-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.mobile-menu-close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-menu-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: rotate(90deg);
}

.mobile-menu-content {
  padding: 20px;
}

.mobile-nav-menu {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-nav-menu li {
  border-bottom: 1px solid var(--border-color);
}

.mobile-nav-menu a {
  display: block;
  padding: 15px 0;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.mobile-nav-menu a:hover {
  color: var(--primary-color);
  padding-left: 10px;
}

.mobile-nav-menu .dropdown-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-nav-menu .dropdown-toggle::after {
  content: '\f107';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  transition: var(--transition);
}

.mobile-nav-menu .dropdown.active .dropdown-toggle::after {
  transform: rotate(-180deg);
}

.mobile-nav-menu .dropdown-menu {
  position: static !important;
  box-shadow: none;
  border-radius: 0;
  padding-left: 20px;
  margin: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  transition: max-height 0.3s ease, padding 0.3s ease;
  display: block !important;
}

.mobile-nav-menu .dropdown.active .dropdown-menu {
  max-height: 500px !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
}

.mobile-search-form {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.mobile-search-form .search-input {
  width: 100%;
  margin-bottom: 10px;
}

.mobile-search-form .search-submit {
  width: 100%;
}

/* ==========================================
   FOOTER STYLES
   ========================================== */

.modern-footer {
  background: linear-gradient(180deg, #1a1a1a 0%, #0d0d0d 100%);
  color: var(--white);
  padding-top: 60px;
}

.footer-main {
  padding-bottom: 40px;
}

.footer-section {
  margin-bottom: 30px;
}

.footer-section h4 {
  color: var(--white);
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
  position: relative;
  padding-bottom: 12px;
}

.footer-section h4::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 2px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-links li {
  margin-bottom: 12px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
}

.footer-links a::before {
  content: '\f105';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  margin-right: 8px;
  opacity: 0;
  transform: translateX(-10px);
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--white);
  padding-left: 10px;
}

.footer-links a:hover::before {
  opacity: 1;
  transform: translateX(0);
}

/* Footer Brand */
.footer-brand {
  margin-bottom: 30px;
}

.footer-logo {
  margin-bottom: 20px;
}

.footer-logo img {
  height: 50px;
  width: auto;
  filter: brightness(0) invert(1);
}

.footer-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 20px;
}

/* Footer Social */
.footer-social {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.footer-social a {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  font-size: 18px;
  transition: var(--transition);
}

.footer-social a:hover {
  background: var(--primary-color);
  transform: translateY(-5px) scale(1.1);
  box-shadow: 0 5px 15px rgba(68, 105, 255, 0.4);
}

/* Footer Bottom */
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 25px 0;
}

.footer-bottom-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.footer-copyright {
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
}

.footer-copyright a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.footer-copyright a:hover {
  color: var(--primary-light);
}

.footer-bottom-links {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-bottom-links a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  font-size: 14px;
  transition: var(--transition);
}

.footer-bottom-links a:hover {
  color: var(--white);
}

/* Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 999;
  box-shadow: var(--shadow-md);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--primary-dark);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

@media (max-width: 1200px) {
  .nav-menu > li > a {
    padding: 12px 14px;
    font-size: 14px;
  }

  .header-logo img {
    height: 45px;
  }
}

@media (max-width: 992px) {
  .header-nav {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  .footer-section {
    margin-bottom: 35px;
  }
}

@media (max-width: 768px) {
  .modern-topbar {
    padding: 8px 0;
    font-size: 12px;
  }

  .modern-topbar .container {
    flex-direction: column;
    text-align: center;
  }

  .topbar-social {
    gap: 10px;
  }

  .topbar-social a {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }

  .header-main {
    padding: 12px 0;
  }

  .header-logo img {
    height: 40px;
  }

  .search-toggle {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }

  .search-input {
    font-size: 16px;
    padding: 15px 20px;
  }

  .search-submit {
    padding: 15px 24px;
    font-size: 14px;
  }

  .footer-main {
    padding-bottom: 30px;
  }

  .footer-section h4 {
    font-size: 16px;
    margin-bottom: 15px;
  }

  .footer-bottom-content {
    flex-direction: column;
    text-align: center;
  }

  .footer-bottom-links {
    justify-content: center;
    flex-wrap: wrap;
  }

  .back-to-top {
    width: 45px;
    height: 45px;
    bottom: 20px;
    right: 20px;
    font-size: 18px;
  }
}

@media (max-width: 576px) {
  .search-container {
    width: 95%;
  }

  .search-form {
    flex-direction: column;
  }

  .search-submit {
    width: 100%;
  }

  .footer-social a {
    width: 38px;
    height: 38px;
    font-size: 16px;
  }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in-down {
  animation: fadeInDown 0.6s ease forwards;
}

/* ==========================================
   AD/BANNER STYLES
   ========================================== */

.ad-container,
.reklam,
.banner-ad {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px auto;
  padding: 10px 0;
  background: #f8f9fa;
  border-radius: 8px;
  overflow: hidden;
}

.ad-container img,
.reklam img,
.banner-ad img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 auto;
}

.ad-container > *,
.reklam > *,
.banner-ad > * {
  margin: 0 auto;
  max-width: 100%;
}

/* Top banner ad (above header) */
.ad-container.top-ad,
.modern-topbar + .reklam {
  margin-top: 0;
  border-radius: 0;
  background: #ffffff;
  margin-bottom: 0;
}

/* Header ad */
.modern-header .reklam {
  margin: 10px 0;
  background: transparent;
}

/* Inline content ads */
.ad-container.content-ad {
  margin: 30px auto;
  max-width: 728px;
}

/* Sidebar ads */
.ad-container.sidebar-ad {
  margin: 20px 0;
  max-width: 300px;
}

/* Ad wrapper for custom HTML/Scripts */
.reklam iframe,
.reklam ins {
  display: block;
  margin: 0 auto;
}

/* Responsive ad sizes */
@media (max-width: 768px) {
  .ad-container,
  .reklam,
  .banner-ad {
    margin: 15px auto;
    padding: 8px 0;
  }

  .ad-container.content-ad {
    max-width: 100%;
  }

  .ad-container.sidebar-ad {
    max-width: 100%;
  }
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -15px;
}

.col,
.col-md-3,
.col-md-4,
.col-md-6,
.col-md-8,
.col-md-12 {
  padding: 0 15px;
}

@media (min-width: 768px) {
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-8 { flex: 0 0 66.666%; max-width: 66.666%; }
  .col-md-12 { flex: 0 0 100%; max-width: 100%; }
}

@media (max-width: 767px) {
  .col,
  .col-md-3,
  .col-md-4,
  .col-md-6,
  .col-md-8,
  .col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}
