/**
 * Common Styles - Shared across all pages
 * Contains navbar, footer, buttons, and other reusable components
 * Page-specific CSS files can override these styles as needed
 */

/* === GLOBAL STYLES === */
body {
  background-color: var(--body-bg);
  /*font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;*/
}

/* Body padding for pages with secondary navbar */
body.has-secondary-navbar {
  padding-top: 136px; /* Primary navbar (56px) + Secondary navbar (60px) + spacing (20px) */
}

@media (max-width: 767px) {
  body.has-secondary-navbar {
    padding-top: 126px; /* Primary navbar (56px) + Secondary navbar (50px) + spacing (20px) */
  }
}

/* === PRIMARY NAVBAR STYLES === */
.navbar {
  background: var(--gradient-primary) !important;
  box-shadow: 0 2px 20px var(--shadow-primary);
  backdrop-filter: blur(10px);
  z-index: 1030;
}

.navbar-brand img {
  max-height: 40px;
  filter: brightness(1.1);
}

.navbar-nav .nav-link {
  font-weight: 600;
  color: var(--text-white) !important;
  transition: all 0.3s ease;
  position: relative;
  padding: 0.8rem 1.2rem !important;
}

.navbar-nav .nav-link:hover {
  color: var(--text-light) !important;
  transform: translateY(-2px);
}

.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: 0;
  left: 50%;
  background-color: var(--text-white);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
  width: 80%;
}

/* === NAVBAR RESPONSIVE STYLES === */
@media (max-width: 991.98px) {
  .navbar-collapse {
    text-align: center;
  }
  
  .navbar-nav {
    margin: 0 auto !important;
  }
  
  .navbar-nav .nav-link {
    text-align: center;
    padding: 1rem 1.2rem !important;
  }
}

/* === HAMBURGER MENU STYLING === */
.navbar-toggler {
  border: 2px solid var(--text-white);
  border-radius: 8px;
  padding: 0.5rem;
  transition: all 0.3s ease;
}

.navbar-toggler:hover {
  border-color: var(--text-light);
  background-color: var(--button-hover-bg);
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.2rem var(--shadow-focus);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* === SECONDARY NAVBAR STYLES === */
.secondary-navbar {
  background: var(--surface-bg);
  border-bottom: 1px solid var(--shadow-light);
  box-shadow: 0 2px 8px var(--shadow-light);
  z-index: 1029;
  height: 60px;
  position: fixed;
  top: 56px; /* Below primary navbar */
  left: 0;
  right: 0;
  width: 100%;
}

.secondary-nav-container {
  padding: 0;
  height: 100%;
  display: flex;
  align-items: center;
}

.secondary-nav-scroll {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 0 15px;
  height: 100%;
  width: 100%;
}

.secondary-nav-scroll::-webkit-scrollbar {
  display: none;
}

.secondary-nav-item {
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0 18px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  height: 100%;
  min-height: 60px;
}

.secondary-nav-item:hover {
  color: var(--primary-color);
  background: rgba(var(--primary-color-rgb), 0.05);
  text-decoration: none;
  transform: translateY(-1px);
}

.secondary-nav-item.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background: rgba(var(--primary-color-rgb), 0.1);
  font-weight: 600;
}

.secondary-nav-item i {
  font-size: 0.85rem;
  color: inherit;
}

/* === SECONDARY NAVBAR RESPONSIVE STYLES === */
@media (max-width: 767px) {
  .secondary-nav-item {
    padding: 0 14px;
    font-size: 0.85rem;
    min-height: 50px;
  }
  
  .secondary-nav-scroll {
    padding: 0 10px;
  }
  
  .secondary-navbar {
    height: 50px;
  }
}

/* === FOOTER STYLES === */
.site-footer {
  background: var(--gradient-footer);
  color: var(--text-white);
  padding: 3rem 0 1.5rem 0;
  margin-top: 4rem;
  border-top: 1px solid var(--border-white-alpha);
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.footer-logo {
  text-align: center;
}

.footer-logo img {
  max-height: 50px;
  margin-bottom: 1rem;
  filter: brightness(1.2);
}

/* Alternative footer logo styling for white logo requirement */
.footer-logo img.white-logo {
  filter: brightness(0) invert(1); /* Makes logo white */
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 4rem;
  text-align: center;
}

.footer-links .footer-section {
  flex: 1;
  max-width: 200px;
}

/* Alternative grid layout for pages that need it */
.footer-links.grid-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  text-align: left;
}

