/* Custom CSS for AdSpot Website */

/* Global Styles */
:root {
  --primary-color: #0d6efd;
  --secondary-color: #6c757d;
  --success-color: #198754;
  --info-color: #0dcaf0;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #212529;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  line-height: 1.6;
  padding-top: 56px;
}

/* Hero Section */
.hero-section {
  background: linear-gradient(135deg, var(--primary-color) 0%, #0a58ca 100%);
  padding: 5rem 0;
  margin-bottom: 2rem;
}

.hero-section h1 {
  font-weight: 700;
  margin-bottom: 1.5rem;
}

/* Card Styles */
.card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-radius: 0.5rem;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.card-img-top {
  height: 200px;
  object-fit: cover;
}

/* Icon Box */
.icon-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background-color: rgba(13, 110, 253, 0.1);
  color: var(--primary-color);
  margin-bottom: 1.5rem;
}

/* Category Cards */
.category-card {
  text-align: center;
  padding: 1.5rem;
}

.category-card i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

/* Material Cards */
.material-card .badge {
  position: absolute;
  top: 10px;
  right: 10px;
}

.material-card .card-footer {
  background-color: transparent;
  border-top: none;
}

/* Ad Container */
.ad-container {
  background-color: var(--light-color);
  border-radius: 0.5rem;
}

/* Footer */
footer {
  background-color: var(--dark-color);
}

footer .social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s ease;
}

footer .social-icons a:hover {
  background-color: var(--primary-color);
}

/* Admin Dashboard */
.sidebar {
  min-height: calc(100vh - 56px);
  background-color: var(--dark-color);
}

.sidebar .nav-link {
  color: rgba(255, 255, 255, 0.75);
  padding: 0.75rem 1rem;
  border-radius: 0.25rem;
  margin-bottom: 0.25rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  color: white;
  background-color: rgba(255, 255, 255, 0.1);
}

.sidebar .nav-link i {
  margin-right: 0.5rem;
}

