@import 'variables.css';

* {
    box-sizing: border-box;
}

:root {
    --color-grey-5: #0E0E0E;
    --color-grey-7: #131313;
    --color-grey-11: #1C1B1B;
    --color-grey-12: #201F1F;
    --color-grey-16: #2A2A2A;
    --color-grey-21: #353534;
    --color-grey-89: #E5E2E1;
    --color-orange-72: #F1C97D;
    --color-orange-75: #D0C5AF;
    --color-orange-61: #D4AD65;
    --color-orange-13: #412D00;
}

body {
    background: var(--color-grey-7);
    color: var(--color-grey-89);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    margin: 0;
    padding: 0;
    font-size: 16px;
    line-height: 1.5;
}

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

/* Header */
.topbar {
    height: 70px;
    background: rgba(14, 14, 14, 0.98);
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo-text {
    color: var(--color-orange-72);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 0.8px;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav a {
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-orange-75);
    transition: color 0.2s;
}

.nav a.active, .nav a:hover {
    color: var(--color-orange-72);
}

.actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.btn-login {
    padding: 10px 24px;
    border-radius: 10px;
    border: 1px solid rgba(241, 201, 125, 0.2);
    color: var(--color-grey-89);
    font-size: 14px;
    text-decoration: none;
    font-weight: 500;
}

.btn-signup {
    padding: 11px 26px;
    background: linear-gradient(160deg, var(--color-orange-72) 0%, var(--color-orange-61) 100%);
    border-radius: 10px;
    color: var(--color-orange-13);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    box-shadow: 0 4px 15px rgba(241, 201, 125, 0.15);
}

/* Hero Section */
.hero {
    background: #0E0E0E;
    padding: 40px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}

.hero-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 40px;
}

.hero-copy h1 {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 12px 0;
    color: #fff;
}

.hero-copy p {
    font-size: 16px;
    color: var(--color-orange-75);
    line-height: 1.6;
    max-width: 500px;
    margin: 0;
}

.search-box {
    width: 320px;
    height: 48px;
    background: var(--color-grey-16);
    border-radius: 14px;
    border: 1px solid rgba(241, 201, 125, 0.15);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.search-box:focus-within {
    border-color: var(--color-orange-72);
    box-shadow: 0 0 0 4px rgba(241, 201, 125, 0.1);
}

.search-box span {
    color: var(--color-orange-72);
    font-size: 20px;
}

.search-box input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 15px;
    width: 100%;
}

/* Main Content Area */
.content {
    background: var(--color-grey-11);
    padding: 22px 0 54px;
}

.layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 20px;
}

/* Prevent grid children from blowing beyond their container width */
.filters, .results {
    min-width: 0;
    max-width: 100%;
}

/* Sidebar Filters */
.filters {
    background: var(--color-grey-12);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: fit-content;
    border: 1px solid rgba(255,255,255,0.03);
}

