/* ============================================
   TVAM DESIGN STUDIO — Custom Styles
   Supplements Tailwind CSS (via CDN)
   ============================================ */

/* ---------- Preloader ---------- */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #FAF8F5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.preloader.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* Logo: fade up + scale in */
.preloader-logo-img {
  height: 90px;
  width: auto;
  opacity: 0;
  transform: translateY(16px) scale(0.92);
  animation: preloaderLogoIn 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards 0.15s;
}
@keyframes preloaderLogoIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Tagline below logo */
.preloader-tagline {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #B8956A;
  margin-top: 18px;
  opacity: 0;
  animation: preloaderTagIn 0.7s ease forwards 0.6s;
}
@keyframes preloaderTagIn {
  to { opacity: 0.7; }
}

/* Elegant line loader */
.preloader-line {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 1.5px;
  background: #E8E0D8;
  border-radius: 2px;
  overflow: hidden;
}
.preloader-line::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, #3B9B8F 40%, #B8956A 70%, transparent);
  animation: preloaderSweep 1.2s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}
@keyframes preloaderSweep {
  0%   { left: -100%; }
  100% { left: 100%; }
}

/* Navbar logo */
.nav-logo {
  height: 70px;
  width: auto;
  margin: -8px 0;
}

/* Footer logo — dedicated white version for dark background */
.footer-logo {
  height: 55px;
  width: auto;
  opacity: 0.9;
  transition: opacity 0.3s ease;
}
.footer-logo:hover {
  opacity: 1;
}

/* ---------- Base ---------- */
html { scroll-behavior: smooth; }

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #FAF8F5; }
::-webkit-scrollbar-thumb { background: #E8E0D8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #B8956A; }

/* ---------- Hero Gradients ---------- */
.hero-gradient {
  background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
}
.project-gradient {
  background: linear-gradient(to top, rgba(30,30,30,0.9) 0%, rgba(30,30,30,0) 100%);
}

/* ---------- Masonry Grid ---------- */
.masonry-grid { column-count: 1; column-gap: 1.5rem; }
@media (min-width: 768px) { .masonry-grid { column-count: 2; } }
@media (min-width: 1024px) { .masonry-grid { column-count: 3; } }
.masonry-item { break-inside: avoid; margin-bottom: 1.5rem; }

/* ---------- Scroll Animations ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Toast Notifications ---------- */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  padding: 14px 24px;
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 400px;
}
.toast.show { transform: translateX(0); }
.toast-success { background: #3B9B8F; }
.toast-error { background: #dc2626; }

/* ---------- Select Arrow ---------- */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231E1E1E' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0 center;
}

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

/* ---------- Admin Layout ---------- */
.admin-sidebar {
  width: 260px;
  min-height: 100vh;
  background: #1E1E1E;
  color: #fff;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}
.admin-main {
  margin-left: 260px;
  min-height: 100vh;
  padding: 32px;
  background: #FAF8F5;
}

@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-main { margin-left: 0; }
}

/* ---------- Sidebar Links ---------- */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  font-size: 14px;
  color: rgba(255,255,255,0.6);
  transition: all 0.2s;
  border-left: 3px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.sidebar-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.05);
}
.sidebar-link.active {
  color: #3B9B8F;
  background: rgba(59,155,143,0.1);
  border-left-color: #3B9B8F;
}
.sidebar-link i { width: 20px; text-align: center; }

/* ---------- Admin Section Toggle ---------- */
.admin-section { display: none; }
.admin-section.active { display: block; }

