/* Main Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  margin: 0;
  padding: 0;
  background-color: #f5f7fa;
}

/* Header */
header {
  background-color: #0073aa;
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.actions {
  display: flex;
  gap: 10px;
}

/* Enhanced Dashboard */
.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.quick-action-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid #e1e8ed;
}

.quick-action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

.quick-action-card h3 {
  margin: 0 0 8px 0;
  font-size: 1.1rem;
  color: #1d2129;
  font-weight: 600;
}

.quick-action-card p {
  margin: 0 0 16px 0;
  color: #65676b;
  font-size: 0.9rem;
  line-height: 1.4;
}

.dashboard-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.stat-card {
  text-align: center;
  padding: 16px;
  background: #f8f9fa;
  border-radius: 8px;
  border: 1px solid #e9ecef;
}

.stat-number {
  display: block;
  font-size: 2rem;
  font-weight: 700;
  color: #0073aa;
  margin-bottom: 4px;
}

.stat-label {
  display: block;
  font-size: 0.85rem;
  color: #6c757d;
  font-weight: 500;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.status-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.status-label {
  font-weight: 500;
  color: #495057;
  font-size: 0.9rem;
}

.status-value {
  font-weight: 600;
  color: #0073aa;
  font-size: 0.9rem;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #e9ecef;
}

.recent-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
  max-height: 200px;
  overflow-y: auto;
}

.recent-list li {
  padding: 8px 12px;
  margin: 4px 0;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
  font-size: 0.9rem;
}

.pending-stats {
  text-align: center;
  margin-bottom: 16px;
  padding: 16px;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 8px;
}

/* Dashboard Cards */
.status-card {
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid #e1e8ed;
}

.status-card h3 {
  margin-top: 0;
  color: #1d2129;
  font-size: 1.2rem;
  margin-bottom: 20px;
  font-weight: 600;
}

/* Buttons */
.btn {
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn-sm {
  padding: 5px 10px;
  font-size: 0.9em;
}

.btn-primary {
  background-color: #0073aa;
  color: white;
}

.btn-success {
  background-color: #28a745;
  color: white;
}

.btn-info {
  background-color: #17a2b8;
  color: white;
}

.btn-warning {
  background-color: #ffc107;
  color: #212529;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  flex-wrap: wrap;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 20px;
  padding: 0 20px;
}

.nav-tabs button {
  padding: 10px 15px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-right: 5px;
  cursor: pointer;
  font-weight: 500;
  color: #495057;
}

.nav-tabs button:hover {
  color: #0073aa;
}

.nav-tabs button.active {
  color: #0073aa;
  border-bottom-color: #0073aa;
}

/* Tab Content */
.tab-content {
  display: none;
  padding: 20px;
}

.tab-content.active {
  display: block;
}

/* Inner Tabs */
.inner-tabs {
  display: flex;
  border-bottom: 1px solid #dee2e6;
  margin-bottom: 20px;
}

.inner-tab {
  padding: 8px 12px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: 500;
  color: #495057;
}

.inner-tab:hover {
  color: #0073aa;
}

.inner-tab.active {
  color: #0073aa;
  border-bottom-color: #0073aa;
}

.inner-tab-content {
  display: none;
}

.inner-tab-content.active {
  display: block;
}

/* Grid Container */
.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

/* Album and Post Cards */
.album-card, .post-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: all 0.3s ease;
}

.album-card:hover, .post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.album-thumbnail, .post-thumbnail {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.album-details, .post-details {
  padding: 15px;
}

.album-title, .post-title {
  margin: 0 0 10px 0;
  font-size: 1rem;
  font-weight: 600;
}

.album-date, .post-date {
  color: #777;
  font-size: 0.85rem;
  margin-bottom: 8px;
}

.album-id, .post-id {
  color: #aaa;
  font-size: 0.8rem;
  margin-bottom: 12px;
}

.album-actions, .post-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
}

/* Form Elements */
input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  margin-bottom: 15px;
}

.form-group {
  margin-bottom: 15px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 20px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 20px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: #0073aa;
}

input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

/* Loading State */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

.loading-spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #0073aa;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

.toast {
  background-color: #333;
  color: white;
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  animation: fadeInRight 0.3s ease;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 250px;
  max-width: 350px;
}

.toast-success {
  background-color: #28a745;
}

.toast-error {
  background-color: #dc3545;
}

.toast-info {
  background-color: #0073aa;
}

.toast-warning {
  background-color: #ffc107;
  color: #212529;
}

.toast-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.7;
}

.toast-close:hover {
  opacity: 1;
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 40px;
  color: #777;
}

/* Search Box */
.search-box {
  margin-bottom: 20px;
}

