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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  min-height: 100vh;
}

a { color: #4f46e5; text-decoration: none; }
a:hover { text-decoration: underline; }

.navbar {
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.25rem;
  font-weight: 700;
  color: #4f46e5;
}
.logo:hover { text-decoration: none; }

.nav-links { display: flex; align-items: center; gap: 1.25rem; }
.nav-links a { color: #555; font-size: 0.95rem; }
.nav-links a:hover { color: #4f46e5; }
.nav-user { color: #888; font-size: 0.9rem; }

.container {
  max-width: 960px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: background 0.2s;
}
.btn:hover { text-decoration: none; }

.btn-primary { background: #4f46e5; color: #fff; }
.btn-primary:hover { background: #4338ca; }

.btn-secondary { background: #e5e5e5; color: #333; }
.btn-secondary:hover { background: #d4d4d4; }

.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-sm { padding: 0.3rem 0.75rem; font-size: 0.8rem; }

.btn-github {
  display: block;
  padding: 0.6rem 1.5rem;
  background: #fff;
  color: #333;
  border: 1px solid #ddd;
  border-radius: 6px;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  transition: background 0.2s;
}
.btn-github:hover { background: #f9fafb; text-decoration: none; }

/* Hero */
.hero {
  text-align: center;
  padding: 6rem 1rem;
}
.hero h1 { font-size: 2.5rem; margin-bottom: 0.75rem; color: #111; }
.hero p { font-size: 1.15rem; color: #666; margin-bottom: 2rem; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; }

/* Auth pages */
.auth-page {
  max-width: 400px;
  margin: 3rem auto;
  background: #fff;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.auth-page h1 { margin-bottom: 1.5rem; font-size: 1.5rem; }

.auth-form { display: flex; flex-direction: column; gap: 0.5rem; }
.auth-form label { font-size: 0.9rem; font-weight: 500; margin-top: 0.5rem; }
.auth-form input {
  padding: 0.6rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.95rem;
}
.auth-form input:focus { outline: none; border-color: #4f46e5; box-shadow: 0 0 0 2px rgba(79,70,229,0.15); }
.auth-form .btn { margin-top: 1rem; }

.divider {
  display: flex;
  align-items: center;
  margin: 1.25rem 0;
  color: #aaa;
  font-size: 0.85rem;
}
.divider::before, .divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid #e5e5e5;
}
.divider span { padding: 0 0.75rem; }

.auth-switch { margin-top: 1.25rem; font-size: 0.9rem; text-align: center; color: #666; }

/* Alerts */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}
.alert-error { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; }

/* Gallery */
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.gallery-header h1 { font-size: 1.5rem; }

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

.gallery-item {
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: box-shadow 0.2s;
}
.gallery-item:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.12); }

.gallery-img-wrapper {
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  background: #f5f5f5;
}
.gallery-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item-info {
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.gallery-item-name {
  font-size: 0.8rem;
  color: #666;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.delete-form { flex-shrink: 0; }

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: #888;
}
.empty-state p { margin-bottom: 1.5rem; font-size: 1.1rem; }

/* Upload */
.upload-page { max-width: 500px; margin: 2rem auto; }
.upload-page h1 { margin-bottom: 1.5rem; font-size: 1.5rem; }

.upload-form { display: flex; flex-direction: column; gap: 1rem; }

.upload-area {
  border: 2px dashed #d4d4d4;
  border-radius: 10px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.upload-area:hover, .upload-area.dragover {
  border-color: #4f46e5;
  background: #f5f3ff;
}
.upload-area p { color: #666; }
.upload-hint { font-size: 0.8rem; color: #aaa; margin-top: 0.5rem; }
.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-preview {
  text-align: center;
  padding: 1rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.upload-preview img { max-width: 100%; max-height: 300px; border-radius: 6px; }
.upload-preview p { margin-top: 0.5rem; font-size: 0.85rem; color: #666; }

@media (max-width: 600px) {
  .navbar { padding: 0 1rem; }
  .hero h1 { font-size: 1.75rem; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}
