:root {
    /* Premium Color Palette */
    --primary-color: #0f172a; /* Slate 900 */
    --secondary-color: #334155; /* Slate 700 */
    --accent-color: #3b82f6; /* Blue 500 */
    --accent-hover: #2563eb; /* Blue 600 */
    --success-color: #10b981; /* Emerald 500 */
    --warning-color: #f59e0b; /* Amber 500 */
    --danger-color: #ef4444; /* Red 500 */
    --info-color: #0ea5e9; /* Sky 500 */
    --light-bg: #f8fafc; /* Slate 50 */
    --card-bg: #ffffff;
    --text-main: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */

    /* User Template Specific Variables */
    --color-gold: #d4af37;
    --color-gold-hover: #b5952f;
    --color-dark: #1a1a1a;
    --color-gray-dark: #2d2d2d;
    --color-gray-light: #e5e5e5;
    --color-gray-muted: #9ca3af;
    --color-red: #ef4444;
    --color-red-dark: #7f1d1d;
    --color-yellow: #eab308;
    --color-yellow-dark: #713f12;

    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* 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 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
}

body {
    background-color: var(--light-bg);
    color: var(--text-main);
    font-family: 'Inter', sans-serif; /* Assuming Inter is loaded or generic sans-serif */
}

/* Custom Card */
.premium-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    border: 1px solid rgba(0,0,0,0.05);
    overflow: hidden;
}

.premium-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

/* Buttons */
.btn-premium {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all var(--transition-fast);
    cursor: pointer;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-premium-accent {
    background-color: var(--accent-color);
    color: white;
}
.btn-premium-accent:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Toast/Alert Container */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Toast Item */
.brand-toast {
    min-width: 300px;
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: slideIn 0.3s ease forwards;
    border-left: 4px solid var(--accent-color);
}

.brand-toast.success { border-left-color: var(--success-color); }
.brand-toast.error { border-left-color: var(--danger-color); }
.brand-toast.warning { border-left-color: var(--warning-color); }
.brand-toast.info { border-left-color: var(--info-color); }

.brand-toast-content {
    font-size: 0.95rem;
    color: var(--text-main);
    font-weight: 500;
}

.brand-toast-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    margin-left: 10px;
}
.brand-toast-close:hover { color: var(--text-main); }

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    to { opacity: 0; transform: translateX(20px); }
}

/* Popup Overlay */
.blog-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.blog-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.blog-popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    transform: scale(0.9);
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.blog-popup-overlay.active .blog-popup-content {
    transform: scale(1);
}

.blog-popup-image {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    cursor: pointer;
}

.blog-popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-main);
    box-shadow: var(--shadow-md);
    cursor: pointer;
    border: 2px solid var(--primary-color);
    opacity: 0;
    transform: scale(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 10;
}


/* Blog Content Legacy Support */

/* Blog Content Legacy Support */
.blog-content {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-main); /* Use variable instead of hardcoded color */
}