.search-box input {
  padding: 10px 15px;
  border-radius: 20px;
  border: 1px solid #ddd;
  width: 100%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

/* Filter Controls */
.filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.filter-controls button {
  background-color: #f1f1f1;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.filter-controls button.active {
  background-color: #0073aa;
  color: white;
}

/* Status Badges */
.orphaned-badge, .excluded-badge, .pin-protected-badge {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 0.8rem;
  margin-left: 5px;
}

.orphaned-badge {
  background-color: #dc3545;
  color: white;
}

.excluded-badge {
  background-color: #ffc107;
  color: #212529;
}

.pin-protected-badge {
  background-color: #17a2b8;
  color: white;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: white;
  margin: 10% auto;
  padding: 20px;
  border-radius: 8px;
  max-width: 600px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
  position: relative;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  margin-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.modal-title {
  margin: 0;
  font-size: 1.2rem;
}

.close-modal {
  cursor: pointer;
  font-size: 1.5rem;
  color: #777;
}

.close-modal:hover {
  color: #333;
}

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

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Embed Code Viewer */
.embed-code-container {
  margin-top: 15px;
}

.embed-code-container textarea {
  width: 100%;
  padding: 10px;
  background-color: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
}

/* Status Section */
.status-section {
  margin-bottom: 20px;
}

.status-section h3 {
  margin-top: 0;
  font-size: 1.1rem;
}

/* Log Viewer Styles */
#log-viewer-container {
  background-color: #1a1a1a;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  margin-bottom: 20px;
}

.log-header {
  background-color: #2a2a2a;
  padding: 12px 15px;
  border-bottom: 1px solid #3a3a3a;
}

.log-viewer {
  height: 400px;
  overflow-y: auto;
  background-color: #1a1a1a;
  color: #f0f0f0;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  padding: 10px 15px;
  line-height: 1.5;
  white-space: pre-wrap;
  scroll-behavior: smooth;
}

.log-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.log-control-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.log-filter-group,
.log-scroll-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.log-divider {
  width: 1px;
  height: 24px;
  background-color: #444;
  margin: 0 5px;
}

.log-controls button {
  background-color: #3a3a3a;
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.log-controls button:hover {
  background-color: #4a4a4a;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.log-controls .btn-primary {
  background-color: #0073aa;
}

.log-controls .btn-primary:hover {
  background-color: #0088cc;
}

.log-controls .btn-secondary {
  background-color: #555;
}

.log-icon {
  font-style: normal;
  font-size: 1.1em;
}

.log-controls select {
  background-color: #3a3a3a;
  color: #fff;
  border: none;
  padding: 7px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9em;
  margin: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-select-sm {
  padding: 5px 8px !important;
  font-size: 0.85em !important;
}

.switch-label {
  display: flex;
  align-items: center;
  color: #ccc;
  font-size: 0.9em;
  gap: 6px;
  cursor: pointer;
  user-select: none;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.switch-label:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.log-controls input[type="checkbox"] {
  margin: 0;
  width: auto;
  accent-color: #0073aa;
}

.auto-refresh-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: rgba(0, 115, 170, 0.1);
  padding: 4px 8px;
  border-radius: 4px;
}

.log-entry {
  padding: 6px 0;
  border-bottom: 1px solid #333;
  display: flex;
  transition: background-color 0.3s ease;
}

.log-entry:hover {
  background-color: rgba(255, 255, 255, 0.03);
}

/* Animation for new log entries */
.log-entry-new {
  animation: highlightNew 2s ease;
}

@keyframes highlightNew {
  0% { background-color: rgba(0, 115, 170, 0.2); }
  100% { background-color: transparent; }
}

.log-timestamp {
  color: #888;
  margin-right: 10px;
  flex: 0 0 160px;
  font-size: 0.9em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.log-level {
  display: inline-block;
  padding: 2px 6px;
  border-radius: 3px;
  margin-right: 10px;
  font-weight: bold;
  flex: 0 0 50px;
  text-align: center;
  font-size: 0.85em;
}

.log-level-INFO {
  background-color: #2980b9;
  color: white;
}

.log-level-WARN {
  background-color: #f39c12;
  color: white;
}

.log-level-ERROR {
  background-color: #e74c3c;
  color: white;
}

.log-message {
  color: #ddd;
  flex: 1;
  font-family: 'Courier New', monospace;
  word-break: break-word;
}

.log-loading {
  text-align: center;
  padding: 40px 20px;
  color: #888;
  font-style: italic;
}

.log-status {
  background-color: #2a2a2a;
  padding: 8px 15px;
  color: #aaa;
  font-size: 0.85em;
  border-top: 1px solid #3a3a3a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.log-status-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.log-status-label {
  color: #888;
}

.log-status-value {
  font-weight: bold;
  color: #fff;
}

.log-status-timestamp {
  color: #888;
  font-style: italic;
}

/* Animation for count changes */
.log-count-increase {
  color: #28a745;
  animation: pulseGreen 1s ease;
}

.log-count-decrease {
  color: #dc3545;
  animation: pulseRed 1s ease;
}

@keyframes pulseGreen {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

@keyframes pulseRed {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Form select */
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='6' viewBox='0 0 8 6'%3E%3Cpath fill='%23fff' d='M4 6L0 0h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 25px;
}

/* Dark mode scrollbar for log viewer */
.log-viewer::-webkit-scrollbar {
  width: 8px;
}

.log-viewer::-webkit-scrollbar-track {
  background: #2a2a2a;
  border-radius: 4px;
}

.log-viewer::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.log-viewer::-webkit-scrollbar-thumb:hover {
  background: #666;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
  
  .log-controls {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .log-control-group {
    width: 100%;
  }
  
  .tab-content {
    padding: 15px 10px;
  }
}