/* CSS Custom Variables for Color Palette and Typography */
:root {
  --color-bg-primary: #FAF7F2;      /* Elegant Soft Champagne Warm Cream */
  --color-bg-card: rgba(255, 255, 255, 0.75);
  --color-gold-light: #dfcbaf;
  --color-gold: #bfa075;            /* Classic Wedding Gold */
  --color-gold-dark: #9e825a;
  --color-text-dark: #3a3630;       /* Warm Charcoal */
  --color-text-muted: #736b60;      /* Warm Muted Grey */
  --color-border: rgba(191, 160, 117, 0.25);
  --color-success: #6e8b75;         /* Sage Green */
  --color-error: #b85c5c;           /* Antique Red */
  
  --font-serif: 'Cormorant Garamond', serif;
  --font-sans: 'Inter', sans-serif;
  --shadow-sm: 0 4px 6px -1px rgba(191, 160, 117, 0.08), 0 2px 4px -1px rgba(191, 160, 117, 0.04);
  --shadow-md: 0 10px 15px -3px rgba(191, 160, 117, 0.1), 0 4px 6px -2px rgba(191, 160, 117, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(191, 160, 117, 0.15), 0 10px 10px -5px rgba(191, 160, 117, 0.08);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

/* Global Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(243, 237, 226, 0.6) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(243, 237, 226, 0.6) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--color-text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* Container */
.app-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 40px;
  animation: fadeInDown 1s ease-out;
}

.logo-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 1px solid var(--color-gold-light);
  background: white;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.monogram {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 300;
  color: var(--color-gold);
  letter-spacing: 1px;
}

.header-divider {
  width: 60px;
  height: 1px;
  background-color: var(--color-gold-light);
  margin: 0 auto 20px;
}

.header-subtitle {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-style: italic;
  color: var(--color-text-muted);
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}

.couple-names {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 400;
  color: var(--color-text-dark);
  letter-spacing: 2px;
  line-height: 1.2;
  margin-bottom: 12px;
  text-shadow: 1px 1px 0px rgba(255, 255, 255, 0.8);
}

.wedding-date {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 300;
  color: var(--color-gold-dark);
  letter-spacing: 3px;
}

/* Main Area */
.app-main {
  flex: 1;
}

/* Cards & Sections */
.upload-section {
  margin-bottom: 48px;
  animation: fadeInUp 1s ease-out 0.2s both;
}

.upload-card {
  background: var(--color-bg-card);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.upload-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.upload-description {
  font-size: 1rem;
  color: var(--color-text-muted);
  margin-bottom: 24px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 16px 32px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-gold) 0%, var(--color-gold-dark) 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(191, 160, 117, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(191, 160, 117, 0.6);
  background: linear-gradient(135deg, var(--color-gold-dark) 0%, var(--color-gold) 100%);
}

.btn-primary:active {
  transform: translateY(1px);
  box-shadow: 0 2px 10px rgba(191, 160, 117, 0.4);
}

.icon {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.btn-primary:hover .icon {
  transform: translateY(-2px);
}

/* Upload Progress & Status */
.upload-status-container {
  margin-top: 24px;
  text-align: left;
  background: rgba(255, 255, 255, 0.6);
  padding: 16px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--color-gold-light);
  animation: fadeIn 0.3s ease-in-out;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.05);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 10px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--color-gold-light) 0%, var(--color-gold) 100%);
  border-radius: 3px;
  transition: width 0.1s ease-out;
}

.status-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--color-text-muted);
}

/* Gallery Section */
.gallery-section {
  margin-top: 20px;
  animation: fadeInUp 1s ease-out 0.4s both;
}

.section-title-wrapper {
  text-align: center;
  margin-bottom: 32px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: 1px;
  color: var(--color-text-dark);
}

.title-underline {
  width: 40px;
  height: 1px;
  background: var(--color-gold);
  margin: 12px auto 0;
}

/* Grid Layout */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .couple-names {
    font-size: 2.25rem;
  }
  
  .btn-large {
    width: 100%;
  }
}

