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

:root {
  --bg-main: #0a0a0a;
  --bg-card: #141414;
  --bg-input: #1f1f1f;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(212, 175, 55, 0.4);
  --text-main: #f5f5f7;
  --text-muted: #8e8e93;
  --accent-gold: #d4af37;
  --accent-gold-hover: #b89327;
  --accent-gold-gradient: linear-gradient(135deg, #f3e5ab 0%, #d4af37 50%, #aa7c11 100%);
  --accent-glow: rgba(212, 175, 55, 0.15);
  --danger-color: #ff453a;
  --success-color: #30d158;
  --font-display: 'Playfair Display', 'Noto Serif KR', serif;
  --font-sans: 'Outfit', 'Noto Sans KR', sans-serif;
  --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  line-height: 1.6;
}

/* Background Ambient Glows */
.bg-glow {
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  opacity: 0.15;
  pointer-events: none;
}

.glow-1 {
  top: -100px;
  left: -100px;
  background: var(--accent-gold);
}

.glow-2 {
  bottom: 20%;
  right: -100px;
  background: #7a5cff;
}

/* Typography & Links */
h1, h2, h3, h4 {
  font-weight: 600;
  letter-spacing: -0.02em;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent-gold-gradient);
  color: #121212;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(212, 175, 55, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(212, 175, 55, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
  background: rgba(255, 69, 58, 0.1);
  color: var(--danger-color);
  border: 1px solid rgba(255, 69, 58, 0.2);
  width: 100%;
  padding: 8px 12px;
  text-align: left;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition);
}

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

/* Header */
header {
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(10, 10, 10, 0.8);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-eng {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--accent-gold);
  letter-spacing: 0.05em;
}

.logo-divider {
  color: var(--border-color);
  font-size: 1.2rem;
}

.logo-kor {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-main);
  letter-spacing: 0.1em;
}

nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Dropdown Menu */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: var(--bg-card);
  min-width: 180px;
  box-shadow: 0px 8px 24px rgba(0,0,0,0.5);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  z-index: 101;
  padding: 8px;
  margin-top: 8px;
}

.dropdown-content button, .btn-import-label {
  color: var(--text-main);
  padding: 10px 12px;
  text-decoration: none;
  display: block;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-import-label {
  margin-bottom: 0;
  box-sizing: border-box;
}

.dropdown-content button:hover, .btn-import-label:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* Hero Section */
.hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 80px 24px 60px 24px;
  text-align: center;
  position: relative;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-block;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent-gold);
  margin-bottom: 16px;
  font-weight: 600;
}

.hero h1 {
  font-family: var(--font-display);
  font-size: 3.5rem;
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 24px;
  background: linear-gradient(180deg, #ffffff 0%, #d5d5d5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto 40px auto;
  word-break: keep-all;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 60px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-num {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 600;
  color: var(--accent-gold);
  line-height: 1;
}

.stat-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Gallery Section */
.gallery-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 80px 24px;
}

.gallery-filter {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 40px;
  flex-wrap: wrap;
  gap: 20px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -21px;
  left: 0;
  width: 50px;
  height: 2px;
  background: var(--accent-gold);
}

.search-bar {
  position: relative;
  max-width: 320px;
  width: 100%;
}

.search-bar i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-bar input {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  padding: 12px 16px 12px 44px;
  color: var(--text-main);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  transition: var(--transition);
}

.search-bar input:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px var(--accent-glow);
}

/* Gallery Grid & Cards */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

.art-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.art-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-hover);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4), 0 0 20px var(--accent-glow);
}

.card-img-box {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #111;
  position: relative;
}

.card-img-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.art-card:hover .card-img-box img {
  transform: scale(1.05);
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 600;
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #fff;
}

.card-author {
  font-size: 0.85rem;
  color: var(--accent-gold);
  font-weight: 500;
  margin-bottom: 12px;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 16px;
  line-height: 1.5;
  flex-grow: 1;
}

.card-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.card-footer span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.comment-badge {
  background: rgba(212, 175, 55, 0.1);
  color: var(--accent-gold);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-md);
  margin-top: 20px;
}

.empty-icon {
  font-size: 3.5rem;
  color: var(--accent-gold);
  opacity: 0.6;
  margin-bottom: 20px;
}

.empty-state h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
}

.modal-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

