/*
  Modern painter-friendly theme
  - Clean whites and soft surfaces
  - Vibrant teal accent with warm terracotta support
  - Subtle depth and generous spacing
*/

:root {
  --bg: #f8fafc; /* page background (off-white) */
  --surface: #ffffff; /* cards and panels */
  --surface-2: #fbfbfd; /* subtle contrast surface */
  --text: #1f2937; /* slate 800 */
  --muted: #6b7280; /* slate 500 */
  --border: #e5e7eb; /* gray 200 */
  --accent: #0ea5a4; /* teal 500 */
  --accent-600: #0b8f8e;
  --accent-700: #0a7d7c;
  --warm: #e76f51; /* terracotta */
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #e11d48; /* rose 600 */
  --shadow: 0 8px 30px rgba(2, 6, 23, 0.06);
  --radius: 12px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

/* Global media responsiveness */
img,
video {
  max-width: 100%;
  height: auto;
}
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(
      1200px 600px at 10% -10%,
      #ffffff 10%,
      transparent 60%
    ),
    radial-gradient(1200px 600px at 110% -20%, #ffffff 10%, transparent 60%),
    var(--bg);
  line-height: 1.6;
}

.container {
  width: min(1100px, 92%);
  margin: 0 auto;
  padding: 2rem 0;
}

h1,
h2,
h3 {
  margin: 0 0 1rem;
  line-height: 1.2;
}
h1 {
  font-size: clamp(1.8rem, 2.6vw, 2.4rem);
}
h2 {
  font-size: clamp(1.3rem, 2vw, 1.6rem);
}
p {
  margin: 0 0 1rem;
  color: var(--text);
}

a {
  color: var(--accent-700);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Buttons */
.btn {
  --bgc: var(--accent);
  background: linear-gradient(180deg, var(--bgc), var(--accent-600));
  color: #fff;
  border: 0;
  padding: 0.65rem 1.05rem;
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  transition: transform 0.06s ease, filter 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover {
  filter: brightness(1.02);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn-danger {
  --bgc: var(--danger);
  background: linear-gradient(180deg, var(--danger), #be123c);
}
.btn[disabled] {
  opacity: 0.7;
  cursor: not-allowed;
  filter: grayscale(0.1);
}
.btn.secondary {
  --bgc: var(--warm);
  background: linear-gradient(180deg, var(--warm), #d35c41);
}
.link {
  color: var(--accent-700);
  cursor: pointer;
}

/* Alerts */
.alert {
  padding: 0.8rem 1rem;
  border-radius: 10px;
  margin: 0.5rem 0;
  border: 1px solid var(--border);
  background: var(--surface);
}
.alert.success {
  background: #e7f8ee;
  color: #166534;
  border-color: #b6f0c6;
}
.alert.error {
  background: #fdecec;
  color: #7f1d1d;
  border-color: #f7c6c6;
}

/* Hero */
.hero {
  position: relative;
  min-height: 88vh;
  background-color: #e5e7eb;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  border-bottom: 1px solid var(--border);
}
.hero .overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(
    to bottom right,
    rgba(10, 125, 124, 0.45),
    rgba(231, 111, 81, 0.15)
  );
}
.greeting {
  color: #fff;
  font-size: clamp(2rem, 6vw, 4rem);
  text-align: center;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
}

/* About */
.about-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  align-items: center;
}
.profile-pic {
  width: 100%;
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow);
}
.profile-placeholder {
  width: 100%;
  height: 320px;
  background: linear-gradient(180deg, var(--surface), var(--surface-2));
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  color: var(--muted);
  border: 1px dashed var(--border);
}

/* Grid and Cards */
.grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
}
.card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}
.card .card-body img,
.content img {
  max-width: 100%;
  height: auto;
}
.card-title {
  padding: 0.65rem 0.85rem;
  font-weight: 600;
}
.video-thumb {
  height: 160px;
  display: grid;
  place-items: center;
  font-size: 2rem;
  background: #0b0b0b;
  color: #fff;
}

/* Sections */
.featured h2,
.tips h2,
.quotes h2,
.tutorials h2 {
  margin-bottom: 1rem;
}
.tips ul {
  margin: 0;
  padding-left: 1.25rem;
}
blockquote {
  background: var(--surface);
  padding: 1rem 1.25rem;
  border-left: 5px solid var(--accent);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
cite {
  display: block;
  margin-top: 0.5rem;
  color: var(--muted);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal.open {
  display: flex;
}
.modal-content {
  background: var(--surface);
  border-radius: var(--radius);
  width: min(1100px, 96%);
  max-height: 90vh;
  overflow: auto;
  position: relative;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}
.modal-content::-webkit-scrollbar {
  width: 10px;
}
.modal-content::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 8px;
}
.modal-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: var(--text);
  color: #fff;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
}
.modal-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1rem;
  padding: 1rem;
  align-items: start;
}
.modal-body.video {
  grid-template-columns: 1fr;
}
.modal-body > img,
#modalImage,
#modalVideo {
  width: 100%;
  height: auto;
  max-height: 78vh; /* keep media within viewport */
  object-fit: contain;
  border-radius: 10px;
}
.modal-side {
  padding-right: 1rem;
}
.video-controls button {
  margin: 0.25rem 0.25rem 0 0;
}

