/* 
 * Photo Gallery Stylesheet
 * Dark theme design for all gallery pages
 */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #1a1a1a;
  color: #e0e0e0;
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* Header styles */
header {
  text-align: center;
  margin-bottom: 40px;
}

h1 {
  color: #97c0d5;
  font-size: 2.5rem;
  letter-spacing: 7px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

h2 {
  color: #97c0d5;
  letter-spacing: 3px;
}

.header-logo {
  width: 1em;
  height: 1em;
  vertical-align: middle;
}

a {
  color: #fff;
}

/* Search form styles */
.search-form {
  margin-bottom: 30px;
  text-align: center;
}

.search-input {
  background-color: #2a2a2a;
  border: 1px solid #404040;
  color: #e0e0e0;
  padding: 12px 20px;
  border-radius: 25px;
  width: 375px;
  max-width: 100%;
  font-size: 16px;
}

.search-input:focus {
  outline: none;
  border-color: #97c0d5;
}

.search-btn {
  background-color: #97c0d5;
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 25px;
  margin-left: 10px;
  cursor: pointer;
  font-size: 16px;
}

.search-btn:hover {
  background-color: #005a9e;
}

/* About section styles */
.about-section {
  text-align: left;
  margin: 20px 0;
  padding: 15px;
  background-color: #2a2a2a;
  border-radius: 10px;
}

.about-section p {
  color: #ccc;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0;
}

/* Photo grid styles */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.photo-item {
  background-color: #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.photo-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.photo-item img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: contain;
  display: block;
}

.photo-info {
  padding: 15px;
}

.photo-description {
  font-size: 0.8rem;
  color: #ccc;
}

.photo-badges {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.badge {
  background-color: #85cf86;
  color: white;
  padding: 3px 8px;
  border-radius: 5px;
  font-size: 0.8rem;
}

/* Downloads badge specific styling */
.badge.badge-downloads {
  background-color: #97c0d5;
}

/* Pagination styles */
.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 40px;
}

.pagination a,
.pagination span {
  padding: 10px 15px;
  background-color: #2a2a2a;
  color: #e0e0e0;
  text-decoration: none;
  border-radius: 5px;
  border: 1px solid #404040;
}

.pagination a:hover {
  background-color: #97c0d5;
}

.pagination .current {
  background-color: #97c0d5;
  color: white;
}

/* Statistics and footer styles */
.stats {
  text-align: center;
  margin: 40px 0;
  padding: 20px;
  background-color: #2a2a2a;
  border-radius: 10px;
}

.stats h3 {
  margin-bottom: 15px;
  color: #fff;
}

.stat-item {
  display: inline-block;
  margin: 0 20px;
  font-size: 1.1rem;
}

.stat-number {
  font-weight: bold;
  color: #97c0d5;
}

footer {
  text-align: center;
  padding: 20px;
  color: #999;
  border-top: 1px solid #404040;
}

/* No results message */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #999;
  font-size: 1.1rem;
}

/* Navigation links styling */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* VIEW.PHP SPECIFIC STYLES */

/* Container for individual photo view */
.photo-view-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

/* Navigation bar */
.nav-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding: 15px 0;
  border-bottom: 1px solid #404040;
}

.nav-back {
  background-color: #97c0d5;
  color: white;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 5px;
  transition: background-color 0.3s;
}

.nav-back:hover {
  background-color: #005a9e;
}

.nav-buttons {
  display: flex;
  gap: 10px;
}

.nav-button {
  background-color: #2a2a2a;
  color: #e0e0e0;
  text-decoration: none;
  padding: 10px 15px;
  border-radius: 5px;
  border: 1px solid #404040;
  transition: background-color 0.3s;
}

.nav-button:hover {
  background-color: #97c0d5;
}

.nav-button.disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Main content layout */
.photo-content {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 30px;
  margin-bottom: 30px;
}

.photo-main {
  display: flex;
  flex-direction: column;
}

/* Photo display */
.photo-container {
  background-color: #2a2a2a;
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  margin-bottom: 20px;
}

