@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');

/* ======================================================================
    1. ZMIENNE GŁÓWNE (COLOR PALETTE)
    ====================================================================== */
:root {
    --primary-color: #eb5627;
    --primary-hover: #d44a1a;
    --background-dark: #1a1a1d;
    --background-light: #2c2c34;
    --background-card: #2c2c34;
    --text-color: #f4f4f4;
    --text-muted: #a9a9a9;
    --border-color: #444;
    --discord-color: #7289DA;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --code-background: #1e1e1e;

    --transition-speed: 0.3s;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Light Mode Variables */
body.light-mode {
    --background-dark: #ffffff;
    --background-light: #f8f9fa;
    --background-card: #ffffff;
    --text-color: #212529;
    --text-muted: #6c757d;
    --border-color: #dee2e6;
    --code-background: #f8f9fa;
}

/* ======================================================================
    2. RESET I BAZOWE STYLE
    ====================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--background-dark);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.container {
    max-width: 1200px;
    width: 90%;
    margin-left: auto;
    margin-right: auto;
    padding: 0 15px;
}

/* ======================================================================
    3. HEADER I NAWIGACJA
    ====================================================================== */
.main-header {
    background-color: var(--background-light);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: transform var(--transition-speed);
}

.logo:hover {
    transform: scale(1.05);
}

.logo .logo-icon {
    height: 2.5rem;
    width: auto;
    margin-right: 0.5rem;
}

.logo span {
    color: var(--primary-color);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 0.5rem;
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: color var(--transition-speed), background-color var(--transition-speed);
    border-radius: var(--border-radius);
}

.main-nav a:hover, .main-nav a.active {
    color: var(--primary-color);
    background-color: rgba(235, 86, 39, 0.1);
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-speed);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: rotate(20deg);
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1100;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1.5rem;
    box-shadow: var(--box-shadow);
}

.mobile-menu-close {
    display: none;
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-color);
    font-size: 2rem;
    cursor: pointer;
}

/* ======================================================================
    4. GŁÓWNA TREŚĆ I UKŁAD
    ====================================================================== */
.main-content {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

.main-content .container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.articles {
    flex: 3;
}

.sidebar {
    flex: 1;
    position: sticky;
    top: 100px;
}

.articles-full-width {
    width: 100%;
}

/* Filter Tags */
.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--background-card);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.tag-filter {
    padding: 0.5rem 1rem;
    background-color: var(--background-dark);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-size: 0.9rem;
}

.tag-filter:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.tag-filter.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ======================================================================
    5. KARTY ARTYKUŁÓW
    ====================================================================== */
.article-card {
    background-color: var(--background-card);
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 2.5rem;
    transition: all var(--transition-speed);
    border: 1px solid var(--background-card);
    box-shadow: var(--box-shadow);
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
    border-color: var(--primary-color);
}

.article-card.expanded {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(235, 86, 39, 0.3);
}

.article-card .category {
    display: inline-block;
    font-size: 0.85rem;
    color: white;
    background-color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.article-card h2 {
    font-size: 1.6rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
    line-height: 1.3;
}

.article-card h2 a {
    color: var(--text-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.article-card h2 a:hover {
    color: var(--primary-color);
}

.article-card h3 {
    font-size: 1.3rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.article-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.article-meta i {
    margin-right: 0.25rem;
}

.article-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    background: linear-gradient(90deg, var(--background-light) 25%, var(--background-dark) 50%, var(--background-light) 75%);
    background-size: 200% 100%;
}

.article-excerpt {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.full-content {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px dashed var(--border-color);
}

.full-content p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.full-content ul, .full-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.full-content li {
    margin-bottom: 0.5rem;
}

/* Article Actions */
.article-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition-speed);
}

.read-more:hover {
    gap: 1rem;
    color: var(--primary-hover);
}

.share-btn {
    background-color: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.share-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: rgba(235, 86, 39, 0.1);
}

/* Test Results Styling */
.test-results {
    background-color: var(--background-dark);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
}

.result-item i {
    font-size: 1.5rem;
}

.result-item .fa-check-circle {
    color: var(--success-color);
}

.result-item .fa-exclamation-circle {
    color: var(--warning-color);
}

/* ======================================================================
    6. SIDEBAR WIDGETS
    ====================================================================== */
.widget {
    background-color: var(--background-card);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--box-shadow);
}

.widget h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--primary-color);
    padding-left: 0.75rem;
    color: var(--text-color);
}

