/* Decor Dreams - Main Stylesheet */
:root {
  --color-cream: #faf8f5;
  --color-sand: #e8e2d9;
  --color-terracotta: #c4a77d;
  --color-sage: #8b9a7a;
  --color-charcoal: #2c2c2c;
  --color-muted: #6b6b6b;
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
  --shadow-soft: 0 4px 20px rgba(0,0,0,0.06);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--color-charcoal);
  background: var(--color-cream);
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-charcoal);
}

a {
  color: var(--color-sage);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover {
  color: var(--color-terracotta);
}

/* Header & Nav */
.site-header {
  background: #fff;
  box-shadow: var(--shadow-soft);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.logo {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-charcoal);
}
.logo span { color: var(--color-terracotta); }

.main-nav {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.main-nav a {
  padding: 0.5rem 1rem;
  color: var(--color-charcoal);
  border-radius: var(--radius);
  font-weight: 500;
}
.main-nav a:hover,
.main-nav a.active {
  background: var(--color-sand);
  color: var(--color-sage);
}

/* Main content */
.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem 3rem;
  min-height: 50vh;
}

.page-title {
  font-size: 2.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--color-terracotta);
  display: inline-block;
}

/* Hero (Home) */
.hero {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 4rem 1.5rem;
  text-align: center;
  border-radius: 0 0 24px 24px;
  margin-bottom: 2rem;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero h1 {
  font-size: 2.75rem;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}
.hero .tagline {
  font-size: 1.25rem;
  color: var(--color-muted);
  margin-bottom: 2rem;
}
.hero .cta {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  background: var(--color-sage);
  color: #fff !important;
  border-radius: var(--radius);
  font-weight: 600;
  transition: background 0.2s, transform 0.2s;
}
.hero .cta:hover {
  background: var(--color-charcoal);
  transform: translateY(-2px);
}

/* Sections */
.section-block {
  margin-bottom: 2.5rem;
}
.section-block h2 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--color-sage);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

.card-image {
  height: 200px;
  background: var(--color-sand);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-body { padding: 1.25rem; }
.card-body h3 { margin: 0 0 0.5rem; font-size: 1.2rem; }
.card-body p { margin: 0; color: var(--color-muted); font-size: 0.95rem; }
.card-body .visit-count {
  margin-top: 0.5rem;
  font-weight: 600;
  color: var(--color-sage);
}
.card-cta {
  display: inline-block;
  margin-top: 0.5rem;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Product detail page */
.product-detail { margin-bottom: 2rem; }
.product-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 700px) {
  .product-detail-grid { grid-template-columns: 1fr; }
}
.product-detail-image {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  background: var(--color-sand);
}
.product-detail-image img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}
.product-detail-body .page-title { margin-top: 0; }
.product-description {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-charcoal);
  margin: 1rem 0 1.5rem;
}
.back-link { font-weight: 500; }

/* Last 5 visited link */
.recent-link-wrap { margin-bottom: 1.5rem; }
.recent-link {
  display: inline-block;
  padding: 0.6rem 1rem;
  background: var(--color-sand);
  border-radius: var(--radius);
  font-weight: 600;
  color: var(--color-charcoal);
}
.recent-link:hover {
  background: var(--color-terracotta);
  color: #fff;
}
.no-recent { font-size: 1.05rem; }
.back-to-products { margin-top: 2rem; }
.back-to-products a { font-weight: 500; }

/* News list */
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li {
  background: #fff;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  border-left: 4px solid var(--color-sage);
}
.news-list .date { font-size: 0.85rem; color: var(--color-muted); margin-bottom: 0.25rem; }
.news-list h3 { margin: 0 0 0.5rem; font-size: 1.15rem; }

