/* ===== Bootstrap Theme Override ===== */
:root {
    /* Primary Color Variables */
    --bs-primary: #ffa64d;
    --bs-primary-rgb: 255, 166, 77;
    --bs-primary-bg-subtle: #fff3e6;
    --bs-primary-border-subtle: #ffd9b3;
    --bs-primary-text-emphasis: #994d00;
    
    /* Theme Colors */
    --primary: #ffa64d;
    --primary-hover: #e68a00;
    --primary-light: #ffd9b3;
    --primary-dark: #cc7a00;
    --text-on-primary: #ffffff;
    --text-on-light: #333333;
    --border-radius: 6px;
    --transition: all 0.2s ease-in-out;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    transition: var(--transition);
    padding: 0.5rem 1.25rem;
    font-weight: 500;
}

.btn-primary {
    --bs-btn-bg: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary-hover);
    --bs-btn-hover-border-color: var(--primary-hover);
    --bs-btn-active-bg: var(--primary-dark);
    --bs-btn-active-border-color: var(--primary-dark);
    --bs-btn-disabled-bg: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
    color: var(--text-on-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--primary);
    --bs-btn-border-color: var(--primary);
    --bs-btn-hover-bg: var(--primary);
    --bs-btn-hover-border-color: var(--primary);
    --bs-btn-active-bg: var(--primary-dark);
    --bs-btn-active-border-color: var(--primary-dark);
    --bs-btn-disabled-color: var(--primary);
    --bs-btn-disabled-border-color: var(--primary);
    --bs-btn-hover-color: var(--text-on-primary);
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Navigation */
.nav-link {
    color: var(--text-on-light);
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
}

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

.nav-link.active {
    color: var(--primary-dark);
    font-weight: 600;
    background-color: var(--primary-light);
}

/* Cards */
.card {
    border: 1px solid var(--primary-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    border-color: var(--primary);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: var(--primary-light);
    border-bottom: 1px solid var(--primary-border-subtle);
    font-weight: 600;
}

/* Forms */
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(255, 166, 77, 0.25);
}

/* Alerts */
.alert-primary {
    --bs-alert-color: var(--primary-dark);
    --bs-alert-bg: var(--primary-light);
    --bs-alert-border-color: var(--primary-border-subtle);
}

/* Pagination */
.page-link {
    color: var(--primary);
    border-color: var(--primary-light);
}

