/**
 * PriceBulb Frontend Styles
 * Based on Concept-B design
 */

/* CSS Variables */
:root {
    --pricebulb-bg: #f5f0eb;
    --pricebulb-surface: #ffffff;
    --pricebulb-surface-hover: #fafafa;
    --pricebulb-text: #1a1a1a;
    --pricebulb-text-muted: #666666;
    --pricebulb-text-story: #333333;
    --pricebulb-accent: #ff6b35;
    --pricebulb-accent-light: #fff0eb;
    --pricebulb-border: #e5e5e5;
}

[data-theme="dark"] {
    --pricebulb-bg: #0d0d0d;
    --pricebulb-surface: #161616;
    --pricebulb-surface-hover: #1c1c1c;
    --pricebulb-text: #e8e8e8;
    --pricebulb-text-muted: #888888;
    --pricebulb-text-story: #c4c4c4;
    --pricebulb-accent: #ff6b35;
    --pricebulb-accent-light: rgba(255, 107, 53, 0.15);
    --pricebulb-border: #2a2a2a;
}

/* Container */
.pricebulb-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Header */
.pricebulb-header {
    background: var(--pricebulb-surface);
    padding: 1rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    transition: background 0.3s;
}

[data-theme="dark"] .pricebulb-header {
    box-shadow: none;
    border-bottom: 1px solid var(--pricebulb-border);
}

.pricebulb-header-inner {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pricebulb-logo {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--pricebulb-accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pricebulb-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--pricebulb-accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.pricebulb-header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.pricebulb-nav {
    display: flex;
    gap: 2rem;
}

.pricebulb-nav a {
    font-size: 0.9rem;
    color: var(--pricebulb-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.pricebulb-nav a:hover {
    color: var(--pricebulb-text);
}

.pricebulb-theme-toggle {
    background: var(--pricebulb-bg);
    border: 1px solid var(--pricebulb-border);
    border-radius: 50px;
    padding: 0.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pricebulb-theme-toggle span {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.pricebulb-theme-toggle .light-icon {
    background: var(--pricebulb-surface);
}

[data-theme="dark"] .pricebulb-theme-toggle .light-icon {
    background: transparent;
}

[data-theme="dark"] .pricebulb-theme-toggle .dark-icon {
    background: var(--pricebulb-surface);
}

/* Hero */
.pricebulb-hero {
    max-width: 800px;
    margin: 0 auto;
    padding: 4rem 2rem 2rem;
    text-align: center;
}

.pricebulb-hero h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    color: var(--pricebulb-text);
}

.pricebulb-hero p {
    font-family: 'Literata', Georgia, serif;
    font-size: 1.1rem;
    color: var(--pricebulb-text-muted);
    font-style: italic;
    max-width: 500px;
    margin: 0 auto;
}

/* Filters */
.pricebulb-filters {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding: 1.5rem 0;
    margin-bottom: 1rem;
}

.pricebulb-pill {
    padding: 0.5rem 1rem;
    background: var(--pricebulb-surface);
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
    border: 1px solid var(--pricebulb-border);
    color: var(--pricebulb-text);
}

.pricebulb-pill:hover {
    border-color: var(--pricebulb-accent);
    color: var(--pricebulb-accent);
}

.pricebulb-pill.active {
    background: var(--pricebulb-accent);
    color: white;
    border-color: var(--pricebulb-accent);
}

/* Masonry Grid */
.pricebulb-masonry {
    columns: 3;
    column-gap: 1.5rem;
}

.pricebulb-masonry[data-columns="1"] { columns: 1; }
.pricebulb-masonry[data-columns="2"] { columns: 2; }
.pricebulb-masonry[data-columns="4"] { columns: 4; }
.pricebulb-masonry[data-columns="5"] { columns: 5; }

/* Card */
.pricebulb-card {
    break-inside: avoid;
    background: var(--pricebulb-surface);
    border-radius: 16px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.pricebulb-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.1);
}

[data-theme="dark"] .pricebulb-card:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.pricebulb-card-image {
    position: relative;
    overflow: hidden;
}

/* Expand Button - in footer */
.pricebulb-expand-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
    padding: 0;
}

.pricebulb-expand-btn svg {
    width: 24px;
    height: 24px;
    color: var(--pricebulb-accent);
    transition: transform 0.2s;
}

.pricebulb-expand-btn:hover {
    transform: scale(1.15);
}

.pricebulb-expand-btn:hover svg {
    color: var(--pricebulb-accent);
}

.pricebulb-card-image img {
    width: 100%;
    display: block;
    background: var(--pricebulb-bg);
    aspect-ratio: 1;
    object-fit: cover;
}

.pricebulb-card-content {
    padding: 1.25rem;
}

.pricebulb-card-product {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--pricebulb-border);
}

.pricebulb-card-product h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--pricebulb-text);
    margin: 0;
}

.pricebulb-price {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--pricebulb-accent);
    white-space: nowrap;
    margin-left: 1rem;
}