/* ---------- Admin Cards ---------- */
.stat-card {
  background: #fff;
  border: 1px solid #F2EDE7;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.stat-card-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

/* ---------- Admin Tables ---------- */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table th {
  text-align: left;
  padding: 12px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(30,30,30,0.5);
  border-bottom: 2px solid #F2EDE7;
  font-weight: 500;
}
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #F2EDE7;
  color: #1E1E1E;
}
.admin-table tr:hover td { background: rgba(242,237,231,0.3); }
.actions-cell { display: flex; gap: 6px; }
.admin-btn-sm {
  width: 32px; height: 32px;
  border: 1px solid #F2EDE7;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: rgba(30,30,30,0.5);
  transition: all 0.2s;
}
.admin-btn-sm:hover { border-color: #3B9B8F; color: #3B9B8F; }
.admin-btn-sm.admin-btn-delete:hover { border-color: #dc2626; color: #dc2626; }

/* ---------- Badges ---------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-published { background: rgba(59,155,143,0.1); color: #3B9B8F; }
.badge-draft { background: rgba(30,30,30,0.08); color: rgba(30,30,30,0.5); }
.badge-active { background: rgba(59,155,143,0.1); color: #3B9B8F; }
.badge-inactive { background: rgba(30,30,30,0.08); color: rgba(30,30,30,0.5); }
.badge-unread { background: rgba(184,149,106,0.15); color: #B8956A; }
.badge-read { background: rgba(30,30,30,0.08); color: rgba(30,30,30,0.5); }
.badge-cat { background: rgba(59,155,143,0.1); color: #3B9B8F; }

/* ---------- Admin Modal ---------- */
.admin-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0,0,0,0.5);
  display: none;
  justify-content: flex-end;
}
.admin-modal-overlay.show { display: flex; }
.admin-modal {
  width: 100%;
  max-width: 560px;
  height: 100vh;
  background: #fff;
  overflow-y: auto;
  padding: 32px;
  transform: translateX(100%);
  transition: transform 0.3s ease;
}
.admin-modal-overlay.show .admin-modal { transform: translateX(0); }

/* ---------- Admin Form ---------- */
.admin-form-group { margin-bottom: 20px; }
.admin-form-group label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(30,30,30,0.5);
  margin-bottom: 6px;
  font-weight: 500;
}
.admin-form-group input,
.admin-form-group textarea,
.admin-form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #E8E0D8;
  border-radius: 8px;
  font-size: 14px;
  color: #1E1E1E;
  background: #FAF8F5;
  transition: border-color 0.2s;
  outline: none;
}
.admin-form-group input:focus,
.admin-form-group textarea:focus,
.admin-form-group select:focus {
  border-color: #3B9B8F;
}

/* ---------- Upload Zone ---------- */
.upload-zone {
  border: 2px dashed #E8E0D8;
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  color: rgba(30,30,30,0.4);
}
.upload-zone:hover,
.upload-zone.drag-over {
  border-color: #3B9B8F;
  background: rgba(59,155,143,0.05);
  color: #3B9B8F;
}
.upload-preview {
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.upload-preview img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

/* ---------- Login Overlay ---------- */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #1E1E1E;
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-card {
  background: #FAF8F5;
  border-radius: 16px;
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  margin: 0 20px;
}

/* ---------- Recent Items ---------- */
.recent-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #F2EDE7;
  font-size: 13px;
}
.recent-item:last-child { border-bottom: none; }
.recent-item-title { color: #1E1E1E; }
.recent-item-date { color: rgba(30,30,30,0.4); font-size: 12px; }
.recent-empty { color: rgba(30,30,30,0.4); font-size: 13px; padding: 20px 0; text-align: center; }

/* ---------- Table Empty ---------- */
.table-empty {
  text-align: center;
  color: rgba(30,30,30,0.4);
  padding: 40px 16px !important;
}
.table-empty i {
  display: block;
  font-size: 24px;
  margin-bottom: 8px;
  opacity: 0.3;
}

/* ---------- Inquiry Filter Tabs ---------- */
.inquiry-tab {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
  background: none;
  color: rgba(30,30,30,0.5);
}
.inquiry-tab:hover { color: #1E1E1E; }
.inquiry-tab.active {
  background: #3B9B8F;
  color: #fff;
}

/* ---------- Mobile Sidebar Toggle ---------- */
.sidebar-toggle-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 101;
  width: 40px; height: 40px;
  background: #1E1E1E;
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
@media (max-width: 768px) {
  .sidebar-toggle-btn { display: flex; }
}