/* Admin notifications panel refinement */
.notifications {
  font-size: 14px;
}
.notif-item {
  background: var(--surface);
}

/* Forms */
label {
  display: block;
  margin: 0.6rem 0;
  font-weight: 500;
}
input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea,
select {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  outline: none;
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
textarea {
  resize: vertical;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(14, 165, 164, 0.15);
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #e5e7eb;
  padding: 1rem 0;
  border-top: 1px solid #0b1220;
}
.site-footer a {
  color: #fff;
  text-decoration: underline;
}
.footer-social {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.footer-social .social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.1s ease, background 0.2s ease;
}
.footer-social .social-link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.18);
}

/* Admin layout polish */
.admin {
  background: linear-gradient(180deg, #f9fafb, #f3f4f6);
}
.admin .sidebar {
  background: #0f172a;
}
.admin .sidebar a {
  color: #e5e7eb;
}
.admin .sidebar a.active,
.admin .sidebar a:hover {
  background: #111827;
}
.admin .content {
  background: transparent;
}
.admin .topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.badge {
  background: var(--danger);
}

/* Admin list alignment helpers */
.list .list-item {
  align-items: center;
}
.list .list-item summary {
  list-style: none;
  /* Prevent clicking summary content from toggling details; only Edit button should */
  pointer-events: none;
}
/* Re-enable interaction for elements inside summary (buttons, forms, etc.) */
.list .list-item summary > * {
  pointer-events: auto;
}
/* Hide default marker in some browsers */
.list .list-item summary::-webkit-details-marker {
  display: none;
}

/* Responsive */
@media (max-width: 800px) {
  .hero {
    min-height: 60vh;
    background-position: center top;
  }
  .about-inner {
    grid-template-columns: 1fr;
  }
  .modal-body {
    grid-template-columns: 1fr;
    padding: 0.75rem;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
}

/* Admin mobile optimization */
@media (max-width: 900px) {
  .admin {
    flex-direction: column;
  }
  .admin .sidebar {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 1rem;
  }
  .admin .content {
    padding: 1rem;
  }
  .grid-admin-2 {
    grid-template-columns: 1fr !important;
  }
  .list-item {
    flex-wrap: wrap;
  }
  .thumb {
    width: 64px;
    height: 48px;
  }
}

/* Navbar */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

/* About page */
.about-hero {
  padding: 2rem 0 1rem;
}
.about-hero-inner {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.25rem;
  align-items: center;
}
.about-hero-pic {
  width: 220px;
  height: 220px;
  object-fit: cover;
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.about-hero-text p {
  margin: 0.5rem 0 0;
}
.about-hero-body {
  margin-top: 0.5rem;
}
.about-hero-body img {
  max-width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  margin: 0.5rem 0;
}
.about-hero-body {
  margin-top: 0.5rem;
}
.about-sections {
  padding: 1rem 0 2rem;
}
.about-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 0.75rem 0;
  box-shadow: var(--shadow);
}
.about-section-title {
  margin: 0 0 0.5rem;
}
/* Cards grid */
.about-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}
@media (max-width: 1200px) {
  .about-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 900px) {
  .about-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  .about-cards {
    grid-template-columns: 1fr;
  }
}
.about-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-height: 120px;
}
.about-card-title {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
}
.about-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.about-card-content {
  font-size: 0.95rem;
  color: var(--text);
}
.about-card-content img {
  max-width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: contain;
}
/* Fallback: any images inside about sections container */
.about-sections img {
  max-width: 100%;
  height: auto;
}
.about-section-image {
  width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  margin: 0.5rem 0;
}
.about-section-content img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 800px) {
  .about-hero-inner {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }
  .about-hero-pic {
    width: 160px;
    height: 160px;
  }
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.2rem 0; /* taller navbar */
  position: relative; /* anchor for mobile dropdown */
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.8rem; /* more breathing room with larger logo */
  text-decoration: none;
  color: inherit;
  font-weight: 700;
}
.brand-logo {
  width: 80px; /* larger for clearer visibility */
  height: 80px;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(2, 6, 23, 0.12));
}
.brand-name {
  letter-spacing: 0.5px;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem); /* scale name slightly */
}
.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.nav-links a {
  color: var(--text);
  text-decoration: none;
  padding: 0.55rem 0.7rem; /* slightly larger hit area */
  border-radius: 8px;
}
.nav-links a:hover {
  background: var(--surface-2);
}
.nav-links a[aria-current="page"] {
  color: var(--accent-700);
  background: rgba(14, 165, 164, 0.08);
  box-shadow: 0 0 0 1px rgba(14, 165, 164, 0.2) inset;
}
.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.4rem 0.6rem;
}

@media (max-width: 800px) {
  .container {
    padding: 1rem 0;
  }
  .nav-links {
    position: absolute;
    right: 1rem;
    top: 100%; /* follow navbar height */
    margin-top: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    min-width: 180px;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-toggle {
    display: block;
  }
}
