/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --gold: #c9a96e; --gold-dark: #b08d52; --dark: #1a1a1a; --mid: #4a4a4a;
  --light: #f8f6f2; --white: #ffffff; --border: #e8e3dc;
  --success: #27ae60; --error: #e74c3c; --pending: #f39c12;
  --radius: 8px; --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-hover: 0 8px 30px rgba(0,0,0,0.15);
}
html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; color: var(--dark); background: var(--white); line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-dark); text-decoration: none; transition: color .2s; }
a:hover { color: var(--gold); }
input, textarea, select { font-family: inherit; }
button { cursor: pointer; font-family: inherit; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3 { font-family: 'Playfair Display', serif; line-height: 1.2; }
h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }

/* ===== NAVBAR ===== */
.navbar { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 1200px; margin: auto; padding: 0 20px; display: flex; align-items: center; justify-content: space-between; height: 70px; }
.nav-brand { display: flex; align-items: center; gap: 8px; font-family: 'Playfair Display', serif; font-size: 1.4rem; color: var(--dark); font-weight: 700; }
.brand-icon { font-size: 1.5rem; }
.nav-links { list-style: none; display: flex; align-items: center; gap: 28px; }
.nav-links a, .btn-link { color: var(--mid); font-size: .95rem; font-weight: 500; transition: color .2s; background: none; border: none; font-family: inherit; font-size: .95rem; }
.nav-links a:hover, .btn-link:hover { color: var(--gold); }
.btn-primary-sm { background: var(--gold); color: var(--white) !important; padding: 8px 18px; border-radius: 20px; font-size: .875rem !important; transition: background .2s !important; }
.btn-primary-sm:hover { background: var(--gold-dark) !important; }
.nav-toggle { display: none; background: none; border: none; font-size: 1.3rem; color: var(--dark); }

/* ===== FLASH MESSAGES ===== */
.flash { padding: 14px 24px; text-align: center; font-size: .95rem; display: flex; align-items: center; justify-content: center; gap: 8px; }
.flash-success { background: #d4edda; color: #155724; }
.flash-error { background: #f8d7da; color: #721c24; }

/* ===== BUTTONS ===== */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 12px 28px; border-radius: var(--radius); font-weight: 500; font-size: .95rem; border: 2px solid transparent; transition: all .2s; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--gold); color: var(--white); border-color: var(--gold); }
.btn-primary:hover { background: var(--gold-dark); border-color: var(--gold-dark); color: var(--white); }
.btn-outline { background: transparent; color: var(--gold); border-color: var(--gold); }
.btn-outline:hover { background: var(--gold); color: var(--white); }
.btn-danger { background: var(--error); color: var(--white); border-color: var(--error); }
.btn-danger:hover { background: #c0392b; }
.btn-success { background: var(--success); color: var(--white); border-color: var(--success); }
.btn-sm { padding: 7px 16px; font-size: .85rem; }
.btn-full { width: 100%; justify-content: center; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; color: var(--mid); font-size: .9rem; }
.form-group input, .form-group textarea, .form-group select {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: .95rem; transition: border-color .2s; background: var(--white); color: var(--dark);
}
.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  outline: none; border-color: var(--gold);
}
.form-group textarea { min-height: 120px; resize: vertical; }
.form-hint { font-size: .8rem; color: #999; margin-top: 4px; }

/* ===== HERO ===== */
.hero { background: linear-gradient(135deg, #1a1a1a 0%, #2d2418 100%); color: var(--white); padding: 80px 20px; text-align: center; }
.hero h1 { color: var(--white); margin-bottom: 16px; }
.hero p { color: rgba(255,255,255,.75); font-size: 1.1rem; max-width: 600px; margin: 0 auto 32px; }
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ===== FILTER BAR ===== */
.filter-section { background: var(--light); padding: 24px 20px; border-bottom: 1px solid var(--border); }
.filter-container { max-width: 1200px; margin: auto; }
.filter-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filter-form .form-group { margin: 0; flex: 1 1 180px; }
.filter-form .form-group label { font-size: .8rem; margin-bottom: 4px; }
.filter-form input, .filter-form select { padding: 9px 12px; font-size: .875rem; }
.filter-actions { display: flex; gap: 8px; }

/* ===== GALLERY GRID ===== */
.gallery-section { padding: 50px 20px; }
.gallery-container { max-width: 1200px; margin: auto; }
.gallery-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; }
.gallery-count { color: var(--mid); font-size: .9rem; }
.masonry-grid { columns: 4 280px; column-gap: 20px; }
.art-card { break-inside: avoid; margin-bottom: 20px; background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform .3s, box-shadow .3s; }
.art-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.art-card-img { position: relative; overflow: hidden; cursor: pointer; }
.art-card-img img { width: 100%; transition: transform .4s; }
.art-card:hover .art-card-img img { transform: scale(1.03); }
.art-card-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0); display: flex; align-items: center; justify-content: center; transition: background .3s; }
.art-card:hover .art-card-overlay { background: rgba(0,0,0,.2); }
.zoom-btn { opacity: 0; background: rgba(255,255,255,.9); border: none; width: 44px; height: 44px; border-radius: 50%; font-size: 1.1rem; color: var(--dark); transition: opacity .3s; cursor: pointer; }
.art-card:hover .zoom-btn { opacity: 1; }
.sale-badge { position: absolute; top: 10px; right: 10px; padding: 4px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; }
.badge-sale { background: var(--success); color: white; }
.badge-commission { background: var(--gold); color: white; }
.badge-not-sale { background: var(--mid); color: white; }
.art-card-info { padding: 16px; }
.art-card-title { font-family: 'Playfair Display', serif; font-size: 1rem; margin-bottom: 4px; }
.art-card-artist { font-size: .85rem; color: var(--mid); margin-bottom: 8px; }
.art-card-artist a { color: var(--gold-dark); }
.art-card-meta { display: flex; justify-content: space-between; align-items: center; }
.art-card-price { font-weight: 600; color: var(--dark); }
.art-card-medium { font-size: .8rem; color: #999; }
.empty-gallery { text-align: center; padding: 80px 20px; color: var(--mid); }
.empty-gallery i { font-size: 4rem; color: var(--border); margin-bottom: 20px; }

/* ===== LIGHTBOX ===== */
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 90vw; max-height: 90vh; object-fit: contain; border-radius: 4px; }
.lightbox-close { position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,.15); border: none; color: white; width: 44px; height: 44px; border-radius: 50%; font-size: 1.2rem; cursor: pointer; transition: background .2s; }
.lightbox-close:hover { background: rgba(255,255,255,.3); }