.modal-header {
  padding: 24px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.3rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.modal-header h2 i {
  color: var(--accent-gold);
}

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

.btn-close-modal:hover {
  color: var(--text-main);
  transform: rotate(90deg);
}

.modal-body {
  padding: 32px;
}

/* Forms */
.form-group {
  margin-bottom: 24px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
  margin-bottom: 8px;
}

input[type="text"],
input[type="password"],
textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: var(--transition);
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 8px var(--accent-glow);
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 8px;
}

/* Upload Dropzone */
.upload-dropzone {
  border: 2px dashed rgba(212, 175, 55, 0.3);
  background: rgba(212, 175, 55, 0.02);
  border-radius: var(--radius-md);
  padding: 30px 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  margin-bottom: 24px;
  position: relative;
}

.upload-dropzone:hover {
  border-color: var(--accent-gold);
  background: rgba(212, 175, 55, 0.05);
}

.upload-icon {
  font-size: 2.5rem;
  color: var(--accent-gold);
  margin-bottom: 12px;
  opacity: 0.8;
}

.main-prompt {
  font-weight: 500;
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.sub-prompt {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.dropzone-preview {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  max-height: 250px;
}

.dropzone-preview img {
  width: 100%;
  height: 250px;
  object-fit: contain;
  background: #111;
}

.btn-remove-img {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.8);
  border: 1px solid var(--border-color);
  color: #fff;
  padding: 6px 12px;
  border-radius: 4px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  cursor: pointer;
  backdrop-filter: blur(5px);
  transition: var(--transition);
}

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

/* Detail Modal Large */
.modal-wrapper.modal-lg {
  max-width: 1000px;
  width: 95%;
  height: 85vh;
}

.detail-close-floating {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.detail-container {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  height: 100%;
  overflow: hidden;
}

.detail-image-box {
  background: #0f0f0f;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-right: 1px solid var(--border-color);
  padding: 20px;
}

.detail-image-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.detail-info-box {
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  background: #161616;
}

.detail-tag {
  font-size: 0.75rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 8px;
}

#detail-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 500;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 12px;
}

.detail-meta {
  display: flex;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.detail-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.detail-meta i {
  color: var(--accent-gold);
}

.detail-description h3, .detail-comments-section h3 {
  font-size: 1rem;
  text-transform: uppercase;
  color: var(--text-main);
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  font-weight: 600;
}

.detail-description p {
  color: #d1d1d6;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 30px;
  white-space: pre-wrap;
  word-break: keep-all;
}

/* Comments section */
.detail-comments-section {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.comment-count {
  background: var(--accent-gold);
  color: #000;
  font-size: 0.75rem;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: bold;
  vertical-align: middle;
  margin-left: 4px;
}

#comment-form {
  margin-bottom: 20px;
}

.comment-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.comment-form-row input {
  padding: 8px 12px;
  font-size: 0.85rem;
}

.comment-textarea-wrapper {
  position: relative;
  display: flex;
}

.comment-textarea-wrapper textarea {
  padding: 10px 50px 10px 12px;
  font-size: 0.88rem;
  resize: none;
  height: 48px;
}

.btn-comment-submit {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: var(--accent-gold);
  border: none;
  color: #000;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-comment-submit:hover {
  background: #fff;
  transform: scale(1.05);
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

.comment-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  position: relative;
}

.comment-item-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.comment-item-author {
  font-weight: 600;
  color: #fff;
}

.comment-item-text {
  font-size: 0.85rem;
  color: #e5e5ea;
  word-break: break-all;
}

.btn-delete-comment {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  transition: var(--transition);
}

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

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(212, 175, 55, 0.4);
}

/* Footer */
footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
  text-align: center;
  margin-top: 60px;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

footer p {
  font-size: 0.88rem;
  color: var(--text-muted);
}

.footer-sub {
  margin-top: 8px;
  font-size: 0.75rem;
  opacity: 0.7;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .detail-container {
    grid-template-columns: 1fr;
    height: auto;
    max-height: 90vh;
  }
  .detail-image-box {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    aspect-ratio: 4/3;
    padding: 10px;
  }
  .modal-wrapper.modal-lg {
    height: auto;
  }
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero-stats {
    gap: 30px;
  }
  .gallery-filter {
    flex-direction: column;
    align-items: flex-start;
  }
  .search-bar {
    max-width: 1000px;
  }
  .modal-body {
    padding: 20px;
  }
}
