/**
 * Stebeg Theme for Bootstrap 5
 * Based on www.stebeg.de design language
 *
 * Colors:
 * - Primary: #D44400 (Orange/Red)
 * - Text: #4A4A4A (Dark Gray)
 * - Light Gray: rgba(216, 216, 216, 0.5)
 *
 * Typography:
 * - Primary: Cantarell (sans-serif)
 * - Secondary: Source Serif Pro (serif)
 */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cantarell:ital,wght@0,400;0,700;1,400;1,700&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;0,8..60,700;1,8..60,400&display=swap');

/* ================================
   CSS Custom Properties (Variables)
   ================================ */
:root {
    /* Stebeg Brand Colors */
    --stebeg-primary: #D44400;
    --stebeg-primary-hover: #B33B00;
    --stebeg-primary-light: rgba(212, 68, 0, 0.1);
    --stebeg-primary-alpha: rgba(212, 68, 0, 0.85);

    --stebeg-text: #4A4A4A;
    --stebeg-text-muted: #6c757d;
    --stebeg-light-bg: rgba(216, 216, 216, 0.5);
    --stebeg-white: #ffffff;
    --stebeg-dark: #212529;

    /* Bootstrap Override Variables */
    --bs-primary: var(--stebeg-primary);
    --bs-primary-rgb: 212, 68, 0;
    --bs-link-color: var(--stebeg-primary);
    --bs-link-hover-color: var(--stebeg-primary-hover);
    --bs-body-color: var(--stebeg-text);
    --bs-body-font-family: 'Cantarell', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Typography */
    --stebeg-font-primary: 'Cantarell', sans-serif;
    --stebeg-font-secondary: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
    --stebeg-line-height: 1.5;
}

/* ================================
   Base Typography
   ================================ */
body {
    font-family: var(--stebeg-font-primary);
    color: var(--stebeg-text);
    line-height: var(--stebeg-line-height);
    font-size: calc(16px + (18 - 16) * (100vw - 400px) / (1000 - 400));
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--stebeg-font-secondary);
    color: var(--stebeg-text);
    font-weight: 600;
}

/* Use primary color for important headings */
.text-primary-heading {
    color: var(--stebeg-primary);
}

/* ================================
   Bootstrap Component Overrides
   ================================ */

/* Buttons */
.btn-primary {
    --bs-btn-bg: var(--stebeg-primary);
    --bs-btn-border-color: var(--stebeg-primary);
    --bs-btn-hover-bg: var(--stebeg-primary-hover);
    --bs-btn-hover-border-color: var(--stebeg-primary-hover);
    --bs-btn-active-bg: var(--stebeg-primary-hover);
    --bs-btn-active-border-color: var(--stebeg-primary-hover);
    --bs-btn-disabled-bg: var(--stebeg-primary);
    --bs-btn-disabled-border-color: var(--stebeg-primary);
}

.btn-outline-primary {
    --bs-btn-color: var(--stebeg-primary);
    --bs-btn-border-color: var(--stebeg-primary);
    --bs-btn-hover-bg: var(--stebeg-primary);
    --bs-btn-hover-border-color: var(--stebeg-primary);
    --bs-btn-active-bg: var(--stebeg-primary-hover);
    --bs-btn-active-border-color: var(--stebeg-primary-hover);
}

/* Links */
a {
    color: var(--stebeg-primary);
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

a:hover {
    color: var(--stebeg-primary-hover);
}

/* Navbar */
.navbar {
    background-color: var(--stebeg-primary-alpha) !important;
}

.navbar-brand {
    font-family: var(--stebeg-font-secondary);
    font-weight: 700;
    color: var(--stebeg-white) !important;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link:focus {
    color: var(--stebeg-white);
}

.navbar-dark .navbar-nav .nav-link.active {
    color: var(--stebeg-white);
    font-weight: 600;
}

/* Cards */
.card {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: var(--stebeg-light-bg);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    font-family: var(--stebeg-font-secondary);
    font-weight: 600;
}

/* Tables */
.table {
    --bs-table-hover-bg: var(--stebeg-primary-light);
}

.table thead th {
    background-color: var(--stebeg-light-bg);
    font-weight: 600;
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
}

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

.form-check-input:checked {
    background-color: #198754;
    border-color: #198754;
}

.form-check-input:checked[type="checkbox"] {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}

.form-check-input:focus {
    border-color: var(--stebeg-primary);
    box-shadow: 0 0 0 0.25rem rgba(212, 68, 0, 0.25);
}

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

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

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

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

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

/* Progress bars */
.progress-bar {
    background-color: var(--stebeg-primary);
}

/* ================================
   Custom Components
   ================================ */

/* Message/Alert styling (Django messages) */
.messages-container {
    margin-bottom: 1.5rem;
}

.messages-container .alert {
    margin-bottom: 0.5rem;
}

/* Aside sections with light background */
.aside-section {
    background-color: var(--stebeg-light-bg);
    padding: 1.5rem;
    border-radius: 0.5rem;
}

/* Header accent bar */
.stebeg-accent-bar {
    height: 4px;
    background-color: var(--stebeg-primary);
}

/* Footer styling */
footer {
    background-color: var(--stebeg-light-bg);
    color: var(--stebeg-text-muted);
    padding: 1.5rem 0;
    margin-top: 3rem;
}

footer a {
    color: var(--stebeg-text-muted);
}

footer a:hover {
    color: var(--stebeg-primary);
}

/* ================================
   Utility Classes
   ================================ */

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

.text-stebeg-secondary {
    color: var(--stebeg-text-muted) !important;
}

/* Background colors */
.bg-stebeg-primary {
    background-color: var(--stebeg-primary) !important;
}

.bg-stebeg-light {
    background-color: var(--stebeg-light-bg) !important;
}

/* Font families */
.font-primary {
    font-family: var(--stebeg-font-primary) !important;
}

.font-secondary {
    font-family: var(--stebeg-font-secondary) !important;
}

/* ================================
   Responsive Adjustments
   ================================ */

@media (max-width: 991.98px) {
    .navbar-collapse {
        background-color: var(--stebeg-primary-alpha);
        padding: 1rem;
        border-radius: 0 0 0.5rem 0.5rem;
        margin-top: 0.5rem;
    }
}

@media (max-width: 575.98px) {
    body {
        font-size: 16px;
    }

    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
}
