﻿:root {
    --bg-color: #ffffff;
    --text-color: #212529;
    --link-color: #0077cc;
    --border-color: #e5e5e5;
    --navbar-bg: #ffffff;
    --footer-bg: #f8f9fa;
    --card-bg: #ffffff;
    --shadow: rgba(0, 0, 0, 0.05);
    --primary-color: #1e40af;
    --text-muted: #6b7280;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #e4e4e4;
    --link-color: #4da6ff;
    --border-color: #333333;
    --navbar-bg: #212121;
    --footer-bg: #151515;
    --card-bg: #242424;
    --shadow: rgba(0, 0, 0, 0.3);
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin-bottom: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--link-color);
    transition: color 0.2s ease;
}

    a:hover {
        color: var(--link-color);
        opacity: 0.8;
    }

img {
    max-width: 100%;
    height: auto;
}

.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

    .preloader.hidden {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }

.loader {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    color: var(--primary-color);
    position: relative;
}

    .loader::before {
        content: '< HamzaBravo />';
        animation: typing 2s steps(15) infinite;
        display: block;
        overflow: hidden;
        white-space: nowrap;
        border-right: 3px solid var(--primary-color);
        width: 0;
    }

@keyframes typing {
    0%, 100% {
        width: 0;
    }

    50% {
        width: 15ch;
    }
}


.navbar {
    background-color: var(--navbar-bg) !important;
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.3s ease;
}

.navbar-nav .nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

    .navbar-nav .nav-link:hover {
        color: var(--primary-color) !important;
    }

.navbar-social-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 1.1rem;
}

    .navbar-social-icon:hover {
        background: var(--primary-color);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
    }

[data-theme="dark"] .navbar-social-icon {
    background: rgba(59, 130, 246, 0.15);
}

.footer {
    background-color: var(--footer-bg);
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
    transition: background-color 0.3s ease;
}

footer a:hover {
    color: var(--primary-color) !important;
    text-decoration: underline;
}

.footer-tech-tag {
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-color);
    border-radius: 12px;
    font-size: 0.85rem;
    transition: all 0.3s;
    display: inline-block;
}

    .footer-tech-tag:hover {
        background: var(--primary-color) !important;
        color: white !important;
        transform: translateY(-2px);
        cursor: default;
    }

.social-icon:hover {
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 6px 16px rgba(30, 64, 175, 0.4);
}

.social-icon[href*="wa.me"]:hover {
    background: #25d366 !important;
    color: white !important;
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.4);
}

.social-icon:not([href*="wa.me"]):hover {
    background: var(--primary-color) !important;
    color: white !important;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.theme-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--card-bg);
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    box-shadow: 0 4px 6px var(--shadow);
    transition: all 0.3s ease;
    z-index: 1000;
}

    .theme-toggle:hover {
        transform: scale(1.1);
        box-shadow: 0 6px 12px var(--shadow);
    }

.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 999;
    padding: 1em;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

    .skip-link:focus {
        left: 50%;
        transform: translateX(-50%);
        top: 10px;
    }

.lazy-load {
    opacity: 0;
    transition: opacity 0.3s;
}

    .lazy-load.loaded {
        opacity: 1;
    }

.border-top {
    border-top: 1px solid var(--border-color) !important;
}

.border-bottom {
    border-bottom: 1px solid var(--border-color) !important;
}

.text-muted {
    color: var(--text-color) !important;
    opacity: 0.7;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.blog-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

    .blog-content h1,
    .blog-content h2,
    .blog-content h3 {
        margin-top: 2rem;
        margin-bottom: 1rem;
        font-weight: 700;
        color: var(--text-color);
    }

    .blog-content h1 {
        font-size: 2rem;
    }

    .blog-content h2 {
        font-size: 1.6rem;
    }

    .blog-content h3 {
        font-size: 1.3rem;
    }

    .blog-content p {
        margin-bottom: 1rem;
    }

    .blog-content ul,
    .blog-content ol {
        margin-left: 2rem;
        margin-bottom: 1rem;
    }

    .blog-content img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
        margin: 1.5rem 0;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    }

    .blog-content code {
        background: rgba(59, 130, 246, 0.1);
        padding: 2px 6px;
        border-radius: 4px;
        font-family: 'Courier New', monospace;
        color: var(--primary-color);
    }

    .blog-content pre {
        background: #1e1e1e;
        color: #d4d4d4;
        padding: 1rem;
        border-radius: 8px;
        overflow-x: auto;
        margin: 1.5rem 0;
    }

    .blog-content blockquote {
        border-left: 4px solid var(--primary-color);
        padding-left: 1rem;
        margin: 1.5rem 0;
        color: var(--text-muted);
        font-style: italic;
    }

    .blog-content a {
        color: var(--primary-color);
        text-decoration: underline;
    }

    .blog-content table {
        width: 100%;
        border-collapse: collapse;
        margin: 1.5rem 0;
    }

        .blog-content table th,
        .blog-content table td {
            border: 1px solid var(--border-color);
            padding: 0.75rem;
            text-align: left;
        }

        .blog-content table th {
            background: rgba(59, 130, 246, 0.1);
            font-weight: 600;
        }

@media (max-width: 576px) {
    .navbar-social-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .navbar-nav > li:last-child > div {
        flex-wrap: wrap;
        justify-content: center;
        padding: 10px 0;
    }
}

@media (max-width: 768px) {
    .blog-detail > div > .container-custom > div {
        grid-template-columns: 1fr !important;
    }

    .blog-detail aside {
        position: static !important;
    }

    .blog-header h1 {
        font-size: 1.8rem !important;
    }

    .blog-header > .container-custom {
        padding: 20px !important;
    }

    .blog-detail img[alt] {
        max-height: 300px !important;
    }
}

@media (max-width: 992px) {
    .blog-detail > div > .container-custom > div {
        grid-template-columns: 1fr !important;
        gap: 40px;
    }

    .blog-sidebar {
        position: static !important;
    }

    .related-blogs-sidebar {
        display: none !important;
    }

    .related-blogs-mobile {
        display: block !important;
    }
}

@media (min-width: 993px) {
    .related-blogs-mobile {
        display: none !important;
    }
}
