/* VK Solar Energy - Green Theme Custom CSS */
:root {
  --primary: #2e8b57; /* Forest Green */
  --primary-light: #3cb371; /* Medium Sea Green */
  --primary-dark: #1e6b47; /* Darker Green */
  --secondary: #f5f5f5; /* Off-white */
  --accent: #87ceeb; /* Sky Blue */
  --accent-light: #b0e2ff; /* Light Sky Blue */
  --earth: #d2b48c; /* Tan/Earth tone */
  --earth-light: #f0e6d6; /* Light Beige */
  --dark: #2c3e50; /* Dark Blue-Gray */
  --light: #f8f9fa; /* Light Gray */
  --gradient-primary: linear-gradient(
    135deg,
    var(--primary) 0%,
    var(--primary-light) 100%
  );

  /* Dashboard specific variables */
  --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.collapsed .sidebar-logo {
  justify-content: center;
  padding: 1.15rem 0;
}

#sidebar.collapsed .sidebar-nav .nav-link {
  justify-content: center;
  padding: 0.75rem 0;
}

#sidebar.collapsed .nav-link i {
  margin-right: 0;
}

.sidebar-logo {
  padding: 1.15rem 1.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  transition: all 0.3s ease;
}

.sidebar-logo i {
  margin-right: 10px;
  transition: margin-right 0.3s ease;
}

#sidebar.collapsed .sidebar-logo i {
  margin-right: 0;
}

.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;
  transition: margin-right 0.3s ease;
}

.sidebar-nav .nav-link:hover,
.sidebar-nav .nav-link.active {
  color: white;
  background-color: rgba(255, 255, 255, 0.2);
  border-radius: 0.375rem;
}

.sidebar-nav .nav-item {
  margin: 0 0.5rem 0.25rem;
}

.nav-link-text {
  transition: opacity 0.3s ease;
}

/* --- Main Content Styles --- */
#main-content {
  margin-left: 260px;
  padding: 1.5rem;
  transition: margin-left 0.3s ease-in-out;
}

#main-content.expanded {
  margin-left: 70px;
}

/* --- Fixed Header Styles --- */
.fixed-header {
  position: sticky;
  top: 0;
  background-color: var(--card-bg-light);
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  z-index: 1020;
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color-light);
}

.fixed-header .form-control {
  background-color: transparent;
  border: none;
  color: var(--text-light);
}

.fixed-header .input-group-text {
  background-color: transparent;
  border: none;
  color: var(--text-light);
}

.fixed-header .search-wrapper {
  border: 1px solid var(--border-color-light);
  border-radius: 0.375rem;
  transition: all 0.3s;
}

.fixed-header .search-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(46, 139, 87, 0.1);
}

.header-icon {
  font-size: 1.5rem;
  color: var(--text-light);
  transition: all 0.3s;
  position: relative;
}

.header-icon:hover {
  color: var(--primary);
}

.notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--danger-color);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.7rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-dropdown {
  border: none;
  background: transparent;
  color: var(--text-light);
}

.user-dropdown:hover {
  background-color: rgba(46, 139, 87, 0.1);
}

/* --- Card Styles --- */
.card {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.1rem 0.5rem rgba(0, 0, 0, 0.05);
  transition: all 0.3s;
  background-color: var(--card-bg-light);
  color: var(--text-light);
  border: 1px solid var(--border-color-light);
}

.card:hover {
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08);
}

.card-header {
  background-color: transparent;
  border-bottom: 1px solid var(--border-color-light);
  color: var(--text-light);
  padding: 1rem 1.5rem;
}

/* VK Solar Energy Custom Styling */
.btn-primary {
  background: var(--gradient-primary) !important;
  border: none !important;
  box-shadow: 0 4px 15px rgba(46, 139, 87, 0.3);
  border-radius: 25px !important;
  transition: all 0.3s ease;
  font-weight: 500;
  padding: 12px 30px;
}

.btn-primary:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 25px rgba(46, 139, 87, 0.4) !important;
  background: linear-gradient(
    135deg,
    var(--primary-light) 0%,
    var(--primary) 100%
  ) !important;
}

.text-primary {
  color: var(--primary) !important;
  font-weight: 600;
}

