/* Frontend Styles - Simple Custom CSS */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --light: #f8fafc;
    --dark: #1e293b;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-500: #64748b;
    --gray-700: #334155;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
}

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

.container.narrow {
    max-width: 800px;
}

/* Header */
.site-header {
    background: white;
    box-shadow: var(--shadow);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo::before {
    content: "%";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--success) 0%, #16a34a 100%);
    color: white;
    font-size: 1.25rem;
    font-weight: 800;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3);
}

.main-nav {
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--gray-700);
    text-decoration: none;
    font-weight: 500;
}

.main-nav a:hover {
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.25rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.search-box {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    gap: 0.5rem;
}

.search-box input {
    flex: 1;
    padding: 1rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
}

.search-box button {
    padding: 1rem 2rem;
    background: var(--dark);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 600;
}

/* Store Grid */
.featured-stores,
.store-listing {
    padding: 3rem 0;
}

.featured-stores h2,
.store-listing h2 {
    margin-bottom: 2rem;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.store-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

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

.store-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.store-initial {
    width: 80px;
    height: 80px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.store-initial.large {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
}

.store-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.coupon-count {
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Store Header */
.store-header {
    background: white;
    padding: 2rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.store-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.store-logo {
    width: 100px;
    height: 100px;
    object-fit: contain;
}

/* Content Grid */
.store-content,
.coupon-listing,
.coupon-detail {
    padding: 2rem 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

/* Coupon Cards */
.coupon-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.coupon-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
}

.coupon-card.featured {
    border: 2px solid var(--primary);
}

.coupon-info {
    flex: 1;
}

.coupon-info h3 {
    margin-bottom: 0.5rem;
}

.coupon-info h3 a {
    color: inherit;
    text-decoration: none;
}

.coupon-info h3 a:hover {
    color: var(--primary);
}

.coupon-info p {
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.coupon-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
}

.discount {
    color: var(--success);
    font-weight: 600;
}

.expiry {
    color: var(--gray-500);
}

.coupon-action {
    text-align: right;
}

.coupon-code {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.coupon-code .code {
    background: var(--gray-100);
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 1rem;
    border: 2px dashed var(--gray-300);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.featured {
    background: var(--primary);
    color: white;
}

.badge.verified {
    background: var(--success);
    color: white;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.store-details,
.store-card-sidebar {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.store-details h3,
.store-card-sidebar h3 {
    margin-bottom: 1rem;
}

/* Page Header */
.page-header {
    background: var(--gray-100);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.breadcrumb {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-bottom: 1rem;
}

.breadcrumb a {
    color: var(--gray-500);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--primary);
}

/* Alphabet Navigation */
.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: white;
    border-radius: var(--radius);
}

.alphabet-nav a {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--gray-700);
    font-weight: 600;
}

.alphabet-nav a:hover {
    background: var(--primary);
    color: white;
}

.letter-heading {
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
}

/* Blog Post */
.blog-post {
    padding-bottom: 3rem;
}

.post-header {
    background: var(--gray-100);
    padding: 3rem 0;
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.post-meta {
    color: var(--gray-500);
}

.post-featured-image {
    margin: 2rem 0;
}

.post-featured-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius);
}

.post-content {
    padding: 2rem 0;
}

.post-content h2 {
    margin: 2rem 0 1rem;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content ul,
.post-content ol {
    margin: 1rem 0 1rem 2rem;
}

.post-footer {
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

/* Author Box */
.author-box {
    padding: 2rem 0;
    margin-top: 2rem;
}

.author-card {
    background: white;
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
}

.author-avatar {
    flex-shrink: 0;
}

.author-initial {
    width: 64px;
    height: 64px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.author-bio {
    color: var(--gray-500);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 768px) {
    .author-card {
        flex-direction: column;
        text-align: center;
    }

    .author-initial {
        margin: 0 auto;
    }
}

/* Coupon Detail */
.coupon-detail-card {
    background: white;
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.coupon-detail-card header {
    margin-bottom: 2rem;
}

.coupon-detail-card h1 {
    margin: 1rem 0;
}

.discount-badge.large {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--success);
    color: white;
    border-radius: var(--radius);
    font-size: 1.25rem;
    font-weight: 700;
}

.code-reveal {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--gray-100);
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.code-display {
    flex: 1;
    padding: 1rem;
    background: white;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 1.25rem;
    text-align: center;
}

.code-display.revealed {
    border-style: solid;
    border-color: var(--success);
    font-weight: 700;
}

.how-to-use {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--gray-100);
    border-radius: var(--radius);
}

.how-to-use h2 {
    margin-bottom: 1rem;
}

.how-to-use ol {
    margin-left: 1.5rem;
}

.how-to-use li {
    margin-bottom: 0.5rem;
}

/* Footer */
.site-footer {
    background: var(--dark);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
}

.footer-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-nav a {
    color: var(--gray-300);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-nav a:hover {
    color: white;
}

/* Utility */
.text-center {
    text-align: center;
}

.no-coupons,
.no-stores {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

/* Homepage Sections */
.popular-stores,
.latest-stores,
.latest-posts {
    padding: 3rem 0;
}

.popular-stores {
    background: var(--gray-100);
}

.latest-posts {
    background: white;
}

.popular-stores h2,
.latest-stores h2,
.latest-posts h2 {
    margin-bottom: 2rem;
}

/* Blog Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.post-card {
    background: var(--gray-100);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
}

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

.post-image {
    height: 160px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-image.placeholder {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-image.placeholder span {
    font-size: 3rem;
    color: white;
    font-weight: 700;
}

.post-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.post-info p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    flex: 1;
}

.post-date {
    color: var(--gray-500);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 768px) {
    .site-header .container {
        flex-direction: column;
        gap: 1rem;
    }

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

    .search-box {
        flex-direction: column;
    }

    .store-info {
        flex-direction: column;
        text-align: center;
    }

    .coupon-card {
        flex-direction: column;
        text-align: center;
    }

    .coupon-action {
        text-align: center;
        width: 100%;
    }

    .coupon-code {
        flex-direction: column;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }
}