/* ===== PAGE CONTAINERS ===== */
.page-container { max-width: 900px; margin: 50px auto; padding: 0 20px; }
.page-container-sm { max-width: 540px; margin: 60px auto; padding: 0 20px; }
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); padding: 32px; box-shadow: var(--shadow); }
.card-header { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 28px; }
.page-title { font-family: 'Playfair Display', serif; color: var(--dark); margin-bottom: 8px; }
.page-subtitle { color: var(--mid); font-size: .95rem; }

/* ===== DASHBOARD ===== */
.dashboard-grid { display: grid; grid-template-columns: 1fr 2fr; gap: 30px; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 20px; font-size: .85rem; font-weight: 600; }
.status-approved { background: #d4edda; color: #155724; }
.status-pending { background: #fff3cd; color: #856404; }
.status-rejected { background: #f8d7da; color: #721c24; }
.status-inactive { background: #e2e3e5; color: #495057; }
.artwork-preview { border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; cursor: pointer; }
.artwork-preview img { width: 100%; border-radius: var(--radius); }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.info-item { background: var(--light); padding: 12px 16px; border-radius: var(--radius); }
.info-label { font-size: .75rem; color: #999; text-transform: uppercase; letter-spacing: .5px; }
.info-value { font-weight: 500; color: var(--dark); margin-top: 2px; }
.profile-photo { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--gold); }
.profile-photo-placeholder { width: 80px; height: 80px; border-radius: 50%; background: var(--light); border: 3px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 2rem; color: #ccc; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.rejection-box { background: #fff3cd; border-left: 4px solid var(--pending); padding: 14px 18px; border-radius: 0 var(--radius) var(--radius) 0; margin: 16px 0; font-size: .9rem; }

/* ===== ADMIN ===== */
.admin-header { background: var(--dark); color: white; padding: 0 20px; }
.admin-nav { max-width: 1300px; margin: auto; height: 60px; display: flex; align-items: center; justify-content: space-between; }
.admin-brand { color: white; font-family: 'Playfair Display', serif; font-size: 1.2rem; }
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 30px; }
.stat-card { background: white; border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; text-align: center; }
.stat-number { font-size: 2rem; font-weight: 700; font-family: 'Playfair Display', serif; }
.stat-label { font-size: .8rem; color: var(--mid); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.stat-cap { color: var(--error); }
.stat-approved { color: var(--success); }
.stat-pending { color: var(--pending); }
.cap-bar { background: var(--border); border-radius: 20px; height: 8px; margin-bottom: 30px; overflow: hidden; }
.cap-fill { height: 100%; border-radius: 20px; transition: width .5s; }
.cap-fill.safe { background: var(--success); }
.cap-fill.warning { background: var(--pending); }
.cap-fill.full { background: var(--error); }
.vendors-table { width: 100%; border-collapse: collapse; }
.vendors-table th, .vendors-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); font-size: .9rem; }
.vendors-table th { background: var(--light); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .5px; color: var(--mid); }
.vendors-table tr:hover { background: #fafafa; }
.thumb-small { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.admin-container { max-width: 1300px; margin: 30px auto; padding: 0 20px; }

/* ===== PUBLIC PROFILE ===== */
.profile-page { max-width: 1100px; margin: 50px auto; padding: 0 20px; }
.profile-hero { display: grid; grid-template-columns: 200px 1fr; gap: 40px; margin-bottom: 50px; align-items: start; }
.profile-avatar { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 4px solid var(--gold); }
.profile-avatar-placeholder { width: 160px; height: 160px; border-radius: 50%; background: var(--light); border: 4px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 4rem; color: #ccc; }
.artwork-full { border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-hover); cursor: pointer; margin-bottom: 30px; }
.artwork-full img { width: 100%; }
.inquiry-form { background: var(--light); border-radius: var(--radius); padding: 28px; }
.price-display { font-size: 1.8rem; font-family: 'Playfair Display', serif; color: var(--gold-dark); font-weight: 700; }

/* ===== ARTWORK DETAIL GRID (public profile) ===== */
.artwork-detail-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 40px; align-items: start; }

/* ===== UPLOAD AREA ===== */
.upload-area { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px; text-align: center; cursor: pointer; transition: border-color .2s, background .2s; }
.upload-area:hover, .upload-area.drag-over { border-color: var(--gold); background: #fdf9f3; }
.upload-area i { font-size: 2.5rem; color: var(--gold); margin-bottom: 12px; }
.upload-area input { display: none; }

/* ===== REGISTER CLOSED ===== */
.closed-page { text-align: center; padding: 100px 20px; max-width: 500px; margin: auto; }
.closed-icon { font-size: 4rem; margin-bottom: 20px; }

/* ===== FOOTER ===== */
.site-footer { background: var(--dark); color: rgba(255,255,255,.7); padding: 50px 20px 0; margin-top: 80px; }
.footer-container { max-width: 1200px; margin: auto; display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; padding-bottom: 40px; flex-wrap: wrap; }
.footer-brand { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: white; }
.footer-brand p { font-size: .875rem; font-family: 'Inter', sans-serif; color: rgba(255,255,255,.5); margin-top: 8px; font-weight: 300; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { color: rgba(255,255,255,.6); font-size: .9rem; transition: color .2s; }
.footer-links a:hover { color: var(--gold); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 20px 0; text-align: center; font-size: .8rem; color: rgba(255,255,255,.4); max-width: 1200px; margin: auto; }

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 900px) {
  .dashboard-grid { grid-template-columns: 1fr 1.5fr; gap: 20px; }
  .profile-hero { grid-template-columns: 160px 1fr; gap: 24px; }
}

/* Mobile */
@media (max-width: 768px) {
  /* Navbar */
  .nav-toggle { display: block; }
  .nav-links {
    display: none; position: absolute; top: 70px; left: 0; right: 0;
    background: white; flex-direction: column; padding: 20px;
    border-bottom: 1px solid var(--border); gap: 16px; z-index: 99;
    box-shadow: 0 8px 24px rgba(0,0,0,.1);
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a, .btn-link { display: block; width: 100%; padding: 6px 0; font-size: 1rem; }
  .btn-primary-sm { display: block; text-align: center; border-radius: var(--radius); }

  /* Layout grids */
  .dashboard-grid { grid-template-columns: 1fr; }
  .profile-hero { grid-template-columns: 1fr; text-align: center; }
  .profile-avatar, .profile-avatar-placeholder { margin: 0 auto; }
  .info-grid { grid-template-columns: 1fr 1fr; }

  /* Gallery */
  .masonry-grid { columns: 2 160px; column-gap: 12px; }
  .gallery-section { padding: 30px 16px; }

  /* Hero */
  .hero { padding: 50px 16px; }

  /* Filter form – 2-col grid on mobile */
  .filter-section { padding: 16px; }
  .filter-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
  .filter-form .form-group { flex: unset; margin: 0; }
  .filter-actions { grid-column: span 2; display: flex; gap: 8px; }
  .filter-actions .btn { flex: 1; justify-content: center; }

  /* Cards & containers */
  .card { padding: 20px; }
  .page-container { margin: 24px auto; padding: 0 16px; }
  .page-container-sm { margin: 24px auto; padding: 0 16px; }

  /* Admin */
  .admin-header { padding: 0 12px; }
  .admin-nav { min-height: 60px; height: auto; padding: 10px 0; flex-wrap: wrap; gap: 8px; }
  .admin-container { padding: 0 12px; margin: 16px auto; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .stat-card { padding: 14px 10px; }
  .stat-number { font-size: 1.7rem; }

  /* Action rows */
  .action-row { flex-direction: column; }

  /* Public profile */
  .profile-page { padding: 0 16px; margin: 24px auto; }
  .inquiry-form { padding: 20px; }
  .price-display { font-size: 1.5rem; }
  .profile-avatar { width: 120px; height: 120px; }
  .profile-avatar-placeholder { width: 120px; height: 120px; font-size: 3rem; }
  /* Artwork detail grid: stack image above info on mobile */
  .artwork-detail-grid { grid-template-columns: 1fr; gap: 24px; }

  /* Footer */
  .site-footer { padding: 36px 16px 0; margin-top: 50px; }
  .footer-container { flex-direction: column; gap: 20px; text-align: center; align-items: center; }
  .footer-links { align-items: center; text-align: center; }
  .footer-bottom { padding: 16px 0; }

  /* Lightbox */
  .lightbox img { max-width: 95vw; max-height: 82vh; }
  .lightbox-close { top: 10px; right: 10px; width: 38px; height: 38px; font-size: 1rem; }

  /* Flash */
  .flash { padding: 10px 16px; font-size: .875rem; }
}

/* Small mobile (480px and below) */
@media (max-width: 480px) {
  /* Gallery – single column */
  .masonry-grid { columns: 1; }
  .gallery-section { padding: 20px 12px; }

  /* Stats – 2 col */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-number { font-size: 1.5rem; }
  .stat-card { padding: 12px 8px; }

  /* Hero */
  .hero { padding: 40px 16px; }
  .hero p { font-size: .95rem; }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { text-align: center; justify-content: center; }

  /* Cards */
  .card { padding: 16px; }

  /* Buttons */
  .btn { padding: 11px 18px; font-size: .9rem; }

  /* Forms */
  .form-group input, .form-group textarea, .form-group select { padding: 10px 12px; font-size: .9rem; }

  /* Admin table compact */
  .vendors-table th, .vendors-table td { padding: 10px 8px; font-size: .8rem; }
  .thumb-small { width: 36px; height: 36px; }

  /* Info grid – single col on small */
  .info-grid { grid-template-columns: 1fr; }

  /* Upload area */
  .upload-area { padding: 24px 16px; }
  .upload-area i { font-size: 2rem; }

  /* Public profile */
  .artwork-full { border-radius: 8px; }
  .inquiry-form { padding: 16px; }

  /* Rejection box */
  .rejection-box { padding: 12px 14px; }
}

/* Very small phones (360px and below) */
@media (max-width: 360px) {
  h1 { font-size: 1.6rem; }
  .nav-brand { font-size: 1.1rem; }
  .stats-grid { grid-template-columns: 1fr; }
  .filter-form { grid-template-columns: 1fr; }
  .filter-actions { grid-column: span 1; }
}