.page-link:hover {
    background-color: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Backgrounds */
.bg-primary {
    --bs-bg-opacity: 1;
    background-color: var(--primary) !important;
    color: var(--text-on-primary);
}

/* Text Colors */
.text-primary {
    color: var(--primary) !important;
}

/* Badges */
.badge.bg-primary {
    background-color: var(--primary) !important;
}

/* ===== Base Styles ===== */
:root {
    --primary-color: #ffa64d;      /* Light orange */
    --primary-hover: #e68a00;      /* Darker orange for hover */
    --primary-light: #ffd9b3;      /* Very light orange for backgrounds */
    --primary-dark: #cc7a00;       /* Dark orange for text/accents */
    --secondary-color: #666666;    /* Neutral gray for secondary elements */
    --body-bg: #fff9f0;            /* Very light orange background */
    --card-bg: #ffffff;            /* White for cards/content areas */
    --text-color: #333333;         /* Dark gray for main text */
    --border-color: #ffd699;       /* Light orange border */
}

body { 
    background: var(--body-bg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s;
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ===== Layout ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.main-content {
    background: var(--card-bg);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-top: 20px;
    padding: 25px;
    border: 1px solid var(--border-color);
}

/* ===== Header & Navigation ===== */
/* ===== Link Styles ===== */
/* External Links */
a.external-link {
    position: relative;
    transition: color 0.2s ease-in-out;
}

a.external-link:hover {
    color: var(--primary-hover) !important;
    text-decoration: underline;
}

a.external-link i.bi-box-arrow-up-right {
    margin-left: 2px;
    opacity: 0.7;
    transition: opacity 0.2s ease-in-out;
}

a.external-link:hover i.bi-box-arrow-up-right {
    opacity: 1;
}

/* Affiliate Links */
a.affiliate-link {
    position: relative;
    font-weight: 500;
    border-bottom: 1px dashed var(--primary);
    text-decoration: none !important;
}

a.affiliate-link:hover {
    color: var(--primary-hover) !important;
    border-bottom-style: solid;
}

a.affiliate-link::after {
    content: '\f5d1';
    font-family: 'bootstrap-icons';
    font-size: 0.7em;
    margin-left: 3px;
    opacity: 0.7;
    vertical-align: super;
    line-height: 0;
}

/* Tooltip styles for links with title attribute */
[title] {
    position: relative;
    cursor: help;
}

[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 10px;
    background: #333;
    color: #fff;
    border-radius: 4px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
    opacity: 0.9;
}

/* Header Styles */
header.bg-primary {
    background-color: var(--primary-color) !important;
    background: var(--primary-color) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header .ad-space,
.sidebar .ad-space { 
    font-size: 1.1rem; 
    color: #fff;
}

.navbar {
    padding: 0.5rem 0;
    background: transparent !important;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.75rem;
    color: #fff !important;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.navbar-nav .nav-link {
    color: rgba(255,255,255,0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin: 0 0.25rem;
    transition: all 0.2s;
}

.navbar-nav .nav-link:hover {
    background: rgba(255,255,255,0.15);
    color: #fff !important;
}

.navbar-nav .nav-link.active {
    background: rgba(255,255,255,0.2);
    font-weight: 600;
}

/* ===== Cards ===== */
.card { 
    border: 1px solid var(--border-color);
    border-radius: .5rem;
    transition: all .3s ease;
    background: var(--card-bg);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 15px rgba(255, 166, 77, 0.2);
    border-color: var(--primary-color);
}

.card-img-top {
    height: 180px;
    object-fit: cover;
}

/* ===== Buttons ===== */
.btn {
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    color: #fff;
}

/* ===== Sidebar ===== */
.sidebar {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Sidebar Articles List */
.sidebar-articles-list {
    list-style: none;
    padding-left: 0;
    margin-bottom: 2rem;
}

.sidebar-articles-list li {
    margin-bottom: 0.5rem;
}

.sidebar-articles-list a {
    display: block;
    padding: 0.5rem 1rem;
    background: #f8f9fa;
    border-radius: 4px;
    color: #212529;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.sidebar-articles-list a:hover, 
.sidebar-articles-list a:focus {
    background: #007bff;
    color: #fff;
    box-shadow: 0 2px 8px rgba(0,123,255,0.10);
    text-decoration: none;
}

.sidebar-articles-list .article-date {
    font-size: 0.85em;
    color: #6c757d;
    margin-left: 0.5em;
}

/* ===== SSL Icons ===== */
.cert-icon {
    font-size: 1.4em;
    margin-right: 6px;
}

.cert-leaf { color: #0d6efd; }
.cert-intermediate { color: #ffc107; }
.cert-root { color: #28a745; }
.cert-invalid { color: #dc3545; }
.cert-valid { color: #28a745; }
.cert-warning { color: #ffc107; }

/* ===== Footer ===== */
footer {
    background: #f8f9fa;
    padding: 2rem 0;
    margin-top: 3rem;
    border-top: 1px solid #e9ecef;
}

footer a { 
    text-decoration: underline; 
}

footer .ratio { 
    border-radius: 8px; 
    overflow: hidden; 
}

/* ===== Utilities ===== */
.shadow-sm {
    box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.075) !important;
}

.rounded {
    border-radius: 6px !important;
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .main-content {
        padding: 15px;
    }
    
    .card-img-top {
        height: 160px;
    }
}

/* ===== Admin Overrides ===== */
.nav-pills .nav-link.active { 
    background: #0d6efd; 
}

/* ===== Article Specific ===== */
.article-featured-image img {
    max-width: 100%;
    height: auto;
    margin: 15px 0;
    border-radius: 6px;
}

/* ===== Hero Section ===== */
.hero-section {
    padding: 4rem 2rem;
    margin-bottom: 3rem;
    background-color: #e9ecef;
    border-radius: 0.3rem;
    text-align: center;
}

.hero-section h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

/* ===== Alert Messages ===== */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
}

.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

.alert-info {
    color: #055160;
    background-color: #cff4fc;
    border-color: #b6effb;
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.page-link {
    color: #0d6efd;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    margin: 0 0.25rem;
    border-radius: 4px;
}

.page-link:hover {
    color: #0a58ca;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

/* ===== Forms ===== */
.form-control {
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ced4da;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    color: #212529;
    background-color: #fff;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ===== Badges ===== */
.badge {
    padding: 0.35em 0.65em;
    font-size: 0.75em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 0.25rem;
}

.badge-primary {
    color: #fff;
    background-color: #0d6efd;
}

/* ===== Responsive Images ===== */
.img-fluid {
    max-width: 100%;
    height: auto;
}

/* ===== Text Utilities ===== */
.text-muted {
    color: #6c757d !important;
}

.text-primary {
    color: #0d6efd !important;
}

/* ===== Spacing Utilities ===== */
.mb-4 {
    margin-bottom: 1.5rem !important;
}

.mt-4 {
    margin-top: 1.5rem !important;
}

.py-4 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
}

/* ===== Additional Component Styles ===== */
.breadcrumb {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    background-color: #e9ecef;
    border-radius: 0.25rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    padding: 0 0.5rem;
}

/* ===== Print Styles ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        padding: 0.5in;
        font-size: 12pt;
        color: #000;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 80%;
    }
}
