/* Lucky Blog - Modern CSS */

/* CSS Variables */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --bg: #fafbfc;
    --card-bg: #ffffff;
    --text: #1f2937;
    --text-light: #6b7280;
    --border: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --radius: 12px;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Reset */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

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

.logo-icon {
    font-size: 1.5rem;
}

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

.nav-link {
    padding: 0.5rem 1rem;
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
    background: var(--bg);
    color: var(--primary);
}

/* Search Form */
.search-form {
    display: flex;
    gap: 0.25rem;
}

.search-input {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.875rem;
    width: 150px;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    width: 200px;
}

.search-btn {
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.search-btn:hover {
    background: var(--border);
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem 0;
}

/* Posts Container */
.posts-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Brief Card */
.brief-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.brief-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.brief-header {
    padding: 1.5rem 2rem;
    color: white;
    position: relative;
}

/* Color-coded headers for each post */
.brief-card:nth-child(1) .brief-header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.brief-card:nth-child(2) .brief-header { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.brief-card:nth-child(3) .brief-header { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.brief-card:nth-child(4) .brief-header { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.brief-card:nth-child(5) .brief-header { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.brief-card:nth-child(6) .brief-header { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); }

.brief-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.3);
}

.brief-date {
    display: inline-block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    opacity: 0.9;
}

.brief-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    color: white;
}

.brief-footer {
    padding: 1rem 2rem;
    background: var(--bg);
    border-top: 1px solid var(--border);
    text-align: right;
}

.read-more {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.read-more:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Link List */
.link-list {
    list-style: none;
    padding: 1.5rem 2rem;
}

.link-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
}

.link-item:last-child {
    margin-bottom: 0;
}

.link-item:hover {
    border-color: var(--primary);
    transform: translateX(4px);
}

.link-item.highlight {
    border-color: var(--secondary);
    background: rgba(16, 185, 129, 0.05);
}

.link-item a {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
}

.link-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--primary);
}

.link-icon svg {
    width: 100%;
    height: 100%;
}

.link-content {
    flex: 1;
    min-width: 0;
}

.link-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--primary-dark);
    margin-bottom: 0.25rem;
}

.link-meta {
    font-size: 0.75rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.link-description {
    font-size: 0.875rem;
    color: var(--text-light);
    line-height: 1.5;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

.page-num, .page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: all 0.2s;
}

.page-num:hover, .page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-num.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.page-btn.prev, .page-btn.next {
    background: var(--bg);
}

.pagination-info {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}

/* Subscribe Section */
.subscribe-section {
    margin: 3rem 0;
}

.subscribe-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: white;
}

.subscribe-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.subscribe-desc {
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

.subscribe-form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.subscribe-input {
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    width: 250px;
    max-width: 100%;
}

.subscribe-btn {
    padding: 0.75rem 1.5rem;
    background: var(--text);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.subscribe-btn:hover {
    transform: scale(1.05);
}

.subscribe-note {
    margin-top: 1rem;
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Quick Links */
.quick-links {
    margin-top: 3rem;
}

.quick-links-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.quick-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s;
}

.quick-link-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.quick-link-icon {
    font-size: 2rem;
}

.quick-link-text {
    font-weight: 500;
    font-size: 0.875rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.empty-state h2 {
    margin-bottom: 0.5rem;
    color: var(--text);
}

/* Search Results */
.search-header {
    text-align: center;
    margin-bottom: 2rem;
}

.search-query {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.search-count {
    color: var(--text-light);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Footer */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-content {
    text-align: center;
}

.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.footer-tagline {
    color: var(--text-light);
    margin-bottom: 1rem;
}

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

.footer-links a {
    color: var(--text-light);
    text-decoration: none;
    transition: color 0.2s;
}

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

.footer-copy {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Archive Page */
.archive-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.archive-item {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.2s;
}

.archive-item:hover {
    border-color: var(--primary);
}

.archive-item h3 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.archive-item a {
    color: var(--primary-dark);
    text-decoration: none;
}

.archive-item a:hover {
    text-decoration: underline;
}

.archive-date {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Responsive */
@media (max-width: 640px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }
    
    .main-nav {
        order: 2;
    }
    
    .search-form {
        order: 3;
        width: 100%;
    }
    
    .search-input {
        width: 100%;
    }
    
    .brief-title {
        font-size: 1.25rem;
    }
    
    .brief-card {
        padding: 0;
    }
    
    .brief-header {
        padding: 1.25rem 1.5rem;
    }
    
    .link-list {
        padding: 1rem 1.5rem;
    }
    
    .pagination {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .page-numbers {
        flex-wrap: wrap;
        justify-content: center;
    }
}
