@import url(https://fonts.googleapis.com/css?family=Montserrat:500);/*

All grid code is placed in a 'supports' rule (feature query) at the bottom of the CSS (Line 77). 

The 'supports' rule will only run if your browser supports CSS grid.

Flexbox is used as a fallback so that browsers which don't support grid will still recieve an identical layout.

*/

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

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background-color: #f8fafc;
  color: #334155;
  line-height: 1.5;
}

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

.header {
  margin-bottom: 30px;
  text-align: center;
}

.header .logo {
  font-size: 2.5rem;
  font-weight: 700;
  background: linear-gradient(#6366f1, #4f46e5);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 20px;
  animation: fadeInDown 0.8s ease-out;
}

.upload-area {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 2px dashed #e2e8f0;
  padding: 40px 20px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.upload-area:hover {
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.upload-area:hover .upload-icon {
  transform: scale(1.1);
  color: #6366f1;
}

.upload-area.dragover {
  border-color: #6366f1;
  background-color: rgba(99, 102, 241, 0.05);
}

.upload-area.dragover .upload-content {
  transform: scale(0.95);
}

.upload-area input[type=file] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-area .upload-content {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-area .upload-content .upload-icon {
  margin-bottom: 15px;
  color: #64748b;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-area .upload-content p {
  color: #64748b;
  font-size: 1.1rem;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  flex-wrap: wrap;
  gap: 15px;
  animation: fadeIn 0.6s ease-out 0.2s both;
}

.toolbar .search-bar {
  flex: 1;
  min-width: 250px;
}

.toolbar .search-bar input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toolbar .search-bar input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.toolbar .filter-options {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.toolbar .filter-options .filter-btn {
  padding: 10px 20px;
  background-color: transparent;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toolbar .filter-options .filter-btn:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.toolbar .filter-options .filter-btn.active {
  background-color: #6366f1;
  border-color: #6366f1;
  color: white;
}

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

.image-grid .image-card {
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  animation: fadeInUp 0.5s ease-out;
}

.image-grid .image-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.image-grid .image-card:hover .image-overlay {
  opacity: 1;
}

.image-grid .image-card:hover img {
  transform: scale(1.05);
}

.image-grid .image-card img {
  width: 100%;
  height: 200px;
  -o-object-fit: cover;
     object-fit: cover;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: block;
}

.image-grid .image-card .image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.7));
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: white;
  padding: 15px;
  text-align: center;
}

.image-grid .image-card .image-overlay h3 {
  font-size: 1.1rem;
  margin-bottom: 5px;
}

.image-grid .image-card .image-overlay p {
  font-size: 0.9rem;
  opacity: 0.9;
}

.image-grid .image-card .favorite-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #f43f5e;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-grid .image-card .favorite-indicator.active {
  opacity: 1;
}

.image-grid .empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
}

.image-grid .empty-state svg {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  opacity: 0.5;
  display: initial;
}

.image-grid .empty-state h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal.active .modal-content {
  transform: scale(1);
  opacity: 1;
}

.modal .modal-content {
  background-color: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  transform: scale(0.9);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.modal .modal-content .close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.8rem;
  color: #64748b;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal .modal-content .close-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
  color: #334155;
}

.modal .modal-content .modal-body {
  display: flex;
  flex-direction: column;
  height: 100%;
}

@media (min-width: 768px) {
  .modal .modal-content .modal-body {
    flex-direction: row;
  }
}

.modal .modal-content .modal-body img {
  width: 95%;
  max-height: 95vh;
  -o-object-fit: contain;
     object-fit: contain;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: zoom-in;
}

.modal .modal-content .modal-body img.zoomed {
  transform: scale(2.5);
  cursor: zoom-out;
  max-width: none;
  max-height: none;
}

@media (min-width: 768px) {
  .modal .modal-content .modal-body img {
    width: 80%;
    max-height: none;
  }
}

.modal .modal-content .modal-body .image-info {
  padding: 10px;
  flex: 1;
  margin-top: auto;
  margin-bottom: auto;
}

.modal .modal-content .modal-body .image-info h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.modal .modal-content .modal-body .image-info p {
  color: #64748b;
  margin-bottom: 20px;
}

.modal .modal-content .modal-body .image-info .image-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal .modal-content .modal-body .image-info .image-actions .action-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background-color: transparent;
  color: #334155;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal .modal-content .modal-body .image-info .image-actions .action-btn:hover {
  background-color: #f1f5f9;
}

.modal .modal-content .modal-body .image-info .image-actions .action-btn:hover.favorite-btn {
  color: #f43f5e;
  border-color: #f43f5e;
}

.modal .modal-content .modal-body .image-info .image-actions .action-btn:hover.download-btn {
  color: #6366f1;
  border-color: #6366f1;
}

.modal .modal-content .modal-body .image-info .image-actions .action-btn:hover.delete-btn {
  color: #ef4444;
  border-color: #ef4444;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

@media (max-width: 768px) {
  .app-container {
    padding: 15px;
  }

  .toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .toolbar .search-bar {
    min-width: auto;
  }

  .toolbar .filter-options {
    justify-content: center;
  }

  .image-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .modal .modal-content .modal-body {
    flex-direction: column;
  }

  .modal .modal-content .modal-body img {
    max-height: 62vh;
  }
}