.filter-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.filter-group {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.filter-group:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.filter-label {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.chip {
    padding: 8px 16px;
    border-radius: 12px;
    background: var(--color-grey-16);
    border: 1px solid rgba(77, 70, 53, 0.35);
    font-size: 13px;
    color: var(--color-orange-75);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.chip:hover {
    border-color: var(--color-orange-72);
    color: #fff;
}

.chip.active {
    background: linear-gradient(144deg, var(--color-orange-72) 0%, var(--color-orange-61) 100%);
    color: var(--color-orange-13);
    font-weight: 700;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(241, 201, 125, 0.2);
}

.price-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.price-chip {
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--color-grey-16);
    border: 1px solid rgba(77, 70, 53, 0.35);
    font-size: 13px;
    color: var(--color-orange-75);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.price-chip:hover {
    border-color: var(--color-orange-72);
}

.price-chip.active {
    background: linear-gradient(164deg, var(--color-orange-72) 0%, var(--color-orange-61) 100%);
    color: var(--color-orange-13);
    font-weight: 700;
    border-color: transparent;
}

.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.btn-apply {
    height: 48px;
    background: linear-gradient(166deg, var(--color-orange-72) 0%, var(--color-orange-61) 100%);
    border-radius: 12px;
    border: none;
    color: var(--color-orange-13);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-apply:active {
    transform: scale(0.98);
}

.btn-reset {
    height: 44px;
    background: var(--color-grey-16);
    border-radius: 12px;
    border: 1px solid rgba(77, 70, 53, 0.35);
    color: var(--color-grey-89);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

/* Results Content */
.results {
    background: var(--color-grey-12);
    border-radius: 20px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    border: 1px solid rgba(255,255,255,0.03);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.results-info h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
    color: #fff;
}

.results-sub {
    font-size: 14px;
    color: var(--color-orange-75);
    margin: 6px 0 0 0;
}

.sort-select {
    width: 180px;
    height: 40px;
    background: var(--color-grey-16);
    border: 1px solid rgba(77, 70, 53, 0.35);
    border-radius: 10px;
    color: var(--color-grey-89);
    font-size: 13px;
    padding: 0 14px;
    outline: none;
    cursor: pointer;
}

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

.creator-card {
  background: var(--color-grey-12);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  height: 100%;
}

.creator-card:hover {
  transform: translateY(-8px);
  border-color: rgba(241, 201, 125, 0.3);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.creator-card:hover .creator-card-img {
  transform: scale(1.08);
}

.creator-card-image-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #1a1a1a;
}

.creator-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.creator-card-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 42px;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.creator-card-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  background: rgba(14, 14, 14, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 6px 12px;
  border-radius: 10px;
  color: var(--color-orange-72);
  font-weight: 700;
  font-size: 13px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 2;
}

.creator-card-content {
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-grow: 1;
}

.creator-card-name {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.creator-card-cat {
  font-size: 13px;
  color: #8a8a8a;
  margin-bottom: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.creator-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.creator-card-btn {
  flex: 1;
  height: 38px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.creator-card-btn.primary {
  background: linear-gradient(135deg, var(--color-orange-72) 0%, var(--color-orange-61) 100%);
  border: none;
  color: var(--color-orange-13);
}

.creator-card-btn.primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.creator-card-btn.secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
}

.creator-card-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-top: 20px;
}

.page-btn {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--color-grey-16);
    border: 1px solid rgba(255,255,255,0.05);
    color: var(--color-orange-75);
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: var(--color-orange-72);
    color: #fff;
}

.page-btn.active {
    background: linear-gradient(135deg, var(--color-orange-72) 0%, var(--color-orange-61) 100%);
    color: var(--color-orange-13);
    border: none;
}

@media (max-width: 1024px) {
    .container { padding: 0 24px; }
    .layout { grid-template-columns: 240px 1fr; gap: 20px; }
    .hero-copy h1 { font-size: 32px; }
    .hero-copy p { font-size: 15px; }
    .cards-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

@media (max-width: 768px) {
    .container { padding: 0 20px; }
    .hero-inner { flex-direction: column; text-align: center; gap: 24px; }
    .hero-copy p { margin: 0 auto; max-width: 100%; }
    .search-box { width: 100%; max-width: none; }
    
    .layout { grid-template-columns: 1fr; gap: 20px; }
    
    .filters {
        position: relative;
        padding: 20px;
    }
    
    .filter-actions {
        flex-direction: row;
        gap: 12px;
    }
    .btn-apply, .btn-reset { flex: 1; height: 44px; margin-top: 0; }
    
    .chip-wrap {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
        margin: 0 -20px;
        padding-left: 20px;
        padding-right: 20px;
    }
    .chip-wrap::-webkit-scrollbar { display: none; }
    .chip { white-space: nowrap; flex-shrink: 0; }
    
    .price-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 12px;
        -webkit-overflow-scrolling: touch;
        margin: 0 -20px;
        padding-left: 20px;
        padding-right: 20px;
    }
    .price-list::-webkit-scrollbar { display: none; }
    .price-chip { white-space: nowrap; flex-shrink: 0; }
    
    .results { padding: 20px; }
    .results-header { flex-direction: column; align-items: flex-start; gap: 16px; }
    .sort-select { width: 100%; }
}

@media (max-width: 580px) {
    .container { padding: 0 16px; }
    .hero { padding: 30px 0; }
    .hero-copy h1 { font-size: 26px; }
    
    .filters { padding: 16px; }
    
    /* Ensure chips don't overflow padding awkwardly on small screens */
    .chip-wrap, .price-list { margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
    
    .results { padding: 16px; }
    
    .cards-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }
    
    .creator-card {
        padding: 16px 12px 12px;
        border-radius: 14px;
    }
    
    .avatar { width: 60px; height: 60px; font-size: 22px; }
    .creator-name { font-size: 14px; margin-top: 8px; }
    .creator-cat { font-size: 11px; min-height: 32px; margin-bottom: 4px; }
    .creator-price { font-size: 14px; margin-bottom: 8px; }
    .view-profile, .request-btn { height: 34px; font-size: 12px; }
}

@media (max-width: 400px) {
    .hero-copy h1 { font-size: 24px; }
    .cards-grid {
        grid-template-columns: 1fr;
    }
    .creator-card {
        padding: 24px;
        gap: 10px;
    }
    .avatar { width: 80px; height: 80px; font-size: 28px; }
    .creator-name { font-size: 18px; margin-top: 12px; }
    .creator-cat { font-size: 14px; min-height: auto; margin-bottom: 4px; }
    .creator-price { font-size: 16px; margin-bottom: 12px; }
    .view-profile, .request-btn { height: 42px; font-size: 14px; }
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.creator-card {
    animation: fadeInUp 0.4s ease-out backwards;
}

/* Add stagger delay for injected cards via JS */
.creator-card:nth-child(n) { animation-delay: calc(0.05s * var(--i, 0)); }
