/*
   static/css/brand.css
   Core Visual Identity for AlgorithmicFIRE
*/

:root {
    --brand-red: #E3120B;
    --brand-red-hover: #c41009;
    --brand-red-focus: #b00e08;
    --body-bg: #ffffff;
    --text-dark: #2c2c2c;
    --text-muted: #777;
    --font-family: 'Roboto Mono', monospace;
}

body {
    font-family: var(--font-family) !important;
    background-color: var(--body-bg);
    color: var(--text-dark);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Common Typography */
h1,
h2,
h3,
h4,
h5,
h6,
.btn,
.nav-link,
.card-title,
.lead {
    font-family: var(--font-family) !important;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
}

h2 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 1.25rem;
}

h3 {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

/* Global Link Styling */
a {
    color: var(--brand-red);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--brand-red-hover);
}

.text-decoration-underline {
    text-decoration: underline !important;
}

/* Brand Button Overrides */
.btn-primary {
    background-color: var(--brand-red) !important;
    border-color: var(--brand-red) !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--brand-red-hover) !important;
    border-color: var(--brand-red-focus) !important;
}

.btn-danger {
    background-color: var(--brand-red) !important;
    border-color: var(--brand-red) !important;
}

.btn-outline-danger {
    color: var(--brand-red);
    border-color: var(--brand-red);
}

.btn-outline-danger:hover {
    background-color: var(--brand-red);
    color: #fff;
}

/* Utility Classes */
.text-primary,
.text-danger {
    color: var(--brand-red) !important;
}

.hover-primary:hover {
    color: var(--brand-red) !important;
}

/* Layout Elements */
.navbar {
    background-color: #000;
    border-bottom: 4px solid var(--brand-red);
    padding: 0.2rem 1rem;
}

.navbar-brand img {
    max-height: 35px;
    width: auto;
    display: block;
}

.footer {
    margin-top: auto;
    background-color: #000;
    color: #fff;
    padding: 20px 0;
    text-align: center;
    font-size: 0.9em;
    border-top: 4px solid var(--brand-red);
}

.main-content {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

/* Image Handling */
img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 767.98px) {
    .navbar-brand img {
        max-height: 30px;
        width: auto;
        max-width: 100%;
    }

    .navbar-brand {
        margin-right: 0.5rem;
        max-width: 55%;
        flex-shrink: 1;
    }

    .navbar-toggler {
        flex-shrink: 0;
    }

    /* Force vertical stacking for menu items */
    .navbar-collapse {
        text-align: center;
        width: 100%;
    }

    .navbar-nav {
        flex-direction: column !important;
        padding-bottom: 0.1rem;
    }

    .nav-item {
        padding: 0.1rem 0;
        border-bottom: 1px solid #333;
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    /* Responsive Table Styles */
    .responsive-table thead {
        display: none;
    }

    .responsive-table,
    .responsive-table tbody,
    .responsive-table tr,
    .responsive-table td {
        display: block;
        width: 100%;
    }

    .responsive-table tr {
        margin-bottom: 1.5rem;
        border: 1px solid #ddd;
        border-radius: 4px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    }

    .responsive-table td {
        text-align: right;
        padding-left: 50%;
        position: relative;
        border-bottom: 1px solid #eee;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 12px;
    }

    .responsive-table td:last-child {
        border-bottom: none;
    }

    .responsive-table td::before {
        content: attr(data-label);
        font-weight: 700;
        margin-right: auto;
        /* Pushes the label to the left */
        padding-right: 15px;
        color: #555;
    }
}

/* Fix for sticky navbar covering anchor links */
:target {
    scroll-margin-top: 70px;
}