.section-title {
  position: relative;
  margin-bottom: 2rem;
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

/* Sidebar Toggle Button - Always Visible */
.sidebar-toggle-btn {
  background: var(--gradient-primary);
  border: none;
  color: white;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(46, 139, 87, 0.3);
}

.sidebar-toggle-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 15px rgba(46, 139, 87, 0.4);
}

/* Table Styling */
.table {
  color: var(--text-light);
}

.table-hover tbody tr:hover {
  background-color: rgba(46, 139, 87, 0.05);
}

/* --- Sidebar Close Button - Hidden on Desktop --- */
.sidebar-close-btn {
  display: none;
  position: absolute;
  top: 15px;
  right: 15px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1050;
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Hide close button on desktop by default */
@media (min-width: 992px) {
  .sidebar-close-btn {
    display: none !important;
  }
}

/* --- Notification Dropdown Fix --- */
.dropdown-menu {
  border: none;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
  border-radius: 0.5rem;
  overflow: hidden;
}

.dropdown-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color-light);
}

.dropdown-item:last-child {
  border-bottom: none;
}

.dropdown-item:hover {
  background-color: rgba(46, 139, 87, 0.1);
}

/* --- Projects Section Styling --- */
.projects-section {
  background: var(--card-bg-light);
  border-radius: 0.5rem;
  padding: 2rem;
  margin-top: 1rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  border: 1px solid var(--border-color-light);
}

.projects-section .section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.projects-section .section-title h1 {
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.projects-section .section-title p {
  color: var(--text-light);
  font-size: 1.1rem;
}

.project-item {
  background: white;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color-light);
}

.project-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.project-img {
  position: relative;
  overflow: hidden;
  height: 200px;
}

.project-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.project-item:hover .project-img img {
  transform: scale(1.05);
}

.project-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: var(--gradient-primary);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.project-content {
  padding: 1.5rem;
}

.project-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: -50px;
  margin-bottom: 1rem;
  box-shadow: 0 5px 15px rgba(46, 139, 87, 0.3);
}

.project-icon i {
  font-size: 1.5rem;
  color: white;
}

.project-content h4 {
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--dark);
}

.project-content p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}

.project-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color-light);
}

.project-status {
  display: flex;
  align-items: center;
}

.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-completed {
  background-color: var(--success-color);
}

.status-in-progress {
  background-color: var(--warning-color);
}

.status-planned {
  background-color: var(--primary);
}

.project-date {
  color: var(--text-light);
  font-size: 0.9rem;
}

.view-all-container {
  text-align: center;
  margin-top: 2rem;
}

/* Add Project Form Styling */
.add-project-form {
  background: white;
  border-radius: 0.75rem;
  padding: 2rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
  border: 1px solid var(--border-color-light);
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  font-weight: 600;
  margin-bottom: 0.7rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
}

.form-label i {
  margin-right: 8px;
  color: var(--primary);
}

.form-control {
  border-radius: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--border-color-light);
  transition: all 0.3s ease;
  font-size: 1rem;
  background: #fafefa;
  color: var(--text-light);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(46, 139, 87, 0.15);
  background: white;
}

.file-upload-area {
  border: 2px dashed var(--border-color-light);
  border-radius: 16px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  background: #fafefa;
  position: relative;
  overflow: hidden;
}

.file-upload-area:hover {
  border-color: var(--primary);
  background: rgba(46, 139, 87, 0.03);
  transform: translateY(-2px);
}

.file-upload-area.dragover {
  border-color: var(--primary);
  background: rgba(46, 139, 87, 0.08);
  transform: scale(1.02);
}

.upload-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.file-upload-area:hover .upload-icon {
  transform: scale(1.1);
}

.file-input {
  display: none;
}

.image-preview {
  width: 220px;
  height: 120px;
  margin: 20px auto;
  display: none;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  animation: zoomIn 0.4s ease-out;
  background-color: #f8f9fa; /* Optional: Adds a light background */
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* MODIFIED: Ensures full image is visible */
}

.preview-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
}

.preview-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.preview-btn:hover {
  background: rgba(0, 0, 0, 0.8);
  transform: scale(1.1);
}

.btn-brand-primary {
  background: var(--gradient-primary);
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-weight: 600;
  color: white;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: 10px;
  font-size: 1rem;
  box-shadow: 0 4px 12px rgba(46, 139, 87, 0.3);
  position: relative;
  overflow: hidden;
}

