/* Top Header Styling */

.sravz-top-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-bottom: 2px solid #e0e0e0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 0;
}

.top-header-content {
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  gap: 2rem;
}

/* Header Logo - Enlarged */
.header-logo {
  flex: 0 0 auto;
}

.header-logo a {
  display: flex;
  align-items: center;
  gap: 1rem;
  text-decoration: none;
  transition: all 0.3s ease;
}

.header-logo a:hover {
  transform: translateY(-2px);
}

.header-logo img {
  max-width: 60px;
  max-height: 60px;
  object-fit: contain;
  filter: none;
  background: transparent !important;
  transition: transform 0.3s ease;
}

.header-logo a:hover img {
  transform: scale(1.1) rotate(5deg);
  filter: drop-shadow(0 4px 8px rgba(124, 58, 237, 0.3));
}

.header-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #333;
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Header Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Theme Toggle Container in Header */
.theme-toggle-container {
  position: relative;
  margin-left: 0.5rem;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
}

.theme-toggle:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.5);
}

.theme-toggle i {
  transition: transform 0.3s ease;
}

.theme-toggle:hover i {
  transform: rotate(15deg);
}

/* Theme Palette Dropdown */
.theme-palette {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 1rem;
  min-width: 280px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 2000;
}

.theme-palette.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-palette-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f0f0f0;
}

.theme-palette-header span {
  font-weight: 600;
  font-size: 1rem;
  color: #333;
}

.theme-palette-close {
  background: transparent;
  border: none;
  color: #666;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.25rem;
  transition: all 0.2s ease;
  border-radius: 4px;
}

.theme-palette-close:hover {
  color: #333;
  background: #f0f0f0;
}

.theme-options {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.theme-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-option:hover {
  border-color: #7c3aed;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.2);
}

.theme-option.active {
  border-color: #7c3aed;
  background: linear-gradient(135deg, #f5f3ff 0%, #ede9fe 100%);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.theme-preview {
  width: 100%;
  height: 40px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.theme-option span {
  font-size: 0.875rem;
  font-weight: 600;
  color: #333;
}

.header-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.header-link i {
  font-size: 1.1rem;
  transition: transform 0.3s ease;
}

.header-link:hover i {
  transform: scale(1.2);
}

/* Try Sravz Button */
.header-link.try-sravz {
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.3);
}

.header-link.try-sravz:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.5);
}

/* GitHub Button */
.header-link.github {
  background: white;
  color: #333;
  border-color: #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header-link.github:hover {
  background: #333;
  color: white;
  border-color: #333;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Adjust main content to account for fixed header */
body {
  padding-top: 0;
}

.flex.container {
  margin-top: 0;
}

/* Theme Variations */
/* Light Professional Theme */
body.sidebar-theme-light .sravz-top-header {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

body.sidebar-theme-light .header-title {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.sidebar-theme-light .header-link.try-sravz {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 100%);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

body.sidebar-theme-light .header-link.try-sravz:hover {
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.5);
}

/* Ocean Blue Theme */
body.sidebar-theme-ocean .sravz-top-header {
  background: linear-gradient(135deg, #e0f2fe 0%, #f0f9ff 100%);
  border-bottom-color: #bae6fd;
}

body.sidebar-theme-ocean .header-title {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.sidebar-theme-ocean .header-link.try-sravz {
  background: linear-gradient(135deg, #0284c7 0%, #0ea5e9 100%);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
}

body.sidebar-theme-ocean .header-link.try-sravz:hover {
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.5);
}

/* Sunset Theme */
body.sidebar-theme-sunset .sravz-top-header {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border-bottom-color: #fed7aa;
}

body.sidebar-theme-sunset .header-title {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.sidebar-theme-sunset .header-link.try-sravz {
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.3);
}

body.sidebar-theme-sunset .header-link.try-sravz:hover {
  box-shadow: 0 6px 16px rgba(234, 88, 12, 0.5);
}

/* Dark Mode Theme */
body.sidebar-theme-dark .sravz-top-header {
  background: linear-gradient(135deg, #1f2937 0%, #111827 100%);
  border-bottom-color: #374151;
}

body.sidebar-theme-dark .header-title {
  background: linear-gradient(135deg, #a78bfa 0%, #c4b5fd 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.sidebar-theme-dark .header-link.try-sravz {
  background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.5);
}

body.sidebar-theme-dark .header-link.try-sravz:hover {
  box-shadow: 0 6px 16px rgba(124, 58, 237, 0.7);
}

body.sidebar-theme-dark .header-link.github {
  background: #374151;
  color: #f9fafb;
  border-color: #4b5563;
}

body.sidebar-theme-dark .header-link.github:hover {
  background: #f9fafb;
  color: #1f2937;
  border-color: #e5e7eb;
}

/* Minimal Gray Theme */
body.sidebar-theme-minimal .sravz-top-header {
  background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
  border-bottom-color: #e5e7eb;
}

body.sidebar-theme-minimal .header-title {
  background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

body.sidebar-theme-minimal .header-link.try-sravz {
  background: linear-gradient(135deg, #4b5563 0%, #6b7280 100%);
  box-shadow: 0 4px 12px rgba(75, 85, 99, 0.3);
}

body.sidebar-theme-minimal .header-link.try-sravz:hover {
  box-shadow: 0 6px 16px rgba(75, 85, 99, 0.5);
}

/* Responsive Design */
@media (max-width: 768px) {
  .top-header-content {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .header-logo {
    flex: 1 1 100%;
    justify-content: center;
  }

  .header-logo a {
    justify-content: center;
  }

  .header-logo img {
    max-width: 50px;
    max-height: 50px;
  }

  .header-title {
    font-size: 1.25rem;
  }

  .header-nav {
    flex: 1 1 100%;
    justify-content: center;
    gap: 0.5rem;
  }

  .header-link {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }

  .header-link span {
    display: none;
  }

  .header-link i {
    margin: 0;
  }

  .theme-toggle {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    margin-left: 0.5rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .top-header-content {
    padding: 0.875rem 1.5rem;
  }

  .header-logo img {
    max-width: 55px;
    max-height: 55px;
  }

  .header-title {
    font-size: 1.35rem;
  }
}

@media (min-width: 1920px) {
  .top-header-content {
    max-width: 1920px;
    padding: 1.25rem 3rem;
  }

  .header-logo img {
    max-width: 70px;
    max-height: 70px;
  }

  .header-title {
    font-size: 1.75rem;
  }
}

/* Animation on page load */
@keyframes slideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.sravz-top-header {
  animation: slideDown 0.5s ease;
}
