:root {
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --bg-main: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-hover: #252525;
  --text-primary: #f5f5f5;
  --text-secondary: #a3a3a3;
  --border: #2a2a2a;
  --success: #10b981;
  --danger: #ef4444;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
}

/* Login */
.login-box {
  max-width: 420px;
  margin: 120px auto;
  background: var(--bg-card);
  padding: 48px 40px;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.login-box h1 {
  margin-bottom: 32px;
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

input {
  width: 100%;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 15px;
  transition: all 0.2s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  background: #161616;
}

button {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
  border-radius: 10px;
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

button:active {
  transform: translateY(0);
}

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

.header h1 {
  font-size: 32px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header button {
  width: auto;
  padding: 10px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.header button:hover {
  background: var(--bg-hover);
  transform: none;
  box-shadow: none;
}

/* Upload Zone */
.upload-zone {
  background: var(--bg-card);
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 64px 24px;
  text-align: center;
  margin-bottom: 32px;
  cursor: pointer;
  transition: all 0.3s;
}

.upload-zone:hover {
  border-color: var(--primary);
  background: #1c1c1c;
}

.upload-zone h2 {
  font-size: 20px;
  margin-bottom: 8px;
}

.upload-zone p {
  color: var(--text-secondary);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}

.tab {
  padding: 12px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 500;
}

.tab:hover {
  background: var(--bg-hover);
}

.tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: transparent;
}

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

.media-item {
  position: relative;
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s;
  border: 1px solid var(--border);
  aspect-ratio: 1;
}

.media-item:hover {
  transform: translateY(-4px);
}

.media-item img,
.media-item video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.delete-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  color: white;
  font-size: 20px;
  opacity: 0;
  transition: opacity 0.2s;
}

.media-item:hover .delete-btn {
  opacity: 1;
}

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

/* Progress */
.progress {
  margin-top: 24px;
  background: var(--bg-card);
  border-radius: 8px;
  overflow: hidden;
  display: none;
  height: 6px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  width: 0%;
  transition: width 0.3s;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.97);
  z-index: 10000;
  opacity: 0;
  transition: opacity 0.3s;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 1;
}

.modal-content {
  position: relative;
  max-width: 95vw;
  max-height: 95vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content img,
.modal-content video {
  max-width: 100%;
  max-height: 95vh;
  object-fit: contain;
  border-radius: 8px;
  user-select: none;
  transition: transform 0.3s ease-out;
  cursor: grab;
}

.modal-content img.grabbing {
  cursor: grabbing;
}

/* Navigation Arrows */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: white;
  font-size: 24px;
  z-index: 100;
  transition: all 0.2s;
  opacity: 0;
}

.modal.active .nav-arrow {
  opacity: 1;
}

.nav-arrow:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-50%) scale(1.1);
}

.nav-arrow.left {
  left: 20px;
}

.nav-arrow.right {
  right: 20px;
}

/* Photo Counter */
.photo-counter {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  padding: 8px 16px;
  border-radius: 20px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  z-index: 100;
}

/* Close Button */
.close-modal {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 28px;
  cursor: pointer;
  z-index: 100;
  transition: all 0.2s;
}

.close-modal:hover {
  background: var(--danger);
  transform: rotate(90deg);
}

/* Video Controls */
.video-controls {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  padding: 12px 20px;
  border-radius: 30px;
  display: flex;
  gap: 16px;
  align-items: center;
  z-index: 100;
  opacity: 0;
  transition: opacity 0.3s;
}

.modal.active .video-controls {
  opacity: 1;
}

.video-controls button {
  width: auto;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 13px;
}

.video-hint {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border-radius: 20px;
  color: white;
  font-size: 13px;
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

@media (max-width: 768px) {
  .container {
    padding: 16px;
  }
  
  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
  }
  
  .header h1 {
    font-size: 24px;
  }
  
  .nav-arrow {
    width: 48px;
    height: 48px;
    font-size: 20px;
  }
  
  .nav-arrow.left {
    left: 10px;
  }
  
  .nav-arrow.right {
    right: 10px;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal.active .modal-content {
  animation: fadeIn 0.3s ease-out;
}