.blog-content h1, 
.blog-content h2, 
.blog-content h3, 
.blog-content h4, 
.blog-content h5, 
.blog-content h6 {
    color: var(--primary-color);
    font-weight: 700;
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.blog-content h2 { font-size: 1.75rem; border-bottom: 2px solid #e5e7eb; padding-bottom: 0.5rem; }
.blog-content h3 { font-size: 1.5rem; }
.blog-content h4 { font-size: 1.25rem; }

.blog-content p {
    margin-bottom: 1.5rem;
}

.blog-content strong, 
.blog-content b {
    font-weight: 700;
    color: inherit; /* Inherit form parent for dark mode comp */
}

.blog-content ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.blog-content ol {
    list-style-type: decimal;
    padding-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.blog-content li {
    margin-bottom: 0.5rem;
}

.blog-content a {
    color: var(--accent-color);
    text-decoration: underline;
    transition: color 0.2s;
}

.blog-content a:hover {
    color: var(--accent-hover);
}

.blog-content img {
    max-width: 100%;
    height: auto !important;
    border-radius: 8px;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-md);
    background-color: #fff;
}

/* Responsive Table Styling */
.blog-content table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    background: var(--card-bg); /* Variable */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    color: var(--text-main);
}

.blog-content table th,
.blog-content table td {
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    text-align: left;
}

.blog-content table th {
    background-color: var(--light-bg); /* Variable */
    font-weight: 600;
    color: var(--secondary-color);
}

/* Dark Mode Overrides */
html.dark .blog-content h2 { border-color: #374151; }
html.dark .blog-content table th, 
html.dark .blog-content table td { border-color: #374151; }
html.dark .blog-content table th { background-color: #1e293b; color: #e2e8f0; }
html.dark .blog-content table tr:nth-child(even) { background-color: #1e293b; }
html.dark .blog-content img { background-color: transparent; }

/* Bootstrap 5 Compatibility Layer for Legacy Content */
.blog-content .row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
}

.blog-content .col-md-4,
.blog-content .col-md-6,
.blog-content .col-md-8 {
    position: relative;
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
}

@media (min-width: 768px) {
    .blog-content .col-md-4 { flex: 0 0 33.333333%; max-width: 33.333333%; }
    .blog-content .col-md-6 { flex: 0 0 50%; max-width: 50%; }
    .blog-content .col-md-8 { flex: 0 0 66.666667%; max-width: 66.666667%; }
}

/* Cards */
.blog-content .card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    word-wrap: break-word;
    background-color: var(--card-bg);
    background-clip: border-box;
    border: 1px solid rgba(0,0,0,.125);
    border-radius: 0.25rem;
    margin-bottom: 1.5rem;
}

html.dark .blog-content .card {
    background-color: #1e293b;
    border-color: #374151;
}

.blog-content .card-body {
    flex: 1 1 auto;
    padding: 1rem 1rem;
}

.blog-content .card-title {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

/* Utilities */
.blog-content .text-center { text-align: center !important; }
.blog-content .fw-bold { font-weight: 700 !important; }
.blog-content .text-muted { color: var(--text-muted) !important; }
.blog-content .text-decoration-none { text-decoration: none !important; }
.blog-content .w-100 { width: 100% !important; }
.blog-content .img-fluid { max-width: 100%; height: auto; }
.blog-content .rounded { border-radius: 0.25rem !important; }
.blog-content .shadow-sm { box-shadow: 0 .125rem .25rem rgba(0,0,0,.075) !important; }

/* Spacing */
.blog-content .mt-3 { margin-top: 1rem !important; }
.blog-content .mt-4 { margin-top: 1.5rem !important; }
.blog-content .mt-5 { margin-top: 3rem !important; }
.blog-content .mb-3 { margin-bottom: 1rem !important; }
.blog-content .mb-4 { margin-bottom: 1.5rem !important; }
.blog-content .my-4 { margin-top: 1.5rem !important; margin-bottom: 1.5rem !important; }

/* List Groups */
.blog-content .list-group {
    display: flex;
    flex-direction: column;
    padding-left: 0;
    margin-bottom: 0;
    border-radius: 0.25rem;
}

.blog-content .list-group-item {
    position: relative;
    display: block;
    padding: 0.5rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    background-color: var(--card-bg);
    border: 1px solid rgba(0,0,0,.125);
}

html.dark .blog-content .list-group-item {
    background-color: #1e293b;
    border-color: #374151;
    color: #f8fafc;
}

/* ========================================= */
/*       NEW USER BLOG TEMPLATE STYLES       */
/* ========================================= */

/* Typography Utils */
.text-gold, .blog-content .text-gold { color: var(--color-gold); }
.text-gray, .blog-content .text-gray { color: var(--color-gray-muted); }
.text-red, .blog-content .text-red { color: var(--color-red); }
.text-yellow, .blog-content .text-yellow { color: var(--color-yellow); }
.leading-relaxed { line-height: 1.75; }

/* Components */
.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: border-color 0.3s;
    margin-bottom: 1rem;
}

html.dark .glass-panel {
    background: rgba(255, 255, 255, 0.05); /* Proper dark mode glass */
}
html:not(.dark) .glass-panel {
    background: rgba(0, 0, 0, 0.05); /* Light mode equivalent */
    border-color: rgba(0,0,0,0.1);
}

.glass-panel:hover {
    border-color: rgba(212, 175, 55, 0.3);
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
    color: var(--color-gray-muted);
    margin-bottom: 1.5rem;
}

.breadcrumbs svg {
    width: 0.75rem;
    height: 0.75rem;
    margin: 0 0.75rem;
    fill: currentColor;
}

.breadcrumbs a:hover {
    color: var(--color-gold);
}

.breadcrumbs span.current {
    color: var(--color-gold);
}

/* Hero Image */
.hero-image-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-image {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-radius: var(--radius-md);
    background-color: var(--color-gray-dark);
}

/* TOC */
.toc-box {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid #374151;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-bottom: 2rem;
}

html:not(.dark) .toc-box {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.toc-list li a {
    display: block;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #374151;
    color: var(--text-main);
}

.toc-list li a:hover {
    color: var(--color-gold);
    border-color: var(--color-gold);
}

.toc-list li:last-child a {
    border-bottom: none;
}

/* Content Cards */
.card-red {
    background: rgba(127, 29, 29, 0.1);
    border: 1px solid rgba(185, 28, 28, 0.3);
}

.border-l-gold {
    border-left: 4px solid var(--color-gold);
}

.border-l-red {
    border-left: 4px solid var(--color-red);
}

/* Warning Lists */
.warning-list li {
    margin-bottom: 1rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.warning-yellow {
    background: rgba(113, 63, 18, 0.2);
    border: 1px solid rgba(161, 98, 7, 0.3);
}
html:not(.dark) .warning-yellow {
    background: rgba(253, 224, 71, 0.3);
    border-color: #eab308;
}


.warning-red {
    background: rgba(127, 29, 29, 0.2);
    border: 1px solid rgba(185, 28, 28, 0.3);
}
html:not(.dark) .warning-red {
    background: rgba(252, 165, 165, 0.3);
    border-color: #ef4444;
}

.warning-icon {
    font-size: 1.8rem;
    line-height: 1;
}

/* Product Box */
.product-box {
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.5);
    padding: 1.25rem;
    border-radius: var(--radius-lg);
    margin: 1.5rem 0;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

@media(min-width: 768px) {
    .product-box {
        flex-direction: row;
        align-items: center;
    }
}

.product-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--color-gold);
    color: #000;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-bottom-left-radius: var(--radius-md);
}

.product-img {
    width: 6rem;
    height: 6rem;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05); /* Glass effect */
    padding: 0.25rem;
    border-radius: 0.25rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
}
html:not(.dark) .product-img {
    background: #fff;
}

.btn-product {
    display: inline-block;
    background: var(--color-gold);
    color: #000;
    font-weight: 700;
    padding: 0.75rem 1.25rem;
    border-radius: 0.25rem;
    box-shadow: 0 10px 15px -3px rgba(212, 175, 55, 0.2);
    transition: all 0.2s;
    text-decoration: none;
}

.btn-product:hover {
    background: #fff;
    transform: scale(1.05);
}

/* Video Card */
.video-card {
    display: block;
    margin: 1.5rem 0;
    position: relative;
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid #374151;
    background: #111827;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.video-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.video-card:hover .video-thumb {
    opacity: 0.8;
}

.play-btn-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-btn {
    width: 5rem;
    height: 5rem;
    background: rgba(220, 38, 38, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}

.video-card:hover .play-btn {
    transform: scale(1.1);
}

.play-btn svg {
    width: 2.5rem;
    height: 2.5rem;
    fill: #fff;
    margin-left: 0.25rem;
}

.video-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, #000, rgba(0, 0, 0, 0.6), transparent);
}

.video-tag {
    background: var(--color-red);
    color: #fff;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 700;
    margin-right: 0.5rem;
}

/* References & Related */
.references-box {
    background: rgba(26, 26, 26, 0.5);
    border: 1px solid #1f2937;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    margin-top: 3rem;
}

.ref-link {
    border-bottom: 1px solid #374151;
    padding-bottom: 2px;
}

.ref-link:hover {
    border-color: var(--color-gold);
    color: var(--color-gold);
}

.related-card {
    display: block;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    transition: border-color 0.2s;
}

.related-card:hover {
    border-color: var(--color-gold);
}

.related-card:hover h4 {
    color: var(--color-gold);
}

/* Service Steps */
.service-steps li {
    list-style-type: decimal;
    margin-left: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
}

/* Rodaj Grid */
.icon-lg {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* FAQ */
.faq-item {
    margin-bottom: 1rem;
}

.faq-q {
    cursor: pointer;
    margin-top: 0 !important;
}

/* Utility Overrides for User Content */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

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

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