/* Admin Panel Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-tasova: #f9f137;
  --color-primary: #667eea;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
}

body {
  font-family: "Roboto", sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

/* Firebase Status Styles */
.firebase-status {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 6px;
  font-weight: 500;
  margin-right: 15px;
}

.firebase-status.active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.firebase-status.local {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

/* Migration Banner Styles */
.migration-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.migration-content h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.migration-content p {
  margin-bottom: 15px;
  opacity: 0.9;
}

.migration-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-migrate {
  background: var(--color-tasova);
  color: #000;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-migrate:hover {
  background: #e6d82f;
  transform: translateY(-2px);
}

.btn-dismiss {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-dismiss:hover {
  background: rgba(255, 255, 255, 0.3);
}

.migration-loading {
  text-align: center;
  padding: 20px;
  font-size: 1.1rem;
}

.migration-success {
  background: var(--color-success);
  color: white;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
}

.migration-error {
  background: var(--color-error);
  color: white;
  padding: 15px;
  border-radius: 8px;
  text-align: center;
}

/* Login Styles */
.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
}

.login-card {
  background: white;
  border-radius: 15px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  text-align: center;
}

.login-header .admin-logo-large {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #2c3e50;
  border-radius: 50%;
  font-weight: 900;
  font-size: 2.5rem;
  font-family: "Montserrat", sans-serif;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.3);
  border: 3px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.login-header .admin-logo-large:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 24px rgba(255, 215, 0, 0.4);
}

.login-header h1 {
  color: #333;
  margin-bottom: 10px;
  font-size: 1.8rem;
  font-weight: 700;
}

.login-header p {
  color: #666;
  margin-bottom: 30px;
  font-size: 1rem;
}

.login-form .form-group {
  margin-bottom: 20px;
  text-align: left;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

.login-form input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 16px;
  transition: all 0.3s ease;
}

.login-form input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-btn {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.login-btn:hover {
  transform: translateY(-2px);
}

.error-message {
  color: #e74c3c;
  background: #fdf2f2;
  padding: 10px;
  border-radius: 5px;
  margin-top: 15px;
  font-size: 14px;
}

.login-footer {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e1e5e9;
}

.login-footer p {
  color: #999;
  font-size: 12px;
}

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

/* Sidebar */
.admin-sidebar {
  width: 280px;
  background: #2c3e50;
  color: white;
  flex-shrink: 0;
  overflow-y: auto;
}

.sidebar-header {
  padding: 25px 20px;
  border-bottom: 1px solid #34495e;
  text-align: center;
}

.admin-logo-sidebar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #ffd700, #ffed4e);
  color: #2c3e50;
  border-radius: 50%;
  font-weight: 900;
  font-size: 1.8rem;
  font-family: "Montserrat", sans-serif;
  margin-bottom: 15px;
  box-shadow: 0 3px 12px rgba(255, 215, 0, 0.3);
  border: 2px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.admin-logo-sidebar:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.4);
}

.sidebar-header h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #ecf0f1;
}

.sidebar-menu {
  list-style: none;
  padding: 20px 0;
}

.sidebar-menu li {
  margin-bottom: 5px;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 15px 25px;
  color: #bdc3c7;
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.menu-item:hover,
.menu-item.active {
  background: #34495e;
  color: #f39c12;
  border-left-color: #f39c12;
}

.menu-item .icon {
  font-size: 1.2rem;
  margin-right: 12px;
  width: 20px;
}

.sidebar-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px;
  border-top: 1px solid #34495e;
}

.logout-btn {
  padding: 10px 20px;
  background: #e74c3c;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
  font-size: 14px;
  white-space: nowrap;
}

.logout-btn:hover {
  background: #c0392b;
}

.logout-btn .icon {
  margin-right: 8px;
}

/* Main Content */
.admin-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-header {
  background: white;
  padding: 25px 35px;
  border-bottom: 1px solid #e1e5e9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  min-height: 80px;
}

.admin-header h1 {
  color: #2c3e50;
  font-size: 1.8rem;
  font-weight: 600;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 25px;
}

.user-info {
  color: #666;
  font-size: 14px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
}

.preview-btn {
  padding: 12px 24px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background 0.3s ease;
}

.preview-btn:hover {
  background: #2980b9;
}