/* Contacts (from file) */
.contacts-sections {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.contact-section {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.contact-section h3 {
  font-size: 1.1rem;
  margin: 0 0 1rem;
  color: var(--color-sage);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--color-sand);
}
.contact-section ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.contact-section li {
  padding: 0.25rem 0;
  font-size: 0.95rem;
}
.contact-section a { word-break: break-all; }

/* About */
.about-hero {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 4rem 1.5rem;
  text-align: center;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.about-hero .page-title {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  border-bottom-color: rgba(255,255,255,0.6);
}
.about-intro {
  font-size: 1.1rem;
  max-width: 720px;
  margin-bottom: 2rem;
}
.about-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}
.about-features .item {
  background: #fff;
  padding: 1.25rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  text-align: center;
}
.about-features .item strong { color: var(--color-sage); }
.about-feature-img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: 0.75rem;
  display: block;
}
.news-hero {
  background-size: cover;
  background-position: center;
  padding: 3rem 1.5rem;
  text-align: center;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.news-hero .page-title {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.5);
  border-bottom-color: rgba(255,255,255,0.6);
}

/* Footer */
.site-footer {
  background: var(--color-charcoal);
  color: var(--color-sand);
  padding: 2rem 1.5rem;
  margin-top: 3rem;
  text-align: center;
}

.site-footer a { color: var(--color-terracotta); }
.site-footer .copy { font-size: 0.9rem; margin-top: 1rem; opacity: 0.9; }

/* Login + Secure pages */
.login-section { max-width: 520px; margin-left: auto; margin-right: auto; }
.login-intro { margin-bottom: 1.5rem; color: var(--color-muted); }
.login-error {
  background: #f8d7da;
  color: #721c24;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}
.login-form .form-group { margin-bottom: 1.25rem; }
.login-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--color-charcoal);
}
.login-form input[type="text"],
.login-form input[type="password"] {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--color-sand);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
}
.login-form input:focus {
  outline: none;
  border-color: var(--color-sage);
  box-shadow: 0 0 0 2px rgba(139, 154, 122, 0.2);
}
.login-form .cta {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.95rem 1.25rem;
  border: none;
  cursor: pointer;
  border-radius: calc(var(--radius) + 6px);
  font-family: var(--font-heading);
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff !important;
  background:
    linear-gradient(135deg, rgba(196,167,125,0.95) 0%, rgba(139,154,122,0.95) 55%, rgba(44,44,44,0.95) 100%);
  box-shadow: 0 10px 28px rgba(44,44,44,0.18);
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
.login-form .cta::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 10%, rgba(255,255,255,0.35), transparent 55%);
  opacity: 0.9;
  pointer-events: none;
}
.login-form .cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(44,44,44,0.22);
  filter: saturate(1.05);
}
.login-form .cta:active {
  transform: translateY(0);
  box-shadow: 0 8px 22px rgba(44,44,44,0.18);
}
.login-form .cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(139, 154, 122, 0.35), 0 12px 30px rgba(44,44,44,0.2);
}

.secure-intro { margin-bottom: 1rem; color: var(--color-muted); }
.logout-link { font-weight: 600; }
.users-document {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  overflow-x: auto;
}
.users-document pre {
  margin: 0;
  font-family: var(--font-body);
  font-size: 0.95rem;
  line-height: 1.7;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* User database pages */
.user-action-grid .card-body h2 {
  margin-top: 0;
}

.form-panel {
  background: #fff;
  padding: 1.5rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.user-form .form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.user-form .form-group {
  margin-bottom: 1.25rem;
}

.user-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--color-charcoal);
}

.user-form input,
.user-form textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--color-sand);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
}

.user-form input:focus,
.user-form textarea:focus {
  outline: none;
  border-color: var(--color-sage);
  box-shadow: 0 0 0 2px rgba(139, 154, 122, 0.2);
}

.form-submit {
  display: inline-block;
  padding: 0.75rem 1.35rem;
  border: none;
  border-radius: var(--radius);
  background: var(--color-sage);
  color: #fff !important;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
}

.form-submit:hover {
  background: var(--color-charcoal);
}

.form-message {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.form-message ul {
  margin: 0.5rem 0 0;
}

.success-message {
  background: #d4edda;
  color: #155724;
}

.error-message {
  background: #f8d7da;
  color: #721c24;
}

.table-wrap {
  overflow-x: auto;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.users-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.users-table th,
.users-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--color-sand);
  text-align: left;
  vertical-align: top;
}

.users-table th {
  background: var(--color-sand);
  color: var(--color-charcoal);
  font-weight: 600;
}

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

@media (max-width: 700px) {
  .user-form .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* Utility */
.text-center { text-align: center; }
.mb-0 { margin-bottom: 0; }
