/**
 * swarmLine - Study Store Styles
 * Styles for the public study store page
 */

/* Store Header */
.store-header {
    padding: 140px 0 60px;
    background: linear-gradient(180deg, var(--off-white) 0%, var(--white) 100%);
    position: relative;
}

.store-header::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 60%;
    height: 120%;
    background: radial-gradient(ellipse at center, var(--gold-glow) 0%, transparent 70%);
    pointer-events: none;
}

.store-header-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 40px;
    position: relative;
    z-index: 2;
}

.store-header .section-title {
    margin-bottom: 16px;
}

.store-header .section-title em {
    font-family: 'Fraunces', serif;
    font-style: italic;
    color: var(--gold);
}

/* Search Bar */
.store-search {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    color: var(--slate-light);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 16px 20px 16px 52px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 1rem;
    border: 1px solid var(--border-light);
    border-radius: 12px;
    background: var(--white);
    color: var(--navy-deep);
    box-shadow: 0 4px 16px rgba(10, 26, 47, 0.06);
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 4px 20px rgba(212, 168, 83, 0.15);
}

.search-input::placeholder {
    color: var(--slate-light);
}

/* Store Content Layout */
.store-content {
    padding: 48px 0 80px;
}

.store-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 40px;
    align-items: start;
}

/* Filters Sidebar */
.store-filters {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    padding: 24px;
    position: sticky;
    top: 100px;
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
}

.filter-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--navy-deep);
    margin: 0;
}

.filter-reset {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
}

.filter-reset:hover {
    color: var(--gold);
}

.filter-group {
    margin-bottom: 24px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-title {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--navy-deep);
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 10px;
    margin: -8px -10px;
    border-radius: 8px;
    transition: background 0.15s ease;
}

.filter-option:hover {
    background: var(--off-white);
}

.filter-option input[type="checkbox"] {
    display: none;
}

.filter-checkbox {
    width: 18px;
    height: 18px;
    border: 2px solid var(--slate-light);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.filter-option input[type="checkbox"]:checked + .filter-checkbox {
    background: var(--gold);
    border-color: var(--gold);
}

.filter-option input[type="checkbox"]:checked + .filter-checkbox::after {
    content: '';
    width: 10px;
    height: 6px;
    border-left: 2px solid var(--navy-deep);
    border-bottom: 2px solid var(--navy-deep);
    transform: rotate(-45deg) translateY(-1px);
}

.filter-label {
    font-size: 0.875rem;
    color: var(--slate);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Author Badges */
.author-badge {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 6px;
    border-radius: 4px;
}

.author-badge.official {
    background: linear-gradient(135deg, var(--gold-glow) 0%, rgba(212, 168, 83, 0.2) 100%);
    color: var(--gold-dark);
}

.author-badge.community {
    background: rgba(100, 116, 139, 0.1);
    color: var(--slate);
}

/* Store Main Area */
.store-main {
    min-height: 400px;
}

.store-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.results-count {
    font-size: 0.875rem;
    color: var(--slate);
}

.results-count span {
    font-weight: 700;
    color: var(--navy-deep);
}

.sort-dropdown {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-dropdown label {
    font-size: 0.8125rem;
    color: var(--slate);
}

.sort-dropdown select {
    padding: 8px 32px 8px 12px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--navy-deep);
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 8px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}

.sort-dropdown select:focus {
    outline: none;
    border-color: var(--gold);
}

/* Studies Grid */
.studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

/* Study Card */
.study-card {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.study-card:hover {
    border-color: var(--gold);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(10, 26, 47, 0.08);
}

.study-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px 24px 0;
}

.study-avatar {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--white);
    flex-shrink: 0;
}

.study-meta {
    flex: 1;
    min-width: 0;
}

.study-topic {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--gold);
    margin-bottom: 4px;
}

.study-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--navy-deep);
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.study-card-body {
    padding: 16px 24px;
    flex: 1;
}

.study-description {
    font-size: 0.875rem;
    color: var(--slate);
    line-height: 1.6;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.study-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.keyword-pill {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--slate);
    background: var(--off-white);
    padding: 4px 10px;
    border-radius: 100px;
    border: 1px solid var(--border-light);
}

.study-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    background: var(--off-white);
}

.study-price {
    display: flex;
    flex-direction: column;
}

