/* Reuse CSS code from HW1 and HW2 with updates for HW3 */
body {
  font-family: 'Helvetica', 'Arial', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #1f2937;
  background: #f3f4f6;
  min-height: 100vh;
}

/* Header */
.header {
  background: linear-gradient(135deg, #87CEFA 0%, #00BFFF 100%);
  color: white;
  padding: 1rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header_title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-align: center;
}

.header_nav {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.nav_link {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 500;
  transition: all 0.3s;
}

.nav_link:hover {
  background-color: #3e84bd;
}

.nav_link--active {
  background-color: #237791;
  font-weight: 700;
}

/* Main Content */
.main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: calc(100vh - 200px);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s;
}

.btn--primary {
  background: linear-gradient(135deg, #87CEFA 0%, #00BFFF 100%);
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn--secondary {
  background: white;
  color: #374151;
  border: 2px solid #d1d5db;
}

.btn--secondary:hover {
  background: #f3f4f6;
  border-color: #9ca3af;
}

.btn--success {
  background: #10b981;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn--success:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn--danger {
  background: #ef4444;
  color: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn--danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn--small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

.btn--white {
  background-color: white;
  color: #00BFFF;
}

.btn--white:hover {
  background-color: #f3f4f6;
}

.btn--half {
  flex: 1;
}

/* Toggle Button */
.toggle-btn {
  background: #f59e0b;
  color: white;
  padding: 1rem 2rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 1rem;
  margin-bottom: 2rem;
}

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

.toggle-btn_text {
  margin-right: 0.5rem;
}

.toggle-btn_icon {
  font-size: 1.5rem;
  transition: transform 0.3s;
}

.toggle-btn:hover .toggle-btn_icon {
  transform: rotate(90deg);
}

/* Add Image Section */
.add-image-section {
  margin-bottom: 2rem;
}

.add-image-section--hidden {
  display: none;
}

/* Forms */
.add-form {
  background: white;
  padding: 2rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
  transition: all 0.3s;
}

.add-form--hidden {
  transform: translateY(-20px);
  opacity: 0;
  max-height: 0;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 700;
  color: #374151;
  font-size: 0.9rem;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 0.8rem 1rem;
  border: 2px solid #d1d5db;
  border-radius: 0.5rem;
  font-size: 1rem;
  transition: all 0.3s;
  background: white;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: #87CEFA;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-help {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.8rem;
  color: #6b7280;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

.form-actions--dual {
  justify-content: space-between;
}

.error-message {
  color: #ef4444;
  font-size: 0.9rem;
  margin: 1rem 0;
  padding: 0.8rem;
  background: #fee2e2;
  border-radius: 0.5rem;
  display: none;
}

/* Image Display */
.image-display {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
}

.image-display--hidden {
  display: none;
}

.image-container {
  position: relative;
  margin-bottom: 1.5rem;
  border-radius: 0.8rem;
  overflow: hidden;
}

.image-display_img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.image-container:hover .image-display_img {
  transform: scale(1.02);
}

.image-overlay {
  position: absolute;
  top: 1rem;
  right: 1rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.image-overlay--hidden {
  display: none;
}

.image-container:hover .image-overlay {
  opacity: 1;
}

.image-delete {
  background: #ef4444;
  border: none;
  padding: 0.5rem 0.8rem;
  border-radius: 0.5rem;
  color: white;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.image-delete:hover {
  background: #ef4444;
  transform: scale(1.05);
}

.image-info {
  text-align: center;
  margin-bottom: 1.5rem;
}

.image-info_title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 0.5rem;
}

.image-info_author {
  font-size: 1.1rem;
  color: #6b7280;
  font-style: italic;
}

.image-navigation {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.nav-btn {
  flex: 1;
  max-width: 200px;
  padding: 1rem 1.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 0.8rem;
  background: #e5e7eb;
  color: #374151;
  border: 2px solid #d1d5db;
  transition: all 0.3s;
}

.nav-btn:hover {
  background: linear-gradient(135deg, #a5b4fc 0%, #87CEFA 100%);
  color: white;
  border-color: #87CEFA;
  transform: translateY(-2px);
}

.nav-btn_icon {
  font-size: 1.3rem;
}

.nav-btn_text {
  font-weight: 700;
}

.image-counter {
  font-size: 1.1rem;
  font-weight: 700;
  color: #6b7280;
  padding: 0.5rem 1rem;
  background: #f3f4f6;
  border-radius: 0.5rem;
  min-width: 120px;
  text-align: center;
}

/* Comment Form Section */
.comment-form-section {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
}

.comment-form-section--hidden {
  display: none;
}

.section-title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1.5rem;
  text-align: center;
}

.comment-form {
  max-width: 600px;
  margin: 0 auto;
}

/* Comment Section */
.comment-section {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  margin-bottom: 2rem;
}

.comment-section--hidden {
  display: none;
}

.comment-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.comment-navigation {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.comment-counter {
  font-size: 1rem;
  font-weight: 700;
  color: #6b7280;
  padding: 0.5rem 0.8rem;
  background: #f3f4f6;
  border-radius: 0.4rem;
  min-width: 100px;
  text-align: center;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.comment {
  background: #f9fafb;
  padding: 1.5rem;
  border-radius: 0.8rem;
  border-left: 4px solid #87CEFA;
  transition: all 0.3s;
}

.comment:hover {
  transform: translateX(4px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  background: white;
}

.comment_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
  gap: 1rem;
}

.comment_author {
  font-weight: 700;
  color: #1f2937;
  font-size: 1rem;
  flex: 1;
}

.comment_date {
  font-size: 0.9rem;
  color: #6b7280;
  font-style: italic;
}

.comment_delete {
  background: #ef4444;
  color: white;
  border: none;
  padding: 0.3rem 0.5rem;
  border-radius: 0.3rem;
  font-size: 0.8rem;
  transition: all 0.3s;
  margin-left: 0.5rem;
}

.comment_delete:hover {
  background: #dc2626;
  transform: scale(1.05);
}

.comment_content {
  color: #374151;
  line-height: 1.6;
  font-size: 1rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 5rem 2rem;
  background: white;
  border-radius: 1rem;
}

.empty-state--hidden {
  display: none;
}

.empty-state_content {
  max-width: 400px;
  margin: 0 auto;
}

.empty-state_icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
}

.empty-state_title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
  margin-bottom: 1rem;
}

.empty-state_description {
  font-size: 1.1rem;
  color: #6b7280;
  line-height: 1.6;
}

/* Gallery Header */
.gallery-header {
  background: linear-gradient(135deg, #87CEFA 0%, #00BFFF 100%);
  color: white;
  padding: 2rem;
  margin-bottom: 1.5rem;
  border-radius: 1rem;
}

.gallery-header_top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.gallery-header_title {
  font-size: 1.9rem;
  font-weight: 700;
}

.gallery-header_actions {
  display: flex;
  gap: 0.8rem;
}

.gallery-header_info {
  font-size: 1.1rem;
}

/* Credits Page */
.credits-section {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  border-radius: 1rem;
  padding: 3rem;
}

.credits-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1f2937;
  text-align: center;
  margin-bottom: 3rem;
}

.credits-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.credits-group {
  border-bottom: 1px solid #e5e7eb;
  padding-bottom: 1.5rem;
}

.credits-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.credits-group_title {
  font-size: 1.3rem;
  font-weight: 700;
  color: #87CEFA;
  margin-bottom: 1rem;
}

.credits-list {
  list-style: none;
  padding: 0;
}

.credits-item {
  margin-bottom: 0.8rem;
  padding-left: 1rem;
  position: relative;
  color: #374151;
  line-height: 1.6;
}

.credits-item::before {
  content: '•';
  color: #87CEFA;
  font-weight: 700;
  position: absolute;
  left: 0;
}

.credits-item strong {
  color: #1f2937;
  font-weight: 700;
}

.credits-note {
  background: #f9fafb;
  padding: 1.5rem;
  border-radius: 0.8rem;
  border-left: 4px solid #87CEFA;
  font-style: italic;
  color: #374151;
  line-height: 1.7;
}

.credits-note p {
  margin-bottom: 0.8rem;
}

.credits-note p:last-child {
  margin-bottom: 0;
}

/* Auth Page */
.auth-container {
  max-width: 500px;
  margin: 0 auto;
  padding: 2rem;
}

.auth-card {
  background: white;
  border-radius: 1rem;
  padding: 2.5rem;
}

.auth-card_title {
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
  text-align: center;
  margin-bottom: 0.5rem;
}

.auth-card_subtitle {
  font-size: 1rem;
  color: #6b7280;
  text-align: center;
  margin-bottom: 2rem;
}

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

.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}
