/* 
  Blessing Today Resources - Admin Panel Stylesheet (admin.css)
*/

:root {
  /* Colors */
  --primary-orange: #d65005;
  --primary-orange-hover: #b84302;
  --dark-bg: #1a1b1b;
  --black-bar: #0c0d0d;
  --light-gray-bg: #f7fafc;
  --white-bg: #ffffff;
  --text-dark: #2d3748;
  --text-muted: #718096;
  --border-color: #e2e8f0;
  
  --danger-red: #e53e3e;
  --danger-hover: #c53030;
  --success-green: #38a169;
  --success-hover: #2f855a;
  --info-blue: #3182ce;
  
  /* Fonts */
  --font-headers: 'Raleway', sans-serif;
  --font-body: 'Open Sans', sans-serif;
  --font-details: 'Lato', sans-serif;
  
  /* Transitions */
  --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
  --shadow-heavy: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Reset & Basics */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--text-dark);
  background-color: #edf2f7;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-headers);
  font-weight: 700;
}

.hidden {
  display: none !important;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-headers);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--primary-orange);
  color: var(--white-bg);
}

.btn-primary:hover {
  background-color: var(--primary-orange-hover);
}

.btn-outline-dark {
  border-color: #4a5568;
  color: #4a5568;
  background: transparent;
}

.btn-outline-dark:hover {
  background-color: #4a5568;
  color: var(--white-bg);
}

.btn-outline-light {
  border-color: var(--border-color);
  color: #edf2f7;
  background: transparent;
}

.btn-outline-light:hover {
  background-color: var(--white-bg);
  color: var(--dark-bg);
}

.btn-outline-danger {
  border-color: var(--danger-red);
  color: var(--danger-red);
  background: transparent;
}

.btn-outline-danger:hover {
  background-color: var(--danger-red);
  color: var(--white-bg);
}

.btn-danger {
  background-color: var(--danger-red);
  color: var(--white-bg);
}

.btn-danger:hover {
  background-color: var(--danger-hover);
}

.btn-success {
  background-color: var(--success-green);
  color: var(--white-bg);
}

.btn-success:hover {
  background-color: var(--success-hover);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.7rem;
}

/* 1. Login Wrapper */
.login-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), url('https://storage1.snappages.site/6F75G7/assets/images/22604559_4688x1172_2500.png');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-card {
  background-color: var(--white-bg);
  border-radius: 8px;
  box-shadow: var(--shadow-heavy);
  width: 100%;
  max-width: 440px;
  padding: 40px 30px;
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo {
  height: 40px;
  margin-bottom: 15px;
}

.login-header h1 {
  font-size: 1.4rem;
  letter-spacing: 1px;
  color: var(--dark-bg);
  margin-bottom: 10px;
}

.login-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.input-wrapper {
  position: relative;
}

.input-wrapper i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.input-wrapper input {
  width: 100%;
  padding: 10px 12px 10px 35px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-smooth);
}

.input-wrapper input:focus {
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(214, 80, 5, 0.15);
}

.alert {
  padding: 12px 15px;
  border-radius: 4px;
  font-size: 0.82rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.alert-danger {
  background-color: #fff5f5;
  border: 1px solid #fed7d7;
  color: #c53030;
}

/* 2. Admin Workspace Layout */
.dashboard-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.admin-header {
  background-color: var(--dark-bg);
  color: var(--white-bg);
  padding: 15px 30px;
  box-shadow: var(--shadow-soft);
  z-index: 10;
}

.admin-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 15px;
}

.brand-logo {
  height: 32px;
}

