:root {
  --primary: #2e8b57;
  --primary-light: #3cb371;
  --primary-dark: #1e6b47;
  --secondary: #f5f5f5;
  --accent: #87ceeb;
  --dark: #2c3e50;
  --light: #f8f9fa;
  --gradient-primary: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );
  --background-light: #f1f5f9;
  --text-light: #64748b;
  --card-bg-light: #ffffff;
  --border-color-light: #e2e8f0;
  --success-color: #10b981;
  --danger-color: #f87171;
  --warning-color: #fbbf24;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--background-light);
  color: var(--text-light);
  padding-top: 20px;
  overflow-x: hidden;
}

/* Sidebar Styles */
#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 260px;
  background: var(--gradient-primary);
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: all 0.3s ease-in-out;
  z-index: 1030;
  overflow-x: hidden;
}

#sidebar.collapsed {
  width: 70px;
}

#sidebar.collapsed .sidebar-logo-text,
#sidebar.collapsed .nav-link-text,
#sidebar.collapsed .nav-item .bi-chevron-down {
  display: none !important;
}

.sidebar-logo {
  padding: 1.15rem 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
}

.sidebar-nav .nav-link {
  color: white;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  font-weight: 500;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.sidebar-nav .nav-link i {
  margin-right: 0.75rem;
  font-size: 1.1rem;
  width: 24px;
  text-align: center;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  color: white;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 0.375rem;
}

/* Main Content */
#main-content {
  margin-left: 260px;
  padding: 1.5rem;
  transition: margin-left 0.3s ease-in-out;
}

#main-content.expanded {
  margin-left: 70px;
}

/* Header */
.fixed-header {
  position: sticky;
  top: 0;
  background-color: var(--card-bg-light);
  border-radius: 0.75rem;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 0.25rem 0.75rem rgba(46, 139, 87, 0.1);
  z-index: 1020;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color-light);
}

/* Cards */
.card {
  border: none;
  border-radius: 1rem;
  box-shadow: 0 0.5rem 1.5rem rgba(46, 139, 87, 0.08);
  transition: all 0.3s;
  background: var(--card-bg-light);
  color: var(--text-light);
  overflow: hidden;
}

.card:hover {
  box-shadow: 0 1rem 2rem rgba(46, 139, 87, 0.15);
  transform: translateY(-5px);
}

.card-header {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 1.5rem;
}

.card-body {
  padding: 2rem;
}

/* Carousel Styles */
.carousel-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.carousel-form-section {
  background: var(--card-bg-light);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 0.5rem 1.5rem rgba(46, 139, 87, 0.08);
  border: 1px solid var(--border-color-light);
  display: none;
}

.carousel-form-section.active {
  display: block; /* Show when active */
}

.carousel-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-row .form-group {
  flex: 1;
}

.upload-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border: 2px dashed var(--border-color-light);
  border-radius: 1rem;
  background: var(--secondary);
  transition: all 0.3s;
}

.upload-container:hover {
  border-color: var(--primary);
  background: rgba(46, 139, 87, 0.05);
}

.upload-preview {
  width: 100%;
  height: 150px;
  border: 1px solid var(--border-color-light);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  overflow: hidden;
}

.upload-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: cover;
}

.logo-preview {
  width: 120px;
  height: 80px;
  border: 1px solid var(--border-color-light);
  border-radius: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  overflow: hidden;
}

.logo-preview img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.carousel-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

/* Existing Slides Section - Updated */
.existing-slides-section {
  margin-bottom: 2rem;
}

.existing-slides {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.slide-card {
  border: 1px solid var(--border-color-light);
  border-radius: 0.75rem;
  overflow: hidden;
  background: var(--card-bg-light);
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  position: relative;
}

.slide-card:hover {
  border-color: var(--primary);
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(46, 139, 87, 0.1);
}

.slide-card.active {
  border-color: var(--primary);
  background: rgba(46, 139, 87, 0.05);
}

.slide-card-header {
  position: relative;
  padding: 0.75rem 1rem;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slide-card-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-card-order {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
}

.slide-thumbnail {
  width: 100%;
  height: 160px;
  overflow: hidden;
  position: relative;
}

.slide-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.slide-card:hover .slide-thumbnail img {
  transform: scale(1.05);
}

.slide-info {
  padding: 1rem;
}

.slide-content {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.slide-actions {
  display: flex;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--border-color-light);
  background: var(--secondary);
}

.btn-edit {
  background: var(--warning-color);
  color: white;
  border: none;
  border-radius: 0.5rem;
  padding: 0.75rem;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: all 0.3s;
  width: 100%;
  font-weight: 600;
  text-align: center;
}

.btn-edit:hover {
  background: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(245, 158, 11, 0.3);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.9rem;
}

/* Buttons */
.btn-primary {
  background: var(--gradient-primary) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(46, 139, 87, 0.3);
  border-radius: 0.75rem !important;
  transition: all 0.3s ease;
  font-weight: 600;
  padding: 12px 30px;
}

.btn-primary:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 25px rgba(46, 139, 87, 0.4) !important;
}

.btn-outline-secondary {
  border: 2px solid var(--border-color-light) !important;
  color: var(--text-light) !important;
  border-radius: 0.75rem !important;
  transition: all 0.3s ease;
  font-weight: 600;
  padding: 12px 30px;
}

.btn-outline-secondary:hover {
  border-color: var(--primary) !important;
  color: var(--primary) !important;
  transform: translateY(-3px);
  box-shadow: 0 4px 15px rgba(46, 139, 87, 0.2);
}

.btn-success {
  background: var(--success-color) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
  border-radius: 0.75rem !important;
  transition: all 0.3s ease;
  font-weight: 600;
  padding: 12px 30px;
}

.btn-success:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.4) !important;
}

.btn-warning {
  background: var(--warning-color) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(251, 191, 36, 0.3);
  border-radius: 0.75rem !important;
  padding: 8px 16px;
}

.btn-danger {
  background: var(--danger-color) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(248, 113, 113, 0.3);
  border-radius: 0.75rem !important;
  padding: 8px 16px;
}

/* Form Controls */
.form-control {
  border: 2px solid var(--border-color-light);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  transition: all 0.3s;
  background: var(--card-bg-light);
  font-weight: 500;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.1);
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

/* Responsive */
@media (max-width: 991px) {
  #sidebar {
    left: -280px;
    width: 280px;
  }

  #sidebar.active {
    left: 0;
  }

  #main-content {
    margin-left: 0 !important;
    padding: 1rem;
    margin-top: 0;
  }

  .carousel-container {
    margin-top: 80px;
  }

  .form-row {
    flex-direction: column;
  }

  .existing-slides {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}

@media (max-width: 767px) {
  #main-content {
    padding: 0.5rem;
    margin-top: 0;
  }

  .carousel-container {
    margin-top: 20px;
  }

  .carousel-actions {
    flex-direction: column;
  }

  .carousel-actions .btn {
    width: 100%;
    max-width: 250px;
  }

  .existing-slides {
    grid-template-columns: 1fr;
  }
}

/* Status Messages */
.alert {
  border-radius: 0.75rem;
  border: none;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background: rgba(248, 113, 113, 0.1);
  color: var(--danger-color);
  border-left: 4px solid var(--danger-color);
}