/* Media Card Item */
.media-card {
  position: relative;
  aspect-ratio: 1;
  background: #f0ebe4;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.4);
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  animation: scaleUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.media-card:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}

.media-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}

.media-card:hover .video-overlay {
  background: rgba(0, 0, 0, 0.15);
}

.play-button-icon {
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, background 0.3s ease;
}

.play-button-icon svg {
  width: 20px;
  height: 20px;
  fill: var(--color-text-dark);
  margin-left: 2px; /* Center-adjust the play triangle */
}

.media-card:hover .play-button-icon {
  transform: scale(1.1);
  background: white;
}

/* Spinner and Loader */
.gallery-loader {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 0;
  color: var(--color-text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(191, 160, 117, 0.15);
  border-top-color: var(--color-gold);
  border-radius: 50%;
  animation: spin 1s infinite linear;
  margin: 0 auto 16px;
}

.empty-gallery-msg {
  text-align: center;
  padding: 60px 24px;
  color: var(--color-text-muted);
  background: rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-md);
  border: 1px dashed var(--color-gold-light);
  max-width: 500px;
  margin: 0 auto;
}

.empty-icon {
  width: 60px;
  height: 60px;
  color: var(--color-gold-light);
  margin-bottom: 16px;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(18, 16, 14, 0.95); /* Deep elegant dark */
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease;
}

.lightbox-close-btn {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1010;
}

.lightbox-close-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.lightbox-close-btn svg {
  width: 24px;
  height: 24px;
}

.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1010;
  outline: none;
}

.lightbox-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.lightbox-nav-btn svg {
  width: 28px;
  height: 28px;
}

.prev-btn {
  left: 24px;
}

.next-btn {
  right: 24px;
}

@media (max-width: 768px) {
  .lightbox-nav-btn {
    width: 44px;
    height: 44px;
  }
  .lightbox-nav-btn svg {
    width: 22px;
    height: 22px;
  }
  .prev-btn {
    left: 12px;
  }
  .next-btn {
    right: 12px;
  }
}

.lightbox-content-wrapper {
  max-width: 90%;
  max-height: 85%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-media-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.lightbox-media-container img,
.lightbox-media-container video {
  max-width: 100%;
  max-height: 85vh;
  border-radius: var(--radius-sm);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

/* Footer Section */
.app-footer {
  text-align: center;
  padding: 40px 0 20px;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  border-top: 1px solid rgba(191, 160, 117, 0.1);
  margin-top: 60px;
}

/* Animations */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleUp {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Utility classes */
.hidden {
  display: none !important;
}

.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Placeholder for Non-displayable Files */
.media-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: linear-gradient(135deg, #fbfaf8 0%, #ede6db 100%);
  color: var(--color-text-dark);
  text-align: center;
}

.placeholder-icon {
  position: relative;
  margin-top: 15px;
  color: var(--color-gold);
}

.placeholder-icon svg {
  width: 50px;
  height: 50px;
}

.file-ext-badge {
  position: absolute;
  bottom: 0;
  right: -5px;
  background: var(--color-gold-dark);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
}

.placeholder-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.placeholder-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--color-text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  display: block;
}

.placeholder-download-btn {
  font-size: 0.75rem;
  color: var(--color-gold-dark);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Lightbox Other File Details Card */
.lightbox-other-file {
  background: rgba(255, 255, 255, 0.95);
  padding: 40px;
  border-radius: var(--radius-md);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
  max-width: 420px;
  width: 90%;
  animation: zoomIn 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  color: var(--color-text-dark);
}

.file-card-icon {
  position: relative;
  display: inline-block;
  color: var(--color-gold);
  margin-bottom: 20px;
}

.file-card-icon svg {
  width: 80px;
  height: 80px;
}

.file-card-badge {
  position: absolute;
  bottom: 5px;
  right: -5px;
  background: var(--color-gold-dark);
  color: white;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  text-transform: uppercase;
}

.file-card-title {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 12px;
  word-break: break-all;
}

.file-card-desc {
  font-size: 0.9rem;
  color: var(--color-text-muted);
  margin-bottom: 30px;
}

.file-download-btn {
  width: 100%;
  display: flex !important;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