.brand-title h2 {
  font-size: 1.1rem;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.brand-title span {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.admin-header-actions {
  display: flex;
  gap: 12px;
}

.main-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  flex-grow: 1;
  overflow: hidden;
}

/* Sidebar Tab navigation */
.sidebar-tabs {
  background-color: #2d3748;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 0;
}

.tabs-list {
  display: flex;
  flex-direction: column;
}

.tab-link {
  background: none;
  border: none;
  color: #a0aec0;
  padding: 16px 25px;
  font-family: var(--font-headers);
  font-weight: 700;
  font-size: 0.85rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid transparent;
  transition: var(--transition-smooth);
}

.tab-link:hover {
  color: #fff;
  background-color: #1a202c;
}

.tab-link.active {
  color: #fff;
  background-color: #1a202c;
  border-left-color: var(--primary-orange);
}

.tab-link i {
  font-size: 1.1rem;
  width: 18px;
}

.sidebar-info {
  padding: 0 25px;
  font-size: 0.75rem;
  color: #718096;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-info p {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Content Panel */
.content-pane {
  background-color: #f7fafc;
  padding: 40px;
  overflow-y: auto;
  position: relative;
}

.tab-pane {
  display: none;
}

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

.pane-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}

.pane-header h3 {
  font-size: 1.4rem;
  color: var(--dark-bg);
  margin-bottom: 4px;
}

.pane-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Toast Status Banner */
.toast-banner {
  background-color: var(--success-green);
  color: var(--white-bg);
  padding: 15px 20px;
  border-radius: 4px;
  margin-bottom: 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-soft);
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from { transform: translateY(-20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

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

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

/* 3. Catalog Table styling */
.table-container {
  background-color: var(--white-bg);
  border-radius: 8px;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.books-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.books-table th, .books-table td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
}

.books-table th {
  background-color: #edf2f7;
  font-family: var(--font-headers);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  color: #4a5568;
}

.books-table tr:last-child td {
  border-bottom: none;
}

.books-table tr:hover td {
  background-color: #fcfcfc;
}

.row-cover {
  width: 45px;
  height: 60px;
  object-fit: contain;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  display: block;
}

.row-title-info {
  display: flex;
  flex-direction: column;
}

.row-title {
  font-weight: 700;
  color: var(--dark-bg);
}

.row-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.badge {
  display: inline-block;
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 4px;
}

.badge-category {
  background-color: #ebf8ff;
  color: #2b6cb0;
}

.badge-language {
  background-color: #f7fafc;
  border: 1px solid var(--border-color);
  color: #4a5568;
}

.badge-language.ml {
  background-color: #fffaf0;
  color: #dd6b20;
  border-color: #fbd38d;
}

.row-actions-group {
  display: flex;
  gap: 8px;
}

/* Form Styles */
.admin-form {
  background-color: var(--white-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 30px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-section h4 {
  font-size: 0.95rem;
  color: var(--primary-orange);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px dashed var(--border-color);
  padding-bottom: 8px;
  margin-bottom: 5px;
}

.form-row {
  display: flex;
  gap: 20px;
}

.col-12 { width: 100%; }
.col-6 { width: 50%; }
.col-4 { width: 33.33%; }

.admin-form label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #4a5568;
  margin-bottom: 6px;
}

.admin-form input, .admin-form select, .admin-form textarea {
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  outline: none;
  transition: var(--transition-smooth);
}

.admin-form input:focus, .admin-form select:focus, .admin-form textarea:focus {
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(214, 80, 5, 0.15);
}

.form-actions-bar {
  border-top: 1px solid var(--border-color);
  padding-top: 25px;
  display: flex;
  justify-content: flex-end;
}

/* Modal form overlay styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-smooth);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: var(--white-bg);
  border-radius: 8px;
  box-shadow: var(--shadow-heavy);
  width: 100%;
  max-width: 600px;
  overflow: hidden;
  transform: scale(0.9);
  transition: var(--transition-smooth);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.modal-overlay.active .modal-content {
  transform: scale(1);
}

.modal-header {
  padding: 20px 25px;
  border-bottom: 1px solid var(--border-color);
  background-color: #edf2f7;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.15rem;
  color: var(--dark-bg);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.8rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.modal-close-btn:hover {
  color: var(--danger-red);
}

.modal-body-form {
  padding: 25px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

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

.modal-body-form label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #4a5568;
}

.modal-body-form input, .modal-body-form select, .modal-body-form textarea {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.88rem;
  outline: none;
  transition: var(--transition-smooth);
}

.modal-body-form input:focus, .modal-body-form select:focus, .modal-body-form textarea:focus {
  border-color: var(--primary-orange);
  box-shadow: 0 0 0 3px rgba(214, 80, 5, 0.15);
}

.modal-footer-actions {
  border-top: 1px solid var(--border-color);
  padding-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Tab 3: Sync tools styling */
.sync-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 30px;
}

.sync-card {
  background-color: var(--white-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 30px;
  box-shadow: var(--shadow-soft);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.sync-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background-color: #fffaf0;
  color: #dd6b20;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  margin-bottom: 20px;
  border: 1px solid #fbd38d;
}

.sync-card h4 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.sync-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 25px;
  line-height: 1.5;
}

.sync-status {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 25px;
  width: fit-content;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.status-idle {
  background-color: #edf2f7;
  color: #4a5568;
}
.status-idle .status-indicator { background-color: #a0aec0; }

.status-syncing {
  background-color: #ebf8ff;
  color: #2b6cb0;
}
.status-syncing .status-indicator {
  background-color: #3182ce;
  animation: blink 1s infinite alternate;
}

@keyframes blink {
  to { opacity: 0.3; }
}

.status-success {
  background-color: #e6fffa;
  color: #234e52;
}
.status-success .status-indicator { background-color: var(--success-green); }

.status-error {
  background-color: #fff5f5;
  color: #742a2a;
}
.status-error .status-indicator { background-color: var(--danger-red); }

.sync-console {
  display: flex;
  flex-direction: column;
}

.sync-console h4 {
  font-size: 0.9rem;
  text-transform: uppercase;
  color: #4a5568;
  margin-bottom: 10px;
}

.console-box {
  background-color: var(--black-bar);
  color: #48bb78;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.85rem;
  padding: 20px;
  border-radius: 6px;
  height: 250px;
  overflow-y: auto;
  white-space: pre-wrap;
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
  line-height: 1.4;
}

/* Responsive adjustments */
@media screen and (max-width: 900px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar-tabs {
    flex-direction: row;
    padding: 0;
    justify-content: space-around;
  }
  
  .tabs-list {
    flex-direction: row;
    width: 100%;
  }
  
  .tab-link {
    flex-grow: 1;
    text-align: center;
    justify-content: center;
    border-left: none;
    border-bottom: 4px solid transparent;
  }
  
  .tab-link.active {
    border-bottom-color: var(--primary-orange);
  }
  
  .sidebar-info {
    display: none;
  }
  
  .sync-grid {
    grid-template-columns: 1fr;
  }
}

@media screen and (max-width: 600px) {
  .form-row {
    flex-direction: column;
    gap: 15px;
  }
  
  .col-6, .col-4 {
    width: 100%;
  }
  
  .books-table th:nth-child(4),
  .books-table td:nth-child(4),
  .books-table th:nth-child(5),
  .books-table td:nth-child(5) {
    display: none; /* Hide language & price on mobile table */
  }
}
