/* ==========================================
   ADMIN PANEL STYLES
   ========================================== */

/* Admin Login */
.admin-login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f97384 0%, #ff9caa 100%);
  padding: 2rem;
}

.admin-login-card {
  background: white;
  border-radius: 20px;
  padding: 2.5rem;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.admin-login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.admin-login-header .logo-circle {
  margin: 0 auto 1rem;
}

.admin-login-header h1 {
  font-size: 1.5rem;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 0.3rem;
}

.admin-login-header p {
  color: #888;
  font-size: 0.9rem;
}

.admin-error {
  background: #fff0f0;
  color: #e85d6f;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-align: center;
}

.admin-input-group {
  position: relative;
  margin-bottom: 1rem;
}

.admin-input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #f97384;
}

.admin-input-group input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  border: 2px solid #f0f0f0;
  border-radius: 12px;
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.admin-input-group input:focus {
  border-color: #f97384;
}

.admin-login-btn {
  width: 100%;
  padding: 0.9rem;
  background: linear-gradient(135deg, #f97384, #ffa5b2);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(249, 115, 132, 0.3);
}

.admin-login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(249, 115, 132, 0.4);
}

.admin-login-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.admin-login-hint {
  text-align: center;
  color: #aaa;
  font-size: 0.8rem;
  margin-top: 1.5rem;
}

/* Admin Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
  background: #f5f5f7;
}

.admin-sidebar {
  background: #1a1a2e;
  color: white;
  display: flex;
  flex-direction: column;
  transition: width 0.3s;
  flex-shrink: 0;
}

.admin-sidebar.open {
  width: 250px;
}

.admin-sidebar.closed {
  width: 70px;
}

.admin-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: white;
  font-weight: 800;
  font-size: 0.95rem;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  padding: 0.3rem;
}

.sidebar-toggle:hover {
  color: white;
}

.admin-sidebar-nav {
  flex: 1;
  padding: 1rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  border: none;
  background: none;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Nunito', sans-serif;
  border-radius: 10px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: background-color 0.2s, color 0.2s;
}

.admin-nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.admin-nav-item.active {
  background: rgba(249, 115, 132, 0.15);
  color: #f97384;
}

.admin-nav-item.logout {
  color: rgba(255,255,255,0.4);
}

.admin-nav-item.logout:hover {
  color: #ff6b6b;
  background: rgba(255, 107, 107, 0.1);
}

.admin-sidebar-footer {
  padding: 0.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Admin Main */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.admin-topbar {
  background: white;
  padding: 1rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  flex-shrink: 0;
}

.admin-page-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: #1a1a2e;
}

.admin-topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.admin-save-msg {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: #4caf50;
  font-size: 0.85rem;
  font-weight: 700;
  background: #e8f5e9;
  padding: 0.4rem 0.8rem;
  border-radius: 50px;
}

.admin-user {
  font-size: 0.85rem;
  font-weight: 600;
  color: #666;
}

.admin-view-site {
  padding: 0.4rem 1rem;
  border: 2px solid #f97384;
  color: #f97384;
  border-radius: 50px;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  transition: background-color 0.2s, color 0.2s;
}

.admin-view-site:hover {
  background: #f97384;
  color: white;
}

.admin-content {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

/* Dashboard */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: linear-gradient(135deg, #f97384, #ffa5b2);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 900;
  color: #1a1a2e;
}

.stat-label {
  font-size: 0.85rem;
  color: #888;
  font-weight: 600;
}

.admin-recent {
  background: white;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.admin-recent h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 1rem;
  color: #1a1a2e;
}

/* Tables */
.admin-action-bar {
  margin-bottom: 1.5rem;
  display: flex;
  gap: 0.5rem;
}

.admin-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, #f97384, #ffa5b2);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: transform 0.2s;
}

.admin-btn-primary:hover {
  transform: translateY(-1px);
}

.admin-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.2rem;
  background: #f0f0f0;
  color: #666;
  border: none;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
}

.admin-table-wrapper {
  background: white;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th {
  background: #fafafa;
  padding: 0.8rem 1rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 700;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #f0f0f0;
}

.admin-table td {
  padding: 0.8rem 1rem;
  font-size: 0.9rem;
  border-bottom: 1px solid #f5f5f5;
  color: #333;
}

.admin-table tr:hover {
  background: #fafafa;
}

.admin-tag {
  display: inline-block;
  background: rgba(249, 115, 132, 0.1);
  color: #f97384;
  padding: 0.15rem 0.6rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}

.admin-actions {
  display: flex;
  gap: 0.3rem;
}

.admin-btn-sm {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.1s;
}

.admin-btn-sm:hover {
  transform: scale(1.1);
}

.admin-btn-edit {
  background: #e3f2fd;
  color: #1976d2;
}

.admin-btn-delete {
  background: #fce4ec;
  color: #e53935;
}

.admin-btn-save {
  background: #e8f5e9;
  color: #4caf50;
}

.admin-btn-cancel {
  background: #f5f5f5;
  color: #666;
}

.admin-inline-input {
  padding: 0.4rem 0.6rem;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.85rem;
  font-family: 'Nunito', sans-serif;
  outline: none;
  width: 100%;
}

.admin-inline-input:focus {
  border-color: #f97384;
}

/* Admin Forms */
.admin-form-card {
  background: white;
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  margin-bottom: 1.5rem;
}

.admin-form-card h3 {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 1.5rem;
  color: #1a1a2e;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.admin-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.admin-field.full {
  grid-column: span 2;
}

.admin-field label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.admin-field input,
.admin-field textarea,
.admin-field select {
  padding: 0.7rem 1rem;
  border: 2px solid #f0f0f0;
  border-radius: 10px;
  font-size: 0.9rem;
  font-family: 'Nunito', sans-serif;
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
  box-sizing: border-box;
}

.admin-field input:focus,
.admin-field textarea:focus,
.admin-field select:focus {
  border-color: #f97384;
}

.admin-checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  flex-direction: row;
}

.admin-checkbox input[type="checkbox"] {
  width: auto;
  accent-color: #f97384;
}

.admin-form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* Loading */
.admin-loading {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: #888;
}

/* Image Upload */
.image-upload-area {
  border: 2px dashed #e0e0e0;
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  background: #fafafa;
}

.image-preview {
  max-width: 300px;
  max-height: 180px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.image-upload-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.admin-btn-upload {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: white;
  border: 2px solid #f97384;
  color: #f97384;
  border-radius: 10px;
  font-size: 0.85rem;
  font-weight: 700;
  font-family: 'Nunito', sans-serif;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s;
}

.admin-btn-upload:hover {
  background: #f97384;
  color: white;
}

.admin-btn-upload:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.image-url-text {
  font-size: 0.75rem;
  color: #888;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-img-cell {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.table-thumb {
  width: 50px;
  height: 35px;
  border-radius: 6px;
  object-fit: cover;
}

.stat-cards {
  grid-template-columns: repeat(4, 1fr);
}

/* Responsive Admin */
@media (max-width: 768px) {
  .admin-sidebar.open {
    width: 200px;
  }
  
  .stat-cards {
    grid-template-columns: 1fr;
  }
  
  .admin-form-grid {
    grid-template-columns: 1fr;
  }
  
  .admin-field.full {
    grid-column: span 1;
  }
  
  .admin-topbar {
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
  }
  
  .admin-content {
    padding: 1rem;
  }
}
