/* === RESET BASE === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #0a0a0a;
  color: #e4e4e4;
  line-height: 1.6;
  padding: 30px 20px;
}

/* === TITOLI === */
h1, h2, h3 {
  margin-bottom: 20px;
  font-weight: 600;
  text-align: center;
  color: #b6ff1c;
}

/* === FORM === */
.form-box {
  max-width: 600px;
  margin: 20px auto;
  background: #1e1e1e;
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}
input, textarea, select {
  width: 100%;
  padding: 12px;
  margin: 8px 0 16px;
  border: 1px solid #555;
  border-radius: 6px;
  background: #2c2c2c;
  color: #f9f9f9;
  font-size: 1rem;
}
input:focus, textarea:focus, select:focus {
  border-color: #b6ff1c;
  outline: none;
}

/* === BUTTONS === */
button, .done-btn {
  display: inline-block;
  background-color: #b6ff1c;
  color: #000;
  padding: 10px 18px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
  text-decoration: none;
}
button:hover, .done-btn:hover {
  background-color: #a1e619;
}

/* === SIDEBAR === */
.sidebar {
  background-color: #000;
  width: 220px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  color: #ccc;
  padding: 20px 0;
  z-index: 1000;
}
.sidebar-title {
  color: #b6ff1c;
  font-size: 1.5rem;
  text-align: center;
  margin-bottom: 30px;
}
.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}
.sidebar-menu li {
  margin-bottom: 14px;
}
.sidebar-menu a {
  display: flex;
  align-items: center;
  color: #ddd;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
}
.sidebar-menu a:hover {
  background-color: #b6ff1c;
  color: black;
}
.sidebar-menu a.active {
  background-color: #b6ff1c;
  color: black;
}
.sidebar-menu img {
  filter: brightness(0) invert(1);
  margin-right: 10px;
}
.sidebar-toggle {
  display: none;
}

/* === TABLE === */
.task-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: #111;
  color: #b6ff1c;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.task-table th, .task-table td {
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid #333;
}
.task-table th {
  background: #000;
  font-weight: 600;
}
.task-table tbody tr:hover {
  background-color: #1a1a1a;
}

/* === TABLE ACTIONS === */
.task-actions a,
.task-actions button {
  padding: 6px 10px;
  font-size: 0.85rem;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s ease-in-out;
}
.edit-btn {
  background-color: #ffd60a;
  color: #000;
}
.edit-btn:hover {
  background-color: #fcbf02;
  transform: scale(1.05);
}
.delete-album-btn {
  background-color: #ff4d4f;
  color: white;
}
.delete-album-btn:hover {
  background-color: #d9363e;
  transform: scale(1.05);
}

/* === TOGGLE SWITCH === */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 28px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider-shadow {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #444;
  border-radius: 28px;
  transition: background-color 0.3s ease;
}
.slider-shadow::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}
.toggle-switch input:checked + .slider-shadow {
  background-color: #3bc84d;
}
.toggle-switch input:checked + .slider-shadow::before {
  transform: translateX(24px);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .sidebar.active {
    transform: translateX(0);
  }
  .sidebar-toggle {
    display: block;
    position: fixed;
    top: 15px;
    left: 15px;
    background-color: #000;
    color: #b6ff1c;
    border: none;
    font-size: 1.5rem;
    padding: 6px 10px;
    border-radius: 4px;
    z-index: 1100;
  }
  .main-content {
    margin-left: 0;
  }
}

/* === MAIN CONTENT === */
.main-content {
  margin-left: 240px;
  padding: 30px 20px;
}

/* === DARK MODE === */
.dark-mode {
  background-color: #121212;
  color: #b6ff1c;
}

