@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: var(--body-bg-color);
  min-height: 100vh;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--container-bg);
  border-radius: 20px;
  box-shadow: 0 20px 40px var(--shadow-primary);
  overflow: hidden;
}

.header {
  background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
  color: white;
  padding: 30px;
  text-align: center;
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.tabs {
  display: flex;
  background: #f8f9fa;
  border-bottom: 2px solid var(--border-light);
}

.tab {
  flex: 1;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  background: #f8f9fa;
  border: none;
  font-size: 1.1em;
  font-weight: 600;
  transition: all 0.3s ease;
  color: var(--text-secondary);
}

.tab.active {
  background: white;
  color: var(--bg-gradient-end);
  border-bottom: 3px solid var(--bg-gradient-end);
}

.tab:hover {
  background: #e9ecef;
}

.tab-content {
  display: none;
  padding: 30px;
}

.tab-content.active {
  display: block;
}

.search-section {
  margin-bottom: 30px;
}

.search-container {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.search-input {
  flex: 1;
  padding: 15px 20px;
  border: 2px solid var(--border-light);
  border-radius: 50px;
  font-size: 1.1em;
  min-width: 250px;
  transition: border-color 0.3s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--border-dark);
  box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

.btn {
  padding: 15px 30px;
  border: none;
  border-radius: 50px;
  font-size: 1.1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--btn-primary-start), var(--btn-primary-end));
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px var(--shadow-primary-hover);
}

.btn-secondary {
  background: var(--btn-secondary-bg);
  color: white;
}

.btn-secondary:hover {
  background: var(--btn-secondary-hover);
  transform: translateY(-2px);
}

.controls {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.control-group label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9em;
}

.control-group select,
.control-group input {
  padding: 8px 12px;
  border: 2px solid var(--border-light);
  border-radius: 8px;
  font-size: 1em;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--text-muted);
}

.loading::after {
  content: '';
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-light);
  border-top: 4px solid var(--border-dark);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 10px;
}

.search-warning {
  display: none;
  color: var(--error-text);
  background-color: var(--error-bg);
  border: 1px solid var(--error-border);
  padding: 10px 14px;
  border-radius: 6px;
  margin-top: 8px;
  font-size: 0.95rem;
  animation: fadeIn 0.25s ease-in-out;
}

.search-input.input-error {
  border: 2px solid var(--error-border);
  background-color: var(--error-bg);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.image-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px var(--shadow-primary);
  transition: transform 0.3s ease;
}

.image-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px var(--shadow-primary-hover);
}

.image-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.image-info {
  padding: 20px;
}

.image-info h3 {
  margin-bottom: 10px;
  color: var(--border-dark);
  font-size: 1.2em;
}

.image-info p {
  color: var(--text-muted);
  font-size: 0.9em;
  margin-bottom: 10px;
}

.image-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-small {
  padding: 8px 16px;
  font-size: 0.9em;
  border-radius: 20px;
}

.error {
  background: var(--error-bg);
  color: var(--error-text);
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
  border: 1px solid var(--error-border);
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.pagination button {
  padding: 10px 15px;
  border: 2px solid var(--border-light);
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.pagination button:hover,
.pagination button.active {
  background: var(--btn-primary-hover);
  color: white;
  border-color: var(--btn-primary-hover);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .search-container,
  .controls {
    flex-direction: column;
  }

  .search-input {
    min-width: 100%;
  }

  .image-grid {
    grid-template-columns: 1fr;
  }
}

/* Footer */
.footer {
  background-color: var(--footer-bg);
  text-align: center;
  padding: 25px 20px;
  border-top: 1px solid var(--border-light);
  font-size: 0.95rem;
  color: var(--footer-text);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
  letter-spacing: 0.02em;
}

.footer-container {
  max-width: 960px;
  margin: 0 auto;
}

.footer p {
  margin: 0;
  font-weight: 500;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 15px 0 0;
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.footer-links li a {
  text-decoration: none;
  color: var(--footer-text);
  font-weight: 500;
  transition: color 0.35s ease
  transition: color 0.35s ease, transform 0.3s ease;
  padding: 4px 8px;
  border-radius: 4px;
}

.footer-links li a:hover {
  color: var(--btn-primary-start);
  background-color: rgba(0, 123, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 2px 6px var(--shadow-primary);
}

/* Promo Section */
.promo-section {
  background: linear-gradient(135deg, var(--promo-bg-start), var(--promo-bg-end));
  padding: 60px 20px;
  text-align: center;
  border-top: 2px solid var(--border-light);
  border-bottom: 2px solid var(--border-light);
  box-shadow: inset 0 0 20px rgba(0, 123, 255, 0.05);
}

.promo-content {
  max-width: 800px;
  margin: 0 auto;
}

.promo-section h2 {
  font-size: 2.25rem;
  margin-bottom: 18px;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.07);
}

.promo-section p {
  font-size: 1.125rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  font-weight: 500;
  line-height: 1.6;
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.promo-section a {
  text-decoration: none;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: color 0.3s ease, border-color 0.3s ease;
}

.promo-section a:hover {
  text-decoration: none;
  border-color: var(--btn-primary-start);
}

/* Button Promo */
.btn-promo {
  background-color: var(--btn-primary-start);
  color: #fff;
  text-decoration: none;
  padding: 16px 36px;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: 700;
  box-shadow: 0 6px 14px var(--shadow-primary);
  transition: background-color 0.35s ease, box-shadow 0.35s ease, transform 0.3s ease;
  display: inline-block;
  cursor: pointer;
  user-select: none;
}

.btn-promo:hover,
.btn-promo:focus {
  background-color: var(--btn-primary-hover);
  box-shadow: 0 8px 20px var(--shadow-primary-hover);
  transform: translateY(-3px);
  outline: none;
}
