/* Photo Gallery Styles - Modern Design */

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: linear-gradient(135deg, #3a9aff 0%, #6db5ff 100%);
  background-attachment: fixed;
  color: #333;
  line-height: 1.6;
  min-height: 100vh;
}

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

/* Header */
header {
  text-align: center;
  margin-bottom: 40px;
  padding: 40px 0;
  color: white;
}

header h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

header p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Section Styling */
section {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  padding: 35px;
  margin-bottom: 35px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

section h2 {
  font-size: 2rem;
  color: #2c3e50;
  margin-bottom: 25px;
  font-weight: 700;
  position: relative;
  padding-bottom: 15px;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #3a9aff 0%, #6db5ff 100%);
  border-radius: 2px;
}

/* Upload Section */
.upload-section {
  background: white;
  color: #2c3e50;
  border: 3px solid #3a9aff;
  box-shadow: 0 15px 35px rgba(58, 154, 255, 0.3);
}

.upload-section h2 {
  color: #3a9aff;
}

.upload-section h2::after {
  background: linear-gradient(90deg, #3a9aff 0%, #6db5ff 100%);
}

#upload-form {
  display: flex;
  gap: 15px;
  align-items: center;
  flex-wrap: wrap;
}

.file-input-wrapper {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 1;
  min-width: 250px;
}

input[type="file"] {
  display: none;
}

.file-label {
  background: white;
  color: #3a9aff;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.file-label:hover {
  background: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.file-name {
  color: #2c3e50;
  font-size: 0.95rem;
  font-weight: 500;
}

/* Buttons */
.btn {
  padding: 12px 28px;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

.btn-primary {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #0e8074 0%, #2dd46b 100%);
}

.btn-secondary {
  background: linear-gradient(135deg, #bdc3c7 0%, #95a5a6 100%);
  color: white;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
}

.btn-danger {
  background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
  color: white;
}

.btn-danger:hover {
  background: linear-gradient(135deg, #d62839 0%, #e04a3a 100%);
}

/* Status Messages */
.status-message {
  margin-top: 20px;
  padding: 15px 20px;
  border-radius: 8px;
  display: none;
  font-weight: 500;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.status-message.success {
  background: #d4edda;
  color: #155724;
  border-left: 4px solid #28a745;
  display: block;
}

.status-message.error {
  background: #f8d7da;
  color: #721c24;
  border-left: 4px solid #dc3545;
  display: block;
}

.status-message.info {
  background: #d1ecf1;
  color: #0c5460;
  border-left: 4px solid #17a2b8;
  display: block;
}

/* Filter Section */
.filter-controls {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 150px;
}

.filter-group label {
  font-weight: 600;
  color: #555;
  font-size: 0.9rem;
}

.filter-group input {
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.filter-group input:focus {
  outline: none;
  border-color: #3a9aff;
  box-shadow: 0 0 0 3px rgba(58, 154, 255, 0.1);
}

/* Gallery Grid */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
  margin-top: 25px;
}

.photo-card {
  background: white;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  cursor: pointer;
  border: 2px solid transparent;
}

.photo-card:hover {
  transform: translateY(-12px) scale(1.02);
  box-shadow: 0 20px 40px rgba(58, 154, 255, 0.3);
  border-color: #3a9aff;
}

.photo-card img {
  width: 100%;
  height: 280px;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.photo-card:hover img {
  transform: scale(1.1);
}

.photo-info {
  padding: 20px;
  background: linear-gradient(to bottom, white 0%, #f8f9fa 100%);
}

.photo-info h3 {
  font-size: 1.1rem;
  color: #2c3e50;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
}

.photo-info p {
  font-size: 0.9rem;
  color: #7f8c8d;
  margin-bottom: 15px;
}

.photo-actions {
  display: flex;
  gap: 12px;
}

.photo-actions button {
  flex: 1;
  padding: 12px;
  font-size: 0.95rem;
  border-radius: 10px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  overflow: auto;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

.modal-content {
  position: relative;
  background-color: white;
  margin: auto;
  padding: 0;
  max-width: 90%;
  max-height: 90vh;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
  from {
    transform: scale(0.9);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8);
  transition: all 0.3s ease;
}

.close:hover {
  color: #f1f1f1;
  transform: rotate(90deg);
}

#modal-image {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  background: #000;
}

.modal-info {
  padding: 25px;
}

.modal-info h3 {
  font-size: 1.4rem;
  color: #2c3e50;
  margin-bottom: 12px;
  font-weight: 600;
}

.modal-info p {
  color: #7f8c8d;
  margin-bottom: 10px;
  font-size: 0.95rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  header h1 {
    font-size: 2.2rem;
  }

  header p {
    font-size: 1rem;
  }

  section {
    padding: 20px;
  }

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

  .photo-card img {
    height: 180px;
  }

  #upload-form {
    flex-direction: column;
    align-items: stretch;
  }

  .file-input-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-controls {
    flex-direction: column;
  }

  .modal-content {
    max-width: 95%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 10px;
  }

  header {
    padding: 30px 0;
  }

  header h1 {
    font-size: 1.8rem;
  }

  section {
    padding: 20px 15px;
    border-radius: 12px;
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .photo-card img {
    height: 200px;
  }
}
