/* Base Styles */
html, body {
  height: 100%;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Main content area should grow */
.main-content {
  flex: 1 0 auto;
}

/* Navigation */
.navbar {
  background-color: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
  margin-bottom: 1rem;
}

.navbar-container {
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  height: 3.75rem;
}

.navbar-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.navbar-logo img {
  height: 2.5rem;
  width: auto;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-left: auto;
}

.nav-link {
  color: #333;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.3s;
}

.nav-link:hover {
  color: #007bff;
  text-decoration: none;
}

.navbar-username {
  color: #666;
  font-size: 0.875rem;
  font-weight: 500;
}

.logo-desktop {
  display: block;
}

.logo-mobile {
  display: none;
}

@media (max-width: 768px) {
  .logo-desktop {
    display: none;
  }

  .logo-mobile {
    display: block;
  }

  .navbar-container {
    padding: 0 0.625rem;
    height: 3.125rem;
  }

  .navbar-logo img {
    height: 2.1875rem;
  }

  .navbar-right {
    gap: 0.625rem;
  }

  .nav-link, .navbar-username {
    font-size: 0.75rem;
  }

  .nav-link[href="/manufacturers"] {
    display: none;
  }
}

/* Development Banner */
.development-banner {
  background-color: #ffedd5;
  border-bottom: 0.0625rem solid #fed7aa;
  padding: 0.75rem 0;
  width: 100%;
}

.development-message {
  margin: 0;
  text-align: center;
  color: #92400e;
  font-size: 0.875rem;
  line-height: 1.4;
}

.development-message strong {
  font-weight: 600;
}

@media (max-width: 768px) {
  .development-banner {
    padding: 0.625rem 0;
  }

  .development-message {
    font-size: 0.75rem;
  }
}

/* Container Components */
.container {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.content-box {
  background-color: white;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Typography */
h1, h2, h3 {
  margin-top: 0;
  color: #333;
}

h1 {
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: 1.5rem;
  margin-bottom: 0.9375rem;
}

h3 {
  font-size: 1.25rem;
  margin-bottom: 0.625rem;
}

p {
  line-height: 1.6;
  margin-bottom: 0.625rem;
}

/* Links */
a {
  color: #007bff;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.back-link {
  display: inline-block;
  margin: 1.25rem 0;
  color: #007bff;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

/* Text Utilities */
.text-muted {
  color: #666;
}

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

/* Spacing Utilities */
.mb-10 {
  margin-bottom: 0.625rem;
}

.mb-20 {
  margin-bottom: 1.25rem;
}

.mb-30 {
  margin-bottom: 1.875rem;
}

/* Page Specific Styles */

/* Base Page Styles */
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.25rem;
  box-sizing: border-box;
}

/* Mobile responsive padding */
@media (max-width: 768px) {
  .page {
    padding: 0.75rem;
  }
}

/* Page containers */
.page .container {
  max-width: 75rem;
  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Special layout for picture pages */
.picture-detail .container {
  max-width: 50rem;
}

/* Home Page Components */

.homepage-sections {
  margin-top: 1.875rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.photo-section, .members-section {
  background-color: white;
  padding: 1.875rem;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.photo-section h2, .members-section h2 {
  margin-bottom: 1.25rem;
  color: #333;
  font-size: 1.5rem;
  border-bottom: 2px solid #007bff;
  padding-bottom: 0.625rem;
}

.photo-card {
  background-color: #f9f9f9;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.photo-card img {
  width: 100%;
  height: 12.5rem;
  object-fit: cover;
  display: block;
}

.photo-card .photo-info {
  padding: 0.9375rem;
}

.photo-card .photo-title {
  font-weight: bold;
  margin-bottom: 0.5rem;
  color: #333;
  font-size: 0.875rem;
}

.photo-card .photo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #666;
}

.photo-card .likes {
  color: #e74c3c;
  font-weight: bold;
}

.photo-card .member a {
  color: #007bff;
  text-decoration: none;
}

.photo-card .member a:hover {
  text-decoration: underline;
}

.members-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  gap: 0.9375rem;
}

.member-card {
  background-color: #f9f9f9;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

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

.member-link {
  display: block;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  text-align: center;
}

.member-name {
  font-weight: bold;
  font-size: 1.125rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.member-stats {
  color: #666;
  font-size: 0.875rem;
}

.photo-info {
  background-color: #f9f9f9;
  padding: 1.875rem;
  border-radius: 8px;
  text-align: center;
  margin-top: 1.875rem;
}

.photo-number {
  font-size: 2.25rem;
  font-weight: bold;
  color: #007bff;
  margin-bottom: 0.625rem;
}

.view-photo-btn {
  display: inline-block;
  background-color: #007bff;
  color: white;
  padding: 0.75rem 1.875rem;
  border-radius: 5px;
  text-decoration: none;
  font-size: 1rem;
  transition: background-color 0.3s;
}

.view-photo-btn:hover {
  background-color: #0056b3;
  text-decoration: none;
}

.error {
  color: #dc3545;
  font-size: 1.125rem;
}

.error-message {
  background-color: #f8d7da;
  color: #721c24;
  padding: 0.9375rem;
  border-radius: 5px;
  border: 1px solid #f5c6cb;
  margin-top: 1.25rem;
}

/* Picture Page */
.photo-container {
  background-color: white;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.photo-image {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 1.25rem;
}

.photo-details {
  background-color: #f9f9f9;
  padding: 0.9375rem;
  border-radius: 4px;
  border-left: 4px solid #007bff;
}

.detail-item {
  margin-bottom: 0.625rem;
  display: flex;
  align-items: center;
}

.detail-label {
  font-weight: bold;
  min-width: 7.5rem;
  color: #666;
}

.detail-value {
  color: #333;
}

.member-link {
  color: #007bff;
  text-decoration: none;
}

.member-link:hover {
  text-decoration: underline;
}

/* Member Page */
.header {
  background-color: white;
  padding: 1.25rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.25rem;
}

.stats {
  color: #666;
  font-size: 1rem;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr));
  gap: 0.9375rem;
  margin-bottom: 1.875rem;
}

.photo-item {
  position: relative;
  width: 100%;
  padding-bottom: 100%; /* 1:1 Aspect Ratio */
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s;
}

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

.photo-link {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #f9f9f9;
}

.photo-link img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.no-photos {
  text-align: center;
  padding: 3.75rem 1.25rem;
  background-color: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  color: #666;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.625rem;
  margin-top: 1.875rem;
}

.pagination a,
.pagination span {
  display: inline-block;
  padding: 0.5rem 0.75rem;
  text-decoration: none;
  color: #333;
  background-color: white;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination a:hover {
  background-color: #007bff;
  color: white;
}

.pagination .current {
  background-color: #007bff;
  color: white;
}

.pagination .disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Responsive Design */
@media (max-width: 768px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(9.375rem, 1fr));
    gap: 0.625rem;
  }

  .members-grid {
    grid-template-columns: repeat(auto-fill, minmax(9.375rem, 1fr));
  }

  .homepage-sections {
    gap: 1.875rem;
  }

  .photo-section, .members-section {
    padding: 1.25rem;
  }

  body {
    padding: 0.625rem;
  }

  .container {
    padding: 0 0.625rem;
  }
}

@media (max-width: 480px) {
  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(6.25rem, 1fr));
    gap: 0.5rem;
  }

  .members-grid {
    grid-template-columns: 1fr;
  }

  .homepage-sections {
    gap: 1.25rem;
  }

  .photo-section, .members-section {
    padding: 0.9375rem;
  }

  .photo-card .photo-title {
    font-size: 0.75rem;
  }

  .photo-card .photo-meta {
    font-size: 0.625rem;
  }
}

/* Login Page */
.login-container {
  max-width: 25rem;
  margin: 3.125rem auto;
  background-color: white;
  padding: 1.875rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-container h1 {
  text-align: center;
  margin-bottom: 1.875rem;
  color: #333;
}

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

.form-group label {
  display: block;
  margin-bottom: 0.3125rem;
  font-weight: bold;
  color: #666;
}

.form-group input {
  width: 100%;
  padding: 0.625rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  box-sizing: border-box;
}

.form-group input:focus {
  outline: none;
  border-color: #007bff;
}

.btn-primary {
  width: 100%;
  padding: 0.75rem;
  background-color: #007bff;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.error-message {
  background-color: #f8d7da;
  color: #721c24;
  padding: 0.625rem;
  border-radius: 4px;
  border: 1px solid #f5c6cb;
  margin-bottom: 1.25rem;
  text-align: center;
}

/* Upload Page */
.upload-container {
  max-width: 48rem;
  margin: 2rem auto;
  padding: 0 1rem;
}

.upload-stage {
  background: white;
  border-radius: 0.5rem;
  padding: 2rem;
  box-shadow: 0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.1);
}

.upload-container .error-message {
  background: #fee;
  border: 0.0625rem solid #fcc;
  border-radius: 0.25rem;
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: #c53030;
  text-align: left;
}

.breadcrumb {
  margin-bottom: 1.5rem;
  color: #666;
  font-size: 0.875rem;
}

.breadcrumb a {
  color: #2563eb;
  text-decoration: none;
}

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

.manufacturer-section,
.model-section {
  margin-bottom: 2rem;
}

.manufacturer-section:last-child,
.model-section:last-child {
  margin-bottom: 0;
}

.manufacturer-grid,
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.manufacturer-card,
.model-card {
  display: block;
  padding: 1.5rem;
  border: 0.0625rem solid #e5e7eb;
  border-radius: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}

.manufacturer-card:hover,
.model-card:hover {
  border-color: #2563eb;
  box-shadow: 0 0.25rem 0.375rem rgba(0, 0, 0, 0.1);
  transform: translateY(-0.0625rem);
}

.manufacturer-name,
.model-name {
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.photo-count {
  color: #6b7280;
  font-size: 0.875rem;
}

.dropdown-form {
  margin-top: 1rem;
}

.dropdown-form select {
  width: 100%;
  padding: 0.75rem;
  border: 0.0625rem solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
  background: white;
}

.upload-form {
  max-width: 24rem;
  margin-top: 1.5rem;
}

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

.upload-form .form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: #374151;
}

.upload-form .form-group input {
  width: 100%;
  padding: 0.75rem;
  border: 0.0625rem solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 1rem;
}

.form-help {
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #6b7280;
}

.upload-button {
  background: #2563eb;
  color: white;
  border: none;
  padding: 0.75rem 2rem;
  border-radius: 0.375rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s;
}

.upload-button:hover {
  background: #1d4ed8;
}

@media (max-width: 48rem) {
  .manufacturer-grid,
  .model-grid {
    grid-template-columns: 1fr;
  }
}

/* Sticky Footer */
.site-footer {
  flex-shrink: 0;
  background-color: #f8f8f8;
  padding: 0.75rem 0;
  text-align: center;
  border-top: 0.0625rem solid #e0e0e0;
}

.copyright {
  font-size: 0.875rem;
  color: #999;
  margin: 0;
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .site-footer {
    padding: 0.5rem 0;
  }

  .copyright {
    font-size: 0.75rem;
  }
}