.price-value {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--navy-deep);
    letter-spacing: -0.02em;
}

.price-value.free {
    color: var(--success);
}

.study-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.75rem;
    color: var(--slate-light);
}

.study-stats span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-add-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--navy-deep);
    border: none;
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-cart:hover {
    background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 168, 83, 0.35);
}

.btn-add-cart.in-cart {
    background: var(--navy-deep);
    color: var(--white);
}

/* Study Author Badge on Card */
.study-author-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 8px;
    border-radius: 6px;
}

.study-author-badge.official {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--navy-deep);
}

.study-author-badge.community {
    background: var(--navy-deep);
    color: var(--white);
}

/* Study Card with position for badge */
.study-card {
    position: relative;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 40px;
    background: var(--off-white);
    border-radius: 16px;
}

.empty-icon {
    color: var(--slate-light);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--navy-deep);
    margin: 0 0 8px 0;
}

.empty-state p {
    font-size: 0.9375rem;
    color: var(--slate);
    margin: 0 0 24px 0;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 80px 40px;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border-light);
    border-top-color: var(--gold);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-state p {
    font-size: 0.9375rem;
    color: var(--slate);
    margin: 0;
}

/* Store CTA */
.store-cta {
    padding: 60px 0;
    background: var(--off-white);
}

.cta-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 48px;
    background: var(--navy-deep);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.cta-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse at center, var(--gold-glow) 0%, transparent 70%);
    pointer-events: none;
}

.cta-content {
    position: relative;
    z-index: 2;
    max-width: 600px;
}

.cta-content h2 {
    font-family: 'Fraunces', serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--white);
    margin: 0 0 12px 0;
}

.cta-content p {
    font-size: 1rem;
    color: var(--slate-light);
    margin: 0;
    line-height: 1.7;
}

.cta-card .btn-primary {
    position: relative;
    z-index: 2;
    flex-shrink: 0;
}

/* Publish CTA Section */
.publish-cta {
    padding: 60px 0 80px;
}

.publish-card {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 48px;
    background: var(--white);
    border: 2px solid var(--border-light);
    border-radius: 20px;
    transition: border-color 0.3s ease;
}

.publish-card:hover {
    border-color: var(--gold);
}

.publish-icon {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--gold-glow) 0%, rgba(212, 168, 83, 0.05) 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
    flex-shrink: 0;
}

.publish-content {
    flex: 1;
}

.publish-content h3 {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--navy-deep);
    margin: 0 0 8px 0;
}

.publish-content p {
    font-size: 0.9375rem;
    color: var(--slate);
    margin: 0 0 20px 0;
    line-height: 1.7;
}

.publish-stats {
    display: flex;
    gap: 32px;
}

.publish-stat {
    display: flex;
    flex-direction: column;
}

.publish-stat .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--gold);
    letter-spacing: -0.02em;
}

.publish-stat .stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--slate);
}

.publish-card .btn-secondary {
    flex-shrink: 0;
}

/* Rating Stars */
.study-rating {
    display: flex;
    align-items: center;
    gap: 4px;
}

.star {
    color: var(--gold);
    font-size: 0.75rem;
}

.star.empty {
    color: var(--slate-light);
}

.rating-count {
    font-size: 0.75rem;
    color: var(--slate-light);
    margin-left: 4px;
}

/* Active Nav Link */
.nav-links a.active {
    color: var(--gold);
    font-weight: 600;
}

/* Responsive */
@media (max-width: 1024px) {
    .store-layout {
        grid-template-columns: 220px 1fr;
        gap: 24px;
    }

    .cta-card {
        flex-direction: column;
        text-align: center;
        padding: 40px;
    }

    .cta-content {
        max-width: 100%;
    }

    .publish-card {
        flex-direction: column;
        text-align: center;
        padding: 40px;
    }

    .publish-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .store-layout {
        grid-template-columns: 1fr;
    }

    .store-filters {
        position: static;
        display: none; /* Hidden on mobile, could add toggle */
    }

    .store-filters.show {
        display: block;
    }

    .store-toolbar {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

    .studies-grid {
        grid-template-columns: 1fr;
    }

    .publish-stats {
        flex-direction: column;
        gap: 16px;
        align-items: center;
    }

    .store-header {
        padding: 120px 0 40px;
    }
}
