:root {
  --primary-color: #0f172a; /* Slate 900 */
  --accent-color: #3b82f6; /* Blue 500 */
  --accent-hover: #2563eb; /* Blue 600 */
  --bg-color: #f8fafc; /* Slate 50 */
  --text-color: #334155; /* Slate 700 */
  --heading-color: #1e293b; /* Slate 800 */
  --border-color: #e2e8f0; /* Slate 200 */
  --white: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 12px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Inter", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

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

/* Header Styles */
.main-header {
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 24px 0 16px;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.event-title {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 32px;
  color: var(--heading-color);
  letter-spacing: -0.025em;
  background: linear-gradient(to right, var(--heading-color), var(--accent-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Search Section */
/* Search Section */
.search-section {
  display: flex;
  justify-content: center;
  margin-bottom: 32px;
  padding: 0 16px;
}

.search-container {
  display: flex;
  gap: 0; /* Attached */
  width: 100%;
  max-width: 500px;
  background: transparent;
  padding: 0;
  border-radius: 4px;
  box-shadow: none;
  border: 1px solid #ddd;
}

/* Removed wrapper specific styling */
.search-input-wrapper { display: none; } 

.search-input {
  width: 100%;
  padding: 12px 16px;
  border: none;
  font-size: 0.95rem;
  outline: none;
  color: #666;
  background: var(--white);
  border-right: none;
  border-radius: 4px 0 0 4px; /* Left radius only */
}

.search-input::placeholder {
    color: #999;
    font-size: 0.9rem;
}

.btn-face-search {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #002266; /* Specific Dark Blue */
  color: var(--white);
  border: none;
  border-radius: 0 4px 4px 0; /* Right radius only */
  padding: 0 24px;
  font-size: 1.5rem; /* Larger icon */
  cursor: pointer;
  transition: var(--transition);
  height: auto; /* Match input height */
}

.btn-face-search:hover {
  background-color: #003388;
}

/* Category Tabs */
.category-tabs {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px;
}

.tab-btn {
  background: #f4f4f4;
  border: none;
  border-radius: 2px; /* Rectangular */
  padding: 10px 24px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tab-btn:hover {
  background: #e0e0e0;
  color: #000;
}

.tab-btn.active {
  color: #333; /* Text stays dark usually or maybe distinct? User ref implies simple active state */
  background-color: #e0e0e0; /* Slightly darker gray for active */
  box-shadow: none;
}

/* Gallery Grid */
.gallery-container {
  padding: 24px 0 60px;
  min-height: 80vh;
}

.search-status {
  text-align: center;
  margin-bottom: 32px;
  font-weight: 600;
  color: var(--accent-color);
  background: white;
  display: inline-block;
  padding: 8px 24px;
  border-radius: 99px;
  box-shadow: var(--shadow-sm);
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 0 16px;
}

.photo-item {
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    background-color: #e2e8f0;
    aspect-ratio: 3/2;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
}

.photo-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.photo-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.photo-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
    opacity: 0;
    transition: var(--transition);
}

.photo-item:hover::after {
    opacity: 1;
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    inset: 0;
    overflow: hidden;
    background-color: rgba(15, 23, 42, 0.95); /* Deep slate backdrop */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    flex-direction: column;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

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

/* Lightbox Top Bar */
.lightbox-bar {
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 32px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
    color: white;
    z-index: 1002;
    position: absolute;
    top: 0;
    left: 0;
}

.lightbox-counter {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.lightbox-actions {
    display: flex;
    gap: 16px;
}

.lightbox-actions button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-actions button:hover {
    background: white;
    color: var(--heading-color);
    transform: scale(1.1);
}

/* Lightbox Content */
.lightbox-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 20px;
}

.lightbox-content img {
    max-width: 95%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

/* Navigation Buttons */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    z-index: 1002;
    transition: var(--transition);
    outline: none;
}

.lightbox-nav:hover {
    background: white;
    color: var(--heading-color);
    transform: translateY(-50%) scale(1.1);
}

.lightbox-nav.prev {
    left: 32px;
}

.lightbox-nav.next {
    right: 32px;
}

@media (max-width: 768px) {
    .lightbox-nav {
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
    .lightbox-nav.prev { left: 16px; }
    .lightbox-nav.next { right: 16px; }
    .lightbox-bar { padding: 0 16px; }
}


/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 40px 0;
    gap: 6px; /* more compact */
    flex-wrap: wrap;
}

.pagination-btn {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 8px; /* Softer corners */
    color: var(--text-color);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-family: 'Inter', sans-serif;
    box-shadow: var(--shadow-sm);
}

.pagination-btn:hover:not(:disabled) {
    background-color: #f1f5f9;
    color: var(--heading-color);
    transform: translateY(-1px);
}

.pagination-btn.active {
    background-color: var(--heading-color);
    color: white;
    border-color: var(--heading-color);
    box-shadow: var(--shadow-md);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f1f5f9;
    box-shadow: none;
}

.pagination-dots {
    color: #94a3b8;
    padding: 0 4px;
    font-weight: bold;
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.photo-item:hover img {
    transform: scale(1.05);
}

/* Footer */
.main-footer {
  text-align: center;
  padding: 40px 24px;
  color: #94a3b8;
  font-size: 0.9rem;
  background-color: var(--white);
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.main-footer a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
}

.main-footer a:hover {
    text-decoration: underline;
}

/* Processing Modal */
.processing-modal {
    display: none;
    position: fixed; /* Fix to viewport */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* Full viewport height */
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: flex-start; /* Align to top */
    padding-top: 60px; /* Space from top */
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
    /* Prevent scroll propagation */
    overscroll-behavior: contain;
}

.processing-modal.active {
    display: flex;
}

.processing-content {
    background: white;
    padding: 32px 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 400px;
    text-align: center;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.processing-content h3 {
    margin-bottom: 24px;
    color: var(--heading-color);
    font-size: 1.25rem;
}

.progress-bar-container {
    width: 100%;
    height: 10px;
    background-color: #f1f5f9;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background-color: var(--accent-color);
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .search-container {
    flex-direction: column;
  }

  .btn-face-search {
    border-radius: 0 0 4px 4px; /* Bottom radius on mobile if wrapped */
    width: 100%;
  }
  
  .search-input {
    border-radius: 4px 4px 0 0;
    border-bottom: 1px solid #ddd;
  }

  .photo-grid {
    grid-template-columns: repeat(2, 1fr); /* 2 columns on mobile */
    gap: 8px;
  }
}