.btn-brand-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(46, 139, 87, 0.4);
  color: white;
}

.btn-brand-primary:active {
  transform: translateY(-1px);
}

.btn-brand-primary::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.btn-brand-primary:hover::after {
  left: 100%;
}

.alert {
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
  border: none;
  display: flex;
  align-items: center;
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success-color);
  border-left: 4px solid var(--success-color);
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger-color);
  border-left: 4px solid var(--danger-color);
}

.progress-bar {
  height: 4px;
  background: var(--border-color-light);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
  display: none;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  width: 0%;
  transition: width 0.3s ease;
}

.file-info {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 8px;
  display: none;
}

/* Responsive adjustments */
@media (max-width: 991px) {
  #sidebar {
    left: -280px;
    width: 280px;
    z-index: 1040;
    transition: all 0.3s ease-in-out;
  }

  #sidebar.active {
    left: 0;
    width: 280px;
  }

  #sidebar.collapsed {
    width: 280px;
  }

  #sidebar.collapsed .sidebar-logo-text,
  #sidebar.collapsed .nav-link-text {
    display: block !important;
  }

  /* Close button for sidebar - Show on tablet */
  .sidebar-close-btn {
    display: none;
  }

  #sidebar.active .sidebar-close-btn {
    display: flex;
  }

  /* Main content adjustments */
  #main-content {
    margin-left: 0 !important;
    width: 100%;
    padding: 1rem;
    transition: all 0.3s ease-in-out;
  }

  #main-content.expanded {
    margin-left: 0 !important;
  }

  /* Header adjustments */
  .fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    margin-left: 0;
    border-radius: 0;
    margin-bottom: 1rem;
    z-index: 1030;
    padding: 0.75rem 1rem;
  }

  /* Search bar hidden on tablet */
  .fixed-header .d-md-flex {
    display: none !important;
  }

  /* Overlay for sidebar */
  .sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    display: none;
    transition: all 0.3s ease-in-out;
  }

  #sidebar.active ~ .sidebar-overlay {
    display: block;
  }

  /* Ensure sidebar toggle works */
  #sidebar:not(.active) {
    transform: translateX(-100%);
  }

  #sidebar.active {
    transform: translateX(0);
  }

  /* Projects section adjustments */
  .projects-section {
    padding: 1.5rem;
    margin-top: 80px;
  }
}

@media (max-width: 767px) {
  body {
    padding-top: 0;
  }

  /* Sidebar half width on mobile */
  #sidebar {
    left: -280px;
    width: 280px;
    z-index: 1040;
  }

  #sidebar.active {
    left: 0;
    width: 280px;
  }

  /* Close button for mobile - Show on mobile */
  .sidebar-close-btn {
    display: none;
  }

  #sidebar.active .sidebar-close-btn {
    display: flex;
  }

  /* Main content full width */
  #main-content {
    margin-left: 0 !important;
    width: 100%;
    padding: 0.5rem;
    margin-top: 70px;
  }

  /* Header mobile layout */
  .fixed-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 0.5rem 1rem;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    z-index: 1030;
  }

  .fixed-header > div {
    display: flex;
    align-items: center;
  }

  /* Projects section mobile */
  .projects-section {
    padding: 1rem;
    margin-top: 70px;
  }

  .project-content {
    padding: 1rem;
  }

  .project-icon {
    width: 50px;
    height: 50px;
    margin-top: -40px;
  }

  .project-icon i {
    font-size: 1.25rem;
  }

  .add-project-form {
    padding: 1.5rem;
  }
}

@media (max-width: 575px) {
  /* Sidebar full width on very small screens */
  #sidebar {
    width: 85%;
    left: -85%;
  }

  #sidebar.active {
    width: 85%;
    left: 0;
  }

  #main-content {
    padding: 0.5rem;
  }

  .fixed-header {
    padding: 0.5rem;
  }

  /* Projects section ultra mobile */
  .projects-section {
    padding: 0.75rem;
  }

  .project-content h4 {
    font-size: 1.1rem;
  }

  .project-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .add-project-form {
    padding: 1rem;
  }
}
.alert {
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}
.alert.show {
  opacity: 1;
}
