/* Custom Styles with Dark Purple Gradients and Glassmorphism */

:root {
  --primary-color: #6a11cb;
  --secondary-color: #2575fc;
  --dark-purple: #4a148c;
  --light-purple: #9c27b0;
  --accent-color: #ff4081;
  --text-light: #f8f9fa;
  --text-dark: #212529;
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.2);
  --dark-blue: #131A2A;
  --navy-blue: #0A1845; /* Updated navy blue color */
}

body {
  background: #131A2A;
  color: var(--text-light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

main {
  flex: 1 0 auto;
  min-height: calc(100vh - 300px); /* Ensure minimum height pushes footer down */
}

footer {
  flex-shrink: 0;
}

/* Navbar Styling */
.navbar {
  background: rgba(28, 34, 54, 0.9) !important;
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(59, 89, 152, 0.2);
  position: relative;
  z-index: 1040; /* High z-index to ensure navbar stays above content but below dropdowns */
}

/* Dropdown Menu Styling - Ensure it's above everything */
.dropdown-menu {
  z-index: 9999 !important;
}

/* Fix for Bootstrap Dropdowns */
.dropdown-menu.show {
  position: absolute !important;
  z-index: 9999 !important;
}

/* Jumbotron Styling - Ensure it stays below dropdowns */
.jumbotron, .home-jumbotron {
  position: relative;
  z-index: 1 !important;
}

.navbar-brand {
  font-weight: 700;
  color: white !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.8) !important;
  transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
  color: white !important;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Glassmorphism Cards */
.card {
  background: rgba(28, 34, 54, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 89, 152, 0.2);
  border-radius: 15px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
}

.card-header {
  background: linear-gradient(135deg, #1E293B 0%, #131A2A 100%);
  color: white;
  border-radius: 15px 15px 0 0 !important;
  border-bottom: 1px solid rgba(59, 89, 152, 0.2);
}

.card-body {
  color: var(--text-light);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(45deg, #1E293B, #3B5998);
  border: none;
  border-radius: 10px;
  padding: 10px 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: linear-gradient(45deg, #3B5998, #1E293B);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

/* Jumbotron */
.jumbotron {
  background: rgba(28, 34, 54, 0.3);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 89, 152, 0.2);
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Home page specific jumbotron */
.home-jumbotron {
  background: linear-gradient(135deg, rgba(28, 34, 54, 0.7) 0%, rgba(19, 26, 42, 0.9) 100%);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(59, 89, 152, 0.2);
}

/* Product/Category Images */
.card img {
  border-radius: 10px;
  box-shadow: 0 4px 15px 0 rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

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

/* Icons */
.card i {
  color: var(--accent-color);
  text-shadow: 0 0 10px rgba(255, 64, 129, 0.5);
}

/* Footer */
.footer-gradient {
  background: linear-gradient(to bottom, #131A2A, #1C2236) !important;
  position: relative;
  border-top: 1px solid rgba(59, 89, 152, 0.2);
}

.footer-gradient::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('/static/img/tt.png');
  opacity: 0.05;
  pointer-events: none;
}

.footer-heading {
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  position: relative;
  padding-bottom: 0.8rem;
}

.footer-heading::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 50px;
  height: 3px;
  background: linear-gradient(45deg, #3B5998, #1E293B);
  border-radius: 3px;
}

.footer-text {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  line-height: 1.6;
}

.footer-links li {
  margin-bottom: 8px;
  transition: transform 0.3s ease;
}

.footer-links li:hover {
  transform: translateX(5px);
}

.footer-link {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: white;
  text-decoration: none;
}

.social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  margin-right: 10px;
  color: white;
  transition: all 0.3s ease;
}

.social-icon:hover {
  background: white;
  color: #000;
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.footer-divider {
  border-color: rgba(255, 255, 255, 0.1);
  margin: 15px 0;
}

.copyright-text {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
}

/* Breadcrumbs */
.breadcrumb {
  background: rgba(28, 34, 54, 0.5);
  border-radius: 10px;
  padding: 10px 15px;
  border: 1px solid rgba(59, 89, 152, 0.2);
}

.breadcrumb-item a {
  color: var(--accent-color);
  text-decoration: none;
}

.breadcrumb-item.active {
  color: var(--text-light);
}

/* Forms */
.form-control {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  color: white;
  border-radius: 30px;
}

.form-control:focus {
  background: rgba(255, 255, 255, 0.15);
  color: white;
  box-shadow: 0 0 0 0.25rem rgba(10, 24, 69, 0.25);
}

/* Login and signup form styling */
.login-card, .signup-card {
  background-color: var(--navy-blue);
  color: var(--text-light);
}

.login-card h2, .signup-card h2 {
  color: white;
}

.login-form .form-group label, .signup-form .form-group label,
.form-check-label, .password-hint {
  color: rgba(255, 255, 255, 0.8);
}

.btn-login, .btn-signup {
  background-color: var(--navy-blue);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-login:hover, .btn-signup:hover {
  background-color: #0D225A;
}

/* Tables */
.table {
  color: var(--text-light);
}

.table-bordered {
  border-color: var(--glass-border);
}

.table thead th {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  border-color: var(--glass-border);
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Staggered animations for lists */
.stagger-item-1 { animation-delay: 0.1s; }
.stagger-item-2 { animation-delay: 0.2s; }
.stagger-item-3 { animation-delay: 0.3s; }
.stagger-item-4 { animation-delay: 0.4s; }
.stagger-item-5 { animation-delay: 0.5s; }
.stagger-item-6 { animation-delay: 0.6s; }
.stagger-item-7 { animation-delay: 0.7s; }
.stagger-item-8 { animation-delay: 0.8s; }

/* Category and product image styles */
.category-image {
  max-height: 150px; 
  border-radius: 10px; 
  box-shadow: 0 4px 15px 0 rgba(0, 0, 0, 0.2);
}

.product-image {
  max-height: 100px;
  border-radius: 10px;
  box-shadow: 0 4px 15px 0 rgba(0, 0, 0, 0.2);
}

/* Text shadow for headings */
.text-glow {
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Product price */
.text-danger {
  color: var(--accent-color) !important;
  font-weight: bold;
}

/* Admin panel specific */
.admin-panel .card {
  background: rgba(255, 255, 255, 0.1);
}

.admin-panel .table {
  background: rgba(0, 0, 0, 0.2);
}

.admin-link {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

.admin-link a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
}

.admin-link:hover {
    opacity: 1;
}

.admin-link a:hover {
    color: rgba(255, 255, 255, 1);
    text-decoration: underline;
}

/* Hide admin link on small screens */
@media (max-width: 768px) {
    .admin-link {
        display: none;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .card {
    margin-bottom: 20px;
  }
}

/* Content Editor button styling */
.btn-purple {
    background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(123, 31, 162, 0.3);
}

.btn-purple:hover {
    background: linear-gradient(135deg, #7b1fa2 0%, #6a1b9a 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(123, 31, 162, 0.5);
}

/* Admin shortcut hint */