/* Admin Sections */
.admin-section {
  padding: 30px;
  flex: 1;
  overflow-y: auto;
  display: none;
}

.admin-section.active {
  display: block;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.section-header h2 {
  color: #2c3e50;
  font-size: 1.6rem;
  font-weight: 600;
}

.add-btn {
  padding: 12px 24px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.add-btn:hover {
  background: #229954;
  transform: translateY(-2px);
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 25px;
  margin-bottom: 40px;
}

.stat-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.stat-header h3 {
  color: #2c3e50;
  font-size: 1rem;
  font-weight: 600;
}

.stat-header .icon {
  font-size: 1.5rem;
  opacity: 0.7;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: #3498db;
  margin-bottom: 5px;
}

.stat-label {
  color: #666;
  font-size: 0.9rem;
}

.recent-activity {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.recent-activity h3 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.activity-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.activity-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f8f9fa;
}

.activity-time {
  color: #666;
  font-size: 0.85rem;
  min-width: 120px;
}

.activity-text {
  color: #2c3e50;
  flex: 1;
}

/* Grids */
.gallery-grid,
.staff-grid,
.references-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 25px;
}

.grid-item {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.grid-item:hover {
  transform: translateY(-5px);
}

.grid-item img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.grid-item-content {
  padding: 20px;
}

.grid-item h3 {
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.grid-item p {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 15px;
}

.grid-item-actions {
  display: flex;
  gap: 10px;
}

.edit-btn,
.delete-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.edit-btn {
  background: #f39c12;
  color: white;
}

.edit-btn:hover {
  background: #d68910;
}

.delete-btn {
  background: #e74c3c;
  color: white;
}

.delete-btn:hover {
  background: #c0392b;
}

/* Settings */
.settings-container {
  max-width: 600px;
}

.settings-group {
  background: white;
  padding: 25px;
  border-radius: 12px;
  margin-bottom: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.settings-group h3 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.setting-item {
  margin-bottom: 20px;
}

.setting-item label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

.setting-item input,
.setting-item textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.setting-item input:focus,
.setting-item textarea:focus {
  outline: none;
  border-color: #3498db;
}

.save-btn {
  padding: 15px 30px;
  background: #27ae60;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  font-size: 16px;
  transition: all 0.3s ease;
}

.save-btn:hover {
  background: #229954;
  transform: translateY(-2px);
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  display: none;
}

.modal.active {
  display: block;
}

.modal-header {
  padding: 25px 30px 20px;
  border-bottom: 1px solid #e1e5e9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  color: #2c3e50;
  font-size: 1.4rem;
  font-weight: 600;
}

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  color: #e74c3c;
}

.modal-body {
  padding: 25px 30px 30px;
}

.modal-body .form-group {
  margin-bottom: 20px;
}

.modal-body label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #555;
}

.modal-body input,
.modal-body textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.modal-body input:focus,
.modal-body textarea:focus {
  outline: none;
  border-color: #3498db;
}

.modal-body textarea {
  resize: vertical;
  min-height: 100px;
}

.image-preview {
  margin-top: 15px;
  text-align: center;
}

.image-preview img {
  max-width: 200px;
  max-height: 200px;
  border-radius: 8px;
  border: 2px solid #e1e5e9;
}

.modal-actions {
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e1e5e9;
}

.cancel-btn,
.submit-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.cancel-btn {
  background: #95a5a6;
  color: white;
}

.cancel-btn:hover {
  background: #7f8c8d;
}

.submit-btn {
  background: #3498db;
  color: white;
}

.submit-btn:hover {
  background: #2980b9;
}

/* Responsive Design */
@media (max-width: 768px) {
  .admin-layout {
    flex-direction: column;
  }

  .admin-sidebar {
    width: 100%;
    height: auto;
    position: relative;
  }

  .sidebar-footer {
    position: relative;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .gallery-grid,
  .staff-grid,
  .references-grid {
    grid-template-columns: 1fr;
  }

  .admin-header {
    flex-direction: column;
    gap: 20px;
    text-align: center;
    padding: 20px 25px;
  }

  .section-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .admin-section {
    padding: 20px 15px;
  }

  .modal {
    width: 95%;
    margin: 0 10px;
  }

  .modal-header,
  .modal-body {
    padding: 20px;
  }
}
