:root {
  --bg-main: #0B0F17;
  --bg-card: #161F30;
  --bg-modal: #1E293D;
  --accent: #0088FF;
  --accent-hover: #0066CC;
  --accent-alpha: rgba(0, 136, 255, 0.15);
  --text-main: #F1F5F9;
  --text-muted: #94A3B8;
  --toast-bg: #102E1B;
  --toast-accent: #22C55E;
  --toast-text: #E6F4EA;
  --placeholder-bg: #2A374E;
  --border-color: rgba(255, 255, 255, 0.05);
  --radius-pill: 9999px;
  --radius-lg: 20px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(22, 31, 48, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

.logo span {
  color: var(--accent);
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.btn {
  background: var(--accent);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-decoration: none;
}

.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(0, 136, 255, 0.3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: #1E293D;
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: none;
}

.btn-danger {
  background: #EF4444;
}

.btn-danger:hover {
  background: #DC2626;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-success {
  background: #22C55E;
}

.btn-success:hover {
  background: #16A34A;
  box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.tag-pill {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.tag-pill:hover {
  border-color: var(--accent);
  color: #FFFFFF;
}

main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.section-title {
  margin-bottom: 1.5rem;
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.back-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--radius-pill);
  transition: all 0.2s ease;
  display: none;
}

.back-btn:hover {
  background: var(--bg-modal);
  transform: translateX(-2px);
}

.albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
}

.album-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
}

.album-card:hover {
  transform: translateY(-4px);
  border-color: rgba(0, 136, 255, 0.3);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.album-cover {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--placeholder-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.album-info {
  padding: 1rem;
}

.album-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.3rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.photos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.8rem;
  display: none;
}

.photo-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: var(--placeholder-bg);
  border: 1px solid var(--border-color);
}

.photo-item img, .photo-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease, opacity 0.3s ease;
  opacity: 0;
}

.photo-item img.loaded, .photo-item video.loaded {
  opacity: 1;
}

.media-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 26px;
  height: 26px;
  border: 3px solid rgba(0, 136, 255, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spinRing 0.8s linear infinite;
  z-index: 2;
  pointer-events: none;
}

@keyframes spinRing {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.video-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #FFFFFF;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-pill);
  pointer-events: none;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 4;
}

input[type="checkbox"].photo-checkbox {
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: rgba(11, 15, 23, 0.75);
  backdrop-filter: blur(4px);
  cursor: pointer;
  outline: none;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="checkbox"].photo-checkbox::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #FFFFFF;
  opacity: 0;
  transform: scale(0);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

input[type="checkbox"].photo-checkbox:checked {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 136, 255, 0.5);
}

input[type="checkbox"].photo-checkbox:checked::after {
  opacity: 1;
  transform: scale(1);
}

input[type="checkbox"].photo-checkbox:hover {
  border-color: var(--accent);
  transform: scale(1.08);
}

.bulk-bar {
  position: fixed;
  bottom: 30px;
  right: 30px;
  background: var(--bg-modal);
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--accent);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  gap: 1rem;
  z-index: 90;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 200;
  padding: 1rem;
}

.modal-card {
  background: var(--bg-modal);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  padding: 1.5rem;
  position: relative;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1.2rem;
  color: var(--text-main);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dropzone {
  border: 2px dashed var(--accent);
  border-radius: var(--radius-md);
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--accent-alpha);
  margin-bottom: 1.2rem;
  transition: background 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
  background: rgba(0, 136, 255, 0.25);
}

.previews-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.preview-item {
  aspect-ratio: 1/1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--placeholder-bg);
  position: relative;
}

.preview-item img, .preview-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(239, 68, 68, 0.85);
  color: #FFFFFF;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: transform 0.15s ease;
}

.preview-remove:hover {
  transform: scale(1.15);
  background: #EF4444;
}

.upload-progress-box {
  display: none;
  background: var(--bg-card);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 1rem;
}

.progress-text {
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 0.6rem;
  display: flex;
  justify-content: space-between;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  border-radius: 9999px;
  transition: width 0.2s ease;
}

.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1rem;
  border: 1px solid var(--border-color);
}

.toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #334155;
  transition: 0.3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--accent);
}

input:checked + .slider:before {
  transform: translateX(20px);
}

.author-fields {
  display: none;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.author-fields.active {
  display: flex;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-group label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.input-field {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s;
}

.input-field:focus {
  border-color: var(--accent);
}

.captcha-container {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 1rem;
  background: var(--bg-card);
  padding: 0.8rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.captcha-img {
  background: #000;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  height: 40px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 1.2rem;
}

.toast {
  position: fixed;
  bottom: 30px;
  left: 30px;
  background: var(--toast-bg);
  color: var(--toast-text);
  border: 1px solid var(--toast-accent);
  border-left: 5px solid var(--toast-accent);
  padding: 1rem 1.5rem;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  transform: translateY(150%);
  transition: transform 0.3s ease-in-out;
  z-index: 300;
  max-width: 400px;
  font-size: 0.9rem;
  line-height: 1.4;
}

.toast.show {
  transform: translateY(0);
}

.lightbox-content {
  position: relative;
  max-width: 85vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  touch-action: none;
}

.lightbox-img-wrapper {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  max-width: 100%;
  max-height: 65vh;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-img-wrapper img, .lightbox-img-wrapper video {
  max-width: 100%;
  max-height: 65vh;
  display: block;
  border-radius: var(--radius-lg);
  transition: transform 0.15s ease-out;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-img-wrapper img {
  cursor: zoom-in;
}

.lightbox-footer {
  margin-top: 1rem;
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  padding: 0.8rem 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 1rem;
}

.author-badges {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
}

.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(15, 23, 42, 0.75);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.2s ease;
  z-index: 10;
}

.nav-arrow:hover {
  background: var(--accent);
  transform: translateY(-50%) scale(1.08);
}

.nav-prev {
  left: -55px;
}

.nav-next {
  right: -55px;
}

.faq-section {
  margin-top: 4rem;
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
}

.faq-item {
  background: var(--bg-modal);
  border-radius: var(--radius-lg);
  margin-bottom: 0.8rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.faq-question {
  font-weight: 600;
  color: var(--text-main);
  padding: 1.2rem 1.5rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: color 0.2s ease;
}

.faq-question:hover {
  color: var(--accent);
}

.faq-arrow {
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  transform: rotate(45deg);
  transition: transform 0.3s ease;
  margin-left: 15px;
  flex-shrink: 0;
}

.faq-item.active .faq-arrow {
  transform: rotate(-135deg);
}

.faq-answer-wrapper {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease-in-out, opacity 0.35s ease-in-out;
  opacity: 0;
  background: rgba(0, 0, 0, 0.15);
}

.faq-item.active .faq-answer-wrapper {
  max-height: 300px;
  opacity: 1;
}

.faq-answer {
  padding: 1rem 1.5rem 1.2rem 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

.footer {
  margin-top: auto;
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border-color);
  background: var(--bg-main);
}

.footer a {
  color: var(--accent);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

@media (max-width: 768px) {
  header {
    padding: 0.9rem 1rem;
  }
  .albums-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.9rem;
  }
  .photos-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 0.6rem;
  }
  .nav-prev {
    left: 8px;
  }
  .nav-next {
    right: 8px;
  }
  .bulk-bar {
    left: 15px;
    right: 15px;
    bottom: 15px;
    justify-content: space-between;
  }
  .toast {
    left: 15px;
    right: 15px;
    bottom: 15px;
    max-width: none;
  }
  .lightbox-footer {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
  .author-badges {
    justify-content: center;
  }
}