/* Search Widget */
.search-wrapper {
    position: relative;
}

.search-wrapper input {
    width: 100%;
    padding: 0.8rem 2.5rem 0.8rem 0.8rem;
    border: 1px solid var(--border-color);
    background-color: var(--background-dark);
    color: var(--text-color);
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(235, 86, 39, 0.1);
}

.search-wrapper i {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

/* Newsletter Widget */
.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.newsletter-form input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    background-color: var(--background-dark);
    color: var(--text-color);
    border-radius: var(--border-radius);
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Categories Widget */
.categories-list {
    list-style: none;
}

.categories-list li {
    margin-bottom: 0.75rem;
}

.categories-list a {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    border-radius: var(--border-radius);
    transition: all var(--transition-speed);
}

.categories-list a:hover {
    background-color: var(--background-dark);
    color: var(--primary-color);
    padding-left: 1rem;
}

.categories-list i {
    margin-right: 0.5rem;
    width: 20px;
}

.categories-list span {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Tools Widget */
.tool-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background-color: var(--background-dark);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-color);
    transition: all var(--transition-speed);
    border: 1px solid var(--border-color);
}

.tool-link:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.tool-link i {
    font-size: 2rem;
    color: var(--primary-color);
}

.tool-link strong {
    display: block;
    color: var(--text-color);
}

.tool-link span {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ======================================================================
    7. PRZYCISKI
    ====================================================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--transition-speed);
    cursor: pointer;
    border: none;
    box-shadow: var(--box-shadow);
}

.btn:active {
    transform: translateY(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--background-dark);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background-color: var(--primary-color);
    color: white;
}

/* ======================================================================
    8. FOOTER
    ====================================================================== */
.main-footer {
    background-color: var(--background-light);
    padding: 3rem 0 1rem;
    margin-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section p {
    color: var(--text-muted);
    line-height: 1.8;
}

.footer-section ul {
    list-style: none;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.footer-section a:hover {
    color: var(--primary-color);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--background-dark);
    border-radius: 50%;
    color: var(--text-color);
    transition: all var(--transition-speed);
}

.social-links a:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ======================================================================
    9. CODE BLOCKS (PRISM)
    ====================================================================== */
.code-block-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.code-block-wrapper pre {
    padding-top: 2.5em !important;
    border-radius: 8px;
}

.copy-button {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 5px 10px;
    margin: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.2s;
    opacity: 0.8;
    z-index: 10;
}

.copy-button:hover {
    background-color: var(--primary-hover);
    opacity: 1;
}

.copy-button i {
    margin-right: 5px;
}

/* ======================================================================
    10. NO RESULTS MESSAGE
    ====================================================================== */
.no-results {
    background-color: var(--background-card);
    padding: 3rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 2px dashed var(--border-color);
}

.no-results p {
    color: var(--text-muted);
    font-size: 1.2rem;
}

/* ======================================================================
    11. RESPONSIVE DESIGN
    ====================================================================== */
@media (max-width: 992px) {
    .main-content .container {
        flex-direction: column;
    }

    .sidebar {
        position: static;
        width: 100%;
    }

    .filter-tags {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background-color: var(--background-light);
        flex-direction: column;
        padding: 4rem 2rem 2rem;
        transition: right var(--transition-speed);
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
        z-index: 1050;
    }

    .main-nav.active {
        right: 0;
    }

    .mobile-menu-close {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        width: 100%;
        gap: 0;
    }

    .main-nav a {
        display: block;
        width: 100%;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
    }

    .theme-toggle {
        width: 100%;
        border-radius: var(--border-radius);
        justify-content: flex-start;
        padding: 1rem;
    }

    .logo {
        font-size: 1.3rem;
    }

    .logo .logo-icon {
        height: 2rem;
    }

    .article-card {
        padding: 1.5rem;
    }

    .article-card h2 {
        font-size: 1.3rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        width: 95%;
    }

    .filter-tags {
        gap: 0.5rem;
    }

    .tag-filter {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}