.footer-links.grid-layout .footer-section {
  flex: none;
  max-width: none;
}

/* Index-style footer links (flex layout) - DEPRECATED: Now default */
.footer-links.flex-layout {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 4rem;
  text-align: center;
}

.footer-links.flex-layout .footer-section {
  flex: 1;
  max-width: 200px;
}

.footer-section {
  margin-bottom: 1.5rem;
}

.footer-section h6 {
  color: var(--text-white);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section ul li a {
  color: var(--text-white-alpha-8);
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.85rem;
}

.footer-section ul li a:hover {
  color: var(--text-white);
  text-decoration: underline;
  transform: translateX(5px);
}

/* Footer contact section */
.footer-contact {
  text-align: center;
}

.footer-contact h6 {
  color: var(--text-white);
  font-weight: 600;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.footer-contact p {
  color: var(--text-white-alpha-8);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

/* Footer social section */
.footer-social {
  margin-top: 1rem;
}

.footer-social a {
  color: var(--text-white-alpha-8);
  font-size: 1.2rem;
  margin: 0 0.5rem;
  transition: color 0.3s ease;
}

.footer-social a:hover {
  color: var(--text-white);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid var(--border-white-alpha);
}

.footer-bottom p {
  margin: 0;
  color: var(--text-white-alpha-7);
  font-size: 0.8rem;
}

/* === FOOTER RESPONSIVE STYLES === */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 2rem;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 2rem;
    align-items: center;
  }
  
  .footer-links .footer-section {
    max-width: 250px;
  }
  
  /* Grid layout responsive */
  .footer-links.grid-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  /* Flex layout responsive - same as default now */
  .footer-links.flex-layout {
    flex-direction: column;
    gap: 2rem;
    align-items: center;
  }
  
  .footer-links.flex-layout .footer-section {
    max-width: 250px;
  }
  
  .site-footer {
    padding: 2rem 0 1rem 0;
    margin-top: 2rem;
  }
}

@media (max-width: 480px) {
  .footer-links {
    gap: 1.5rem;
  }
  
  .footer-links .footer-section {
    max-width: 200px;
  }
  
  .footer-links.grid-layout {
    gap: 1.5rem;
  }
  
  .footer-links.flex-layout {
    gap: 1.5rem;
  }
  
  .footer-links.flex-layout .footer-section {
    max-width: 200px;
  }
}

/* === COMMON BUTTON STYLES === */
.btn-primary {
  background: var(--gradient-primary);
  border: none;
  border-radius: 50px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(var(--primary-color-rgb), 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(var(--primary-color-rgb), 0.4);
}

.btn-outline-primary {
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  border-radius: 50px;
  padding: 0.75rem 2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
  background: transparent;
}

.btn-outline-primary:hover {
  background: var(--primary-color);
  color: var(--text-white);
  transform: translateY(-2px);
}

/* === COMMON CARD STYLES === */
.card {
  border: none;
  border-radius: 15px;
  box-shadow: 0 5px 25px var(--shadow-default);
  transition: all 0.3s ease;
  background: var(--surface-bg);
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 35px var(--shadow-hover);
}

.card-header {
  background: var(--gradient-primary);
  color: var(--text-white);
  border: none;
  padding: 1.5rem;
  font-weight: 600;
}

.card-body {
  padding: 2rem;
}

/* === COMMON FORM STYLES === */
.form-control {
  border-radius: 10px;
  border: 2px solid var(--border-light);
  padding: 0.75rem 1rem;
  transition: all 0.3s ease;
  background: var(--surface-bg);
}

.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.25);
  background: var(--surface-bg);
}

/* === COMMON UTILITY CLASSES === */
.text-gradient {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

.bg-gradient-primary {
  background: var(--gradient-primary) !important;
}

.shadow-custom {
  box-shadow: 0 10px 30px rgba(var(--primary-color-rgb), 0.2) !important;
}

.border-radius-custom {
  border-radius: 15px !important;
}

/* === COMMON ANIMATION CLASSES === */
.fade-in {
  animation: fadeIn 0.6s ease-in;
}

.slide-up {
  animation: slideUp 0.6s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* === COMMON LOADING STATES === */
.loading {
  position: relative;
  color: transparent !important;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--border-light);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === SCROLLBAR STYLING === */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--border-light);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}