/* Form Styles */
.form-control:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Buttons */
.btn {
  border-radius: 0.25rem;
  padding: 0.5rem 1.25rem;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

/* Base styles */
.pagination .page-link {
  color: var(--primary-color);
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
}

.pagination .page-item.active .page-link {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: #fff;
}

/* Responsive fix for small screens */
@media (max-width: 576px) {
  .pagination {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
  }

  .pagination .page-item {
    flex: 1 0 auto;
  }

  .pagination .page-link {
    font-size: 0.875rem;
    padding: 0.4rem 0.6rem;
    min-width: 20px; /* Enough to fit "Previous" */
    text-align: center;
    word-break: keep-all;
  }
}


/* Responsive Adjustments */
@media (max-width: 767.98px) {
  .hero-section {
    padding: 3rem 0;
  }
  
  .hero-section h1 {
    font-size: 2.5rem;
  }
}

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

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

/* Material Detail Page */
.material-detail-img {
  max-height: 400px;
  object-fit: contain;
}

.material-tags .badge {
  margin-right: 0.5rem;
  margin-bottom: 0.5rem;
}

/* Contact Form */
.contact-form {
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  padding: 2rem;
}

/* Login Form */
.login-form {
  max-width: 400px;
  margin: 0 auto;
  padding: 2rem;
  background-color: white;
  border-radius: 0.5rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Search Results */
.search-highlight {
  background-color: rgba(255, 193, 7, 0.3);
  padding: 0 0.25rem;
}

/* Loading Spinner */
.spinner-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

.text-primary {
            color: #5a5c69 !important;
        }
        
      .dropzone {
          border: 2px dashed #e3e6f0;
          border-radius: 0.35rem;
          background: white;
          min-height: 150px;
          padding: 20px;
          text-align: center;
          cursor: pointer;
          transition: all 0.3s ease;
      }
      
      .dropzone:hover {
          border-color: #4e73df;
          background-color: #f8f9fc;
      }
      
      .dropzone .dz-message {
          margin: 2em 0;
      }
      
      .dropzone .dz-message h4 {
          color: #5a5c69;
          font-weight: 600;
      }
      
      .dropzone .dz-message i {
          color: #4e73df;
      }
      
      .btn-primary {
          background-color: #4e73df;
          border-color: #4e73df;
      }
      
      .btn-primary:hover {
          background-color: #2e59d9;
          border-color: #2653d4;
      }
      
      .btn-secondary {
          background-color: #858796;
          border-color: #858796;
      }
      
      .alert {
          border-radius: 0.35rem;
          margin-top: 1rem;
      }
      
      .container {
          max-width: 1000px;
          margin-top: 2rem;
      }
      
      .test-info {
          background-color: #d1ecf1;
          border: 1px solid #bee5eb;
          border-radius: 0.35rem;
          padding: 1rem;
          margin-bottom: 2rem;
      }
      
      .test-info h5 {
          color: #0c5460;
          margin-bottom: 0.5rem;
      }
      
      .test-info p {
          color: #0c5460;
          margin-bottom: 0;
      }
      
      .debug-panel {
          background-color: #f8f9fa;
          border: 1px solid #dee2e6;
          border-radius: 0.35rem;
          padding: 1rem;
          margin-top: 1rem;
          max-height: 300px;
          overflow-y: auto;
          font-family: 'Courier New', monospace;
          font-size: 0.85rem;
      }
      
      .debug-panel h6 {
          color: #495057;
          margin-bottom: 0.5rem;
      }
      
      .debug-log {
          background-color: #ffffff;
          border: 1px solid #e9ecef;
          border-radius: 0.25rem;
          padding: 0.5rem;
          margin-bottom: 0.5rem;
          white-space: pre-wrap;
          word-break: break-all;
      }
      
      .debug-controls {
          margin-bottom: 1rem;
      }
      
      .status-indicator {
          display: inline-block;
          width: 12px;
          height: 12px;
          border-radius: 50%;
          margin-right: 8px;
      }
      
      .status-success { background-color: #28a745; }
      .status-error { background-color: #dc3545; }
      .status-warning { background-color: #ffc107; }
      .status-info { background-color: #17a2b8; }

      /* General layout for the main content area */
  .main-content {
      margin-left: 0; /* Default for mobile */
      transition: margin-left 0.3s ease-in-out;
  }

  /* Sidebar styles */
  .sidebar {
      position: fixed;
      top: 0;
      bottom: 0;
      left: 0;
      z-index: 1050; /* Higher than main content, lower than modals */
      padding: 48px 0 0; /* Height of navbar */
      box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
      transition: transform 0.3s ease-in-out; /* Smooth transition for sliding */
      transform: translateX(-100%); /* Start off-screen */
      width: 250px; /* Fixed width for the slider on mobile */
      background-color: #343a40; /* Ensure background color is set for sliding */
  }

  /* When sidebar is shown on small screens */
  .sidebar.show {
      transform: translateX(0%);
  }

  /* Overlay for mobile */
  .overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: rgba(0, 0, 0, 0.5);
      z-index: 1040; /* Below sidebar, above main content */
      display: none; /* Hidden by default */
  }

  .overlay.active {
      display: block;
  }

  /* Media queries for desktop view */
  @media (min-width: 768px) {
      .sidebar {
          position: fixed; /* Keep fixed for desktop */
          top: 0;
          bottom: 0;
          left: 0;
          z-index: 100; /* Lower z-index for desktop */
          padding: 48px 0 0;
          box-shadow: inset -1px 0 0 rgba(0, 0, 0, .1);
          transform: translateX(0%); /* Always visible on desktop */
          width: auto; /* Let Bootstrap columns define width */
      }

      /* Override Bootstrap's collapse for md and up */
      .sidebar.collapse {
          display: block;
      }

      /* Adjust main content margin for desktop sidebar */
      .main-content {
          /* This should match the width of your sidebar on desktop */
          /* If col-md-3 is roughly 250px, use that. Adjust as needed. */
          margin-left: 250px;
      }

      /* Hide overlay on desktop */
      .overlay {
          display: none !important;
      }
  }

    .overlay.active {
  display: block !important;
}

