/* 
   Tech Made Simple - Design System 
   Premium Aesthetic
*/

:root {
    /* Color Palette */
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    /* Indigo to Violet */
    --secondary-gradient: linear-gradient(135deg, #3b82f6 0%, #2dd4bf 100%);
    /* Blue to Teal */
    --surface-light: #ffffff;
    --surface-subtle: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border-color: #e2e8f0;
    
    /* Background Colors */
    --bg-main: #ffffff;
    --bg-secondary: #f8fafc;
    --card-shadow: rgba(0, 0, 0, 0.1);

    /* Semantic Colors (for tags/thumbnails) */
    --color-api: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --color-database: linear-gradient(135deg, #ec4899 0%, #d946ef 100%);
    --color-git: linear-gradient(135deg, #f43f5e 0%, #fb923c 100%);
    --color-cloud: linear-gradient(135deg, #0ea5e9 0%, #22d3ee 100%);
    --color-frontend: linear-gradient(135deg, #f59e0b 0%, #fcd34d 100%);
    --color-algorithms: linear-gradient(135deg, #84cc16 0%, #10b981 100%);
    --color-docker: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
    --color-microservices: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

    /* Spacing & Layout */
    --container-width: 1100px;
    --header-height: 380px;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-hover: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--surface-subtle);
    color: var(--text-main);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Layout */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
header {
    background: var(--primary-gradient);
    color: white;
    padding: 6rem 0 4rem;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    margin-bottom: 2rem;
}

header h1 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.tagline {
    font-size: 1.5rem;
    font-weight: 500;
    opacity: 0.95;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.125rem;
    opacity: 0.8;
}

/* Main Content Area */
main {
    padding-bottom: 5rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1.125rem;
    margin-bottom: 4rem;
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2.5rem;
}

/* Blog Card */
.blog-card {
    background: var(--surface-light);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.blog-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-hover);
}

.card-thumbnail {
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    position: relative;
}

/* Thumbnail Variants */
.thumbnail-api {
    background: var(--color-api);
}

.thumbnail-database {
    background: var(--color-database);
}

.thumbnail-git {
    background: var(--color-git);
}

.thumbnail-cloud {
    background: var(--color-cloud);
}

.thumbnail-frontend {
    background: var(--color-frontend);
}

.thumbnail-algorithms {
    background: var(--color-algorithms);
}

.thumbnail-docker {
    background: var(--color-docker);
}

.thumbnail-microservices {
    background: var(--color-microservices);
}

.card-content {
    padding: 2rem;
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-light);
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.tag {
    background: var(--surface-subtle);
    color: var(--text-muted);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    transition: background 0.2s;
}

.blog-card:hover .tag {
    background: #f1f5f9;
    color: var(--text-main);
}

/* Footer */
footer {
    background: #0f172a;
    color: white;
    text-align: center;
    padding: 4rem 0;
    margin-top: auto;
}

footer p {
    opacity: 0.8;
}

/* Blog Post Specific Styles */
.back-button {
    display: inline-flex;
    align-items: center;
    color: white;
    text-decoration: none;
    margin-bottom: 2rem;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 999px;
    font-weight: 600;
    transition: background 0.3s;
    font-size: 0.9rem;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.post-header {
    text-align: center;
    padding-top: 2rem;
}

.post-meta {
    display: inline-flex;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1.5rem;
    border-radius: 999px;
    font-size: 0.9rem;
    margin-top: 1rem;
}

article {
    background: white;
    border-radius: var(--radius-lg);
    padding: 4rem;
    margin-top: -4rem;
    /* Overlap header */
    box-shadow: var(--shadow-xl, 0 20px 25px -5px rgb(0 0 0 / 0.1));
    position: relative;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

article h2 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 3rem 0 1.5rem;
    letter-spacing: -0.025em;
}

article p {
    font-size: 1.125rem;
    color: var(--text-main);
    margin-bottom: 1.5rem;
}

article ul,
article ol {
    margin: 1.5rem 0 1.5rem 2rem;
}

article li {
    font-size: 1.125rem;
    margin-bottom: 0.75rem;
    color: var(--text-main);
}

.hero-icon {
    font-size: 6rem;
    text-align: center;
    margin: -6rem auto 2rem;
    width: 140px;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-light);
    border-radius: 50%;
    box-shadow: var(--shadow-lg);
}

.example-box {
    background: #f0f9ff;
    border-left: 5px solid #0ea5e9;
    padding: 2rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 2.5rem 0;
}

.example-box strong {
    color: #0369a1;
    display: block;
    margin-bottom: 0.75rem;
    font-size: 1.25rem;
}


.hero-image {
    width: 100%;
    max-width: 600px;
    height: auto;
    display: block;
    margin: -6rem auto 2rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.hero-icon {
    display: none;
    /* Hide old icon */
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }

    .section-title {
        font-size: 2rem;
    }

    article {
        padding: 2rem;
        margin-top: -2rem;
    }

    .hero-image {
        margin-top: -4rem;
    }
}

/* Search & Filter Styles */
.search-filter-container {
    margin: 2rem auto 3rem;
    max-width: 900px;
}

.search-box {
    margin-bottom: 1.5rem;
}

#searchInput {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-family: var(--font-sans);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background: var(--surface-light);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

#searchInput:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

#searchInput::placeholder {
    color: var(--text-light);
}

.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.65rem 1.5rem;
    background: var(--surface-light);
    border: 2px solid var(--border-color);
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 0.9rem;
    font-family: var(--font-sans);
    color: var(--text-muted);
    box-shadow: var(--shadow-sm);
}

.filter-btn:hover {
    background: var(--surface-subtle);
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.blog-card.hidden {
    display: none;
}

/* No Results Message */
.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
    background: var(--surface-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

.no-results-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-results-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.5rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.no-results p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Responsive adjustments for search/filter */
@media (max-width: 768px) {
    .filter-buttons {
        gap: 0.5rem;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    #searchInput {
        font-size: 0.95rem;
    }
}
/* Sort Container */
.sort-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.sort-container label {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

#sortSelect {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: var(--surface-light);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.3s ease;
}

#sortSelect:hover {
    border-color: #cbd5e1;
}

#sortSelect:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