.pricebulb-card-story {
    font-family: 'Literata', Georgia, serif;
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--pricebulb-text-story);
    font-style: italic;
    margin: 0;
}

.pricebulb-card-footer {
    margin-top: 1.25rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.pricebulb-card-footer .pricebulb-expand-btn {
    order: 1;
}

.pricebulb-card-footer .pricebulb-link {
    order: 2;
}

.pricebulb-link {
    font-size: 0.8rem;
    color: var(--pricebulb-accent);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.pricebulb-link:hover {
    opacity: 0.7;
}

/* Submission Form */
.pricebulb-submit-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 2rem;
    background: var(--pricebulb-surface);
    border-radius: 16px;
}

.pricebulb-submit-form h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--pricebulb-text);
}

.pricebulb-form-intro {
    color: var(--pricebulb-text-muted);
    margin-bottom: 2rem;
}

.pricebulb-field {
    margin-bottom: 1.5rem;
}

.pricebulb-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--pricebulb-text);
}

.pricebulb-field label .required {
    color: var(--pricebulb-accent);
}

.pricebulb-field input[type="text"],
.pricebulb-field input[type="url"],
.pricebulb-field select,
.pricebulb-field textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--pricebulb-border);
    border-radius: 8px;
    font-size: 1rem;
    background: var(--pricebulb-bg);
    color: var(--pricebulb-text);
    transition: border-color 0.2s;
}

.pricebulb-field input:focus,
.pricebulb-field select:focus,
.pricebulb-field textarea:focus {
    outline: none;
    border-color: var(--pricebulb-accent);
}

.pricebulb-field textarea {
    min-height: 150px;
    font-family: 'Literata', Georgia, serif;
    font-style: italic;
    line-height: 1.7;
    resize: vertical;
}

.pricebulb-field-help {
    font-size: 0.8rem;
    color: var(--pricebulb-text-muted);
    margin-top: 0.5rem;
}

.pricebulb-char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: var(--pricebulb-text-muted);
    margin-top: 0.5rem;
}

.pricebulb-char-counter.warning {
    color: #d63638;
}

.pricebulb-min-hint {
    opacity: 0.7;
}

.pricebulb-submit-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--pricebulb-accent);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.pricebulb-submit-btn:hover {
    background: #e55a2b;
}

.pricebulb-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.pricebulb-form-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.pricebulb-form-message.success {
    background: #d1fae5;
    color: #065f46;
}

.pricebulb-form-message.error {
    background: #fee2e2;
    color: #b91c1c;
}

/* Single Product */
.pricebulb-single-product {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.pricebulb-product-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
}

.pricebulb-product-image {
    flex: 0 0 300px;
}

.pricebulb-product-image img {
    width: 100%;
    border-radius: 16px;
}

.pricebulb-product-info {
    flex: 1;
}

.pricebulb-product-info h2 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    color: var(--pricebulb-text);
}

.pricebulb-product-info .pricebulb-price {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.pricebulb-categories {
    margin-bottom: 1rem;
}

.pricebulb-category-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--pricebulb-bg);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--pricebulb-text-muted);
    margin-right: 0.5rem;
}

.pricebulb-amazon-btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--pricebulb-accent);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
    transition: background 0.2s;
}

.pricebulb-amazon-btn:hover {
    background: #e55a2b;
    color: white;
}

.pricebulb-product-stories h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--pricebulb-text);
}

.pricebulb-story-item {
    background: var(--pricebulb-surface);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.pricebulb-story-text {
    font-family: 'Literata', Georgia, serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--pricebulb-text-story);
    font-style: italic;
    margin: 0 0 1rem;
}

.pricebulb-story-author {
    font-size: 0.85rem;
    color: var(--pricebulb-text-muted);
    margin: 0;
}

/* No results */
.pricebulb-no-results {
    text-align: center;
    color: var(--pricebulb-text-muted);
    padding: 3rem;
}

/* Footer */
.pricebulb-footer {
    background: var(--pricebulb-surface);
    border-top: 1px solid var(--pricebulb-border);
    padding: 2rem;
    text-align: center;
    color: var(--pricebulb-text-muted);
    font-size: 0.8rem;
    margin-top: 2rem;
}

.pricebulb-footer a {
    color: var(--pricebulb-accent);
    text-decoration: none;
}

/* Responsive */
@media (max-width: 1024px) {
    .pricebulb-masonry {
        columns: 2;
    }

    .pricebulb-product-header {
        flex-direction: column;
    }

    .pricebulb-product-image {
        flex: none;
        max-width: 300px;
    }
}

@media (max-width: 640px) {
    .pricebulb-masonry {
        columns: 1;
    }

    .pricebulb-hero h1 {
        font-size: 1.75rem;
    }

    .pricebulb-nav {
        display: none;
    }

    .pricebulb-container {
        padding: 1rem;
    }

    .pricebulb-header {
        padding: 1rem;
    }
}