.photo-image {
  max-width: 100%;
  max-height: 70vh;
  border-radius: 5px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.photo-filename {
  margin-top: 15px;
  font-weight: bold;
  color: #e1e1e1;
}

/* Download buttons */
.download-section {
  background-color: #2a2a2a;
  border-radius: 10px;
  padding: 20px;
}

.download-title {
  color: #fff;
  margin-bottom: 15px;
}

.download-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.download-btn {
  background-color: #97c0d5;
  color: white;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 0.8rem;
  transition: background-color 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.download-btn:hover {
  background-color: #0b94d9;
}

.download-btn.raw {
  background-color: #ff9955;
}

.download-btn.raw:hover {
  background-color: #ff6d0b;
}

.download-info {
  margin-top: 15px;
  font-size: 0.8rem;
  color: #999;
}

/* Sidebar */
.photo-sidebar {
  background-color: #2a2a2a;
  border-radius: 10px;
  padding: 20px;
  height: fit-content;
}

.sidebar-section {
  margin-bottom: 30px;
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

.sidebar-title {
  color: #fff;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #404040;
}

/* EXIF data table */
.exif-table {
  width: 100%;
}

.exif-table tr {
  border-bottom: 1px solid #333;
}

.exif-table tr:last-child {
  border-bottom: none;
}

.exif-table td {
  padding: 8px 0;
  vertical-align: top;
}

.exif-label {
  font-weight: bold;
  color: #ccc;
  width: 40%;
  font-size: 0.8rem;
}

.exif-value {
  color: #fff;
  word-break: break-word;
  font-size: 0.8rem;
}

/* Statistics */
.stats-item {
  font-size: 0.8rem;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 5px 0;
}

.stats-label {
  color: #ccc;
}

.stats-value {
  color: #97c0d5;
  font-weight: bold;
}

/* Donate section styles */
.donate-section {
  text-align: center;
}

.donate-section p {
  margin-bottom: 15px;
  color: #ccc;
  font-size: 0.8rem;
}

.donate-btn {
  background-color: #28a745;
  color: white;
  text-decoration: none;
  padding: 12px 20px;
  border-radius: 5px;
  font-weight: bold;
  font-size: 0.8rem;
  display: inline-block;
  transition: background-color 0.3s;
}

.donate-btn:hover {
  background-color: #218838;
}

/* Support section styles (in main content area) */
.support-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #404040;
}

.support-title {
  color: #fff;
  margin-bottom: 15px;
}

/* Loading animation */
.loading {
  text-align: center;
  color: #999;
  padding: 40px;
}

/* Image loading placeholder */
.photo-image[src=""] {
  background: #333;
  min-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-image[src=""]:before {
  content: "Loading image...";
  color: #999;
}

/* CATALOG.PHP SPECIFIC STYLES */

.catalog-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.catalog-table th {
  background-color: #2a2a2a;
  color: #97c0d5;
  padding: 12px;
  text-align: left;
  border-bottom: 2px solid #404040;
  font-weight: bold;
}

.catalog-table td {
  padding: 12px;
  border-bottom: 1px solid #333;
  vertical-align: top;
}

.catalog-table tr:hover {
  background-color: #333;
}

.description-cell {
  max-width: 350px;
}

.downloads-cell {
  min-width: 120px;
}

.download-count {
  font-weight: 500;
  margin-bottom: 3px;
  line-height: 1.4;
  color: #e0e0e0;
  font-size: 14px;
}

.photo-description {
  font-weight: 500;
  margin-bottom: 5px;
  line-height: 1.4;
  color: #e0e0e0;
}

.photo-filename {
  font-size: 12px;
  color: #999;
  font-family: monospace;
}


.no-raw {
  color: #999;
  font-style: italic;
}

.view-link {
  background-color: #97c0d5;
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 4px;
  font-size: 0.8rem;
  display: inline-block;
  transition: background-color 0.3s;
}

.view-link:hover {
  background-color: #005a9e;
}

.catalog-header {
  text-align: center;
  margin: 20px 0;
  color: #e0e0e0;
}

.back-link {
  display: inline-block;
  margin: 20px 0;
  color: #97c0d5;
  text-decoration: none;
  transition: color 0.3s;
}

.back-link:hover {
  color: #005a9e;
  text-decoration: underline;
}

/* Filter form styles */
.filter-form {
  margin-top: 15px;
  margin-bottom: 15px;
}

.filter-form label {
  color: #ccc;
  margin-right: 10px;
}

.filter-form input[type="text"] {
  background-color: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #404040;
  padding: 5px;
  border-radius: 4px;
  width: 200px;
}

.filter-form button {
  background-color: #404040;
  color: #e0e0e0;
  border: 1px solid #555;
  padding: 5px 15px;
  border-radius: 4px;
  cursor: pointer;
  margin-left: 5px;
}

.filter-form button:hover {
  background-color: #555;
}

.filter-form a {
  color: #888;
  margin-left: 10px;
  text-decoration: none;
}

.filter-form a:hover {
  color: #ccc;
}

/* Per page selector styles */
.per-page-form {
  margin-top: 15px;
}

.per-page-form label {
  color: #ccc;
  margin-right: 10px;
}

.per-page-form select {
  background-color: #2a2a2a;
  color: #e0e0e0;
  border: 1px solid #404040;
  padding: 5px;
  border-radius: 4px;
}

.per-page-form select:hover {
  border-color: #97c0d5;
}

/* RESPONSIVE DESIGN */

@media (max-width: 1024px) {
  .photo-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {

  .photo-view-container {
    padding: 15px;
  }

  h1 {
    font-size: 2rem;
  }

  .photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }

  .search-input {
    width: 250px;
  }

  .search-btn {
    margin-left: 5px;
    margin-top: 10px;
  }

  .stat-item {
    display: block;
    margin: 10px 0;
  }

  .nav-bar {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }

  .nav-buttons {
    order: -1;
  }

  .photo-container {
    padding: 15px;
  }

  .photo-image {
    max-height: 50vh;
  }

  .download-buttons {
    flex-direction: column;
  }

  .download-btn {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .photo-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .search-input {
    width: 100%;
    margin-bottom: 10px;
  }

  .search-btn {
    width: 100%;
    margin-left: 0;
  }

  .exif-table td {
    display: block;
    width: 100%;
  }

  .exif-label {
    width: 100%;
    font-size: 0.9rem;
    margin-bottom: 2px;
  }

  .exif-value {
    margin-bottom: 10px;
    padding-left: 10px;
  }

  /* Ensure badges wrap on small screens */
  .photo-badges {
    flex-wrap: wrap;
    gap: 5px;
  }

  /* Navigation links mobile styling */
  .nav-links {
    flex-direction: column;
    gap: 10px;
    align-items: center;
  }
  
  .nav-links .view-link {
    width: 200px;
    text-align: center;
  }
}

/* STATS.PHP SPECIFIC STYLES */

/* Stats page specific styling */
.stats-page .container {
  max-width: 1400px;
}

.stats-page header {
  text-align: center;
  margin-bottom: 40px;
  padding: 30px;
  background-color: #2a2a2a;
  border-radius: 10px;
}

.stats-page header h1 {
  color: #97c0d5;
  font-size: 2.5rem;
  margin-bottom: 10px;
  letter-spacing: 7px;
}

.stats-page header p {
  color: #ccc;
  font-size: 1.1rem;
}

/* Stats overview cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin: 40px 0;
}

.stat-card {
  background-color: #2a2a2a;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #97c0d5;
  display: block;
}

.stat-label {
  color: #ccc;
  margin-top: 5px;
  font-size: 0.9rem;
}

/* Charts styling */
.charts-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
  margin: 40px 0;
}

.chart-card {
  background-color: #2a2a2a;
  padding: 25px;
  border-radius: 10px;
}

.chart-title {
  color: #97c0d5;
  margin-bottom: 20px;
  text-align: center;
  font-size: 1.3rem;
}

.chart-container {
  position: relative;
  height: 300px;
  margin-bottom: 20px;
}

/* Top 5 section */
.top5-section {
  margin-top: 40px;
}

.top5-title {
  text-align: center;
  color: #97c0d5;
  margin-bottom: 30px;
  font-size: 2rem;
}

.top5-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 30px;
}

.top5-card {
  background-color: #2a2a2a;
  padding: 25px;
  border-radius: 10px;
}

.top5-card h3 {
  color: #97c0d5;
  margin-bottom: 20px;
  text-align: center;
  font-size: 1.3rem;
}

.top5-list {
  list-style: none;
}

.top5-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #404040;
}

.top5-item:last-child {
  border-bottom: none;
}

.rank {
  background: #97c0d5;
  color: white;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.8rem;
}

.value {
  font-weight: 600;
  color: #e0e0e0;
}

.count {
  background: rgba(151, 192, 213, 0.2);
  color: #e0e0e0;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.9rem;
  font-weight: 500;
}

.no-data {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

/* DELETE BUTTON AND MODAL STYLES */

/* Actions cell styling for proper button alignment */
.actions-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.delete-btn {
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 11px 19px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: background-color 0.3s;
  flex-shrink: 0;
}

.delete-btn:hover {
  background-color: #c82333;
}

/* Modal styles */
.modal {
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #2a2a2a;
  padding: 30px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  position: relative;
  border: 1px solid #404040;
}

.close {
  position: absolute;
  top: 15px;
  right: 20px;
  color: #999;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
}

.close:hover {
  color: #fff;
}

.modal-content h3 {
  color: #fff;
  margin-bottom: 20px;
  text-align: center;
}

.modal-content input[type="password"] {
  width: 100%;
  padding: 12px;
  background-color: #1a1a1a;
  border: 1px solid #404040;
  color: #e0e0e0;
  border-radius: 5px;
  margin-bottom: 15px;
  font-size: 16px;
}

.modal-content input[type="password"]:focus {
  outline: none;
  border-color: #97c0d5;
}

.modal-content button[type="submit"] {
  width: 100%;
  background-color: #dc3545;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 5px;
  font-size: 16px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.modal-content button[type="submit"]:hover {
  background-color: #c82333;
}

/* Responsive modal */
@media (max-width: 480px) {
  .modal-content {
    width: 95%;
    padding: 20px;
  }
  
  /* Mobile view button adjustments - stack vertically */
  .actions-cell {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }
  
  .view-link,
  .delete-btn {
    padding: 8px 12px;
    font-size: 12px;
    text-align: center;
    min-height: 32px;
  }
  
  /* Ensure buttons are properly aligned in mobile view */
  .view-link {
    display: flex;
    align-items: center;
    justify-content: center;
  }
}