/* === HOMEPAGE ALBUM FRONTEND === */
.albums {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 30px;
  margin: 40px auto;
  padding: 0 20px;
  max-width: 1200px;
}
.album {
  background-color: #111;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  color: #b6ff1c;
  box-shadow: 0 4px 15px rgba(182, 255, 28, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.album:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(182, 255, 28, 0.3);
}
.album img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
  border: 1px solid #444;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}
.album:hover img {
  transform: scale(1.03);
}
.album h3 {
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: #fff;
}
.album p {
  font-size: 0.85rem;
  color: #ccc;
  margin: 4px 0;
}
.album a {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  background: #b6ff1c;
  color: #000;
  border-radius: 5px;
  font-weight: bold;
  text-decoration: none;
  transition: background 0.3s ease;
}
.album a:hover {
  background: #a3eb1b;
}

/* === MIGLIORAMENTO CSS STATISTICHE === */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  padding: 30px 20px;
}

/* Box Statistiche */
.stat-box {
  background: linear-gradient(145deg, #0f0f0f, #1b1b1b);
  border: 1px solid #333;
  border-radius: 12px;
  padding: 25px;
  color: #b6ff1c;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}
.stat-box:hover {
  transform: translateY(-4px);
}
.stat-number {
  font-size: 2.3rem;
  font-weight: bold;
  margin: 15px 0;
}
.stat-change {
  font-size: 0.85rem;
  color: #999;
}

/* Card standard */
.card {
  background: #1c1c1c;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  color: #eee;
}
.card h3 {
  margin-bottom: 16px;
  color: #b6ff1c;
  font-size: 1.2rem;
}

/* Tabella mini */
.mini-table {
  width: 100%;
  border-collapse: collapse;
}
.mini-table th, .mini-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid #444;
  font-size: 0.95rem;
}
.mini-table th {
  color: #b6ff1c;
  background-color: #111;
}
.mini-table tr:hover {
  background-color: #222;
}

/* Chart container */
.chart-card canvas {
  width: 100% !important;
  max-height: 300px;
}

.tabs {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
  gap: 15px;
}
.tab-btn {
  padding: 10px 16px;
  border: none;
  background: #444;
  color: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.3s ease;
}
.tab-btn.active {
  background: #b6ff1c;
  color: #000;
}
.tab-content {
  display: none;
}
.tab-content.active {
  display: block;
}

/* Bottone edit personalizzato */
.edit-ui-btn {
  --green: #1BFD9C;
  font-size: 14px;
  padding: 0.6em 1.8em;
  letter-spacing: 0.06em;
  position: relative;
  font-family: inherit;
  border-radius: 0.6em;
  overflow: hidden;
  transition: all 0.3s;
  line-height: 1.4em;
  border: 2px solid var(--green);
  background: linear-gradient(to right, rgba(27, 253, 156, 0.1) 1%, transparent 40%, transparent 60%, rgba(27, 253, 156, 0.1) 100%);
  color: var(--green);
  box-shadow: inset 0 0 10px rgba(27, 253, 156, 0.4), 0 0 9px 3px rgba(27, 253, 156, 0.1);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.edit-ui-btn:hover {
  color: #82ffc9;
  box-shadow: inset 0 0 10px rgba(27, 253, 156, 0.6), 0 0 9px 3px rgba(27, 253, 156, 0.2);
}

.edit-ui-btn::before {
  content: "";
  position: absolute;
  left: -4em;
  width: 4em;
  height: 100%;
  top: 0;
  transition: transform 0.4s ease-in-out;
  background: linear-gradient(to right, transparent 1%, rgba(27, 253, 156, 0.1) 40%, rgba(27, 253, 156, 0.1) 60%, transparent 100%);
}

.edit-ui-btn:hover::before {
  transform: translateX(15em);
}


/* PAGINATION */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 30px 0;
}

.page-btn {
  background-color: #1a1a1a;
  color: #b6ff1c;
  border: 1px solid #444;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  min-width: 40px;
  text-align: center;
}

.page-btn:hover {
  background-color: #b6ff1c;
  color: #000;
  border-color: #b6ff1c;
  transform: translateY(-2px);
}

.page-btn.active {
  background-color: #b6ff1c;
  color: #000;
  font-weight: bold;
  box-shadow: 0 0 8px rgba(182, 255, 28, 0.4);
}

.page-btn.disabled {
  background-color: #2c2c2c;
  color: #888;
  cursor: not-allowed;
  border-color: #444;
}