@font-face {
    font-family: 'Carlito';
    src: url('../fonts/Carlito-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Carlito';
    src: url('../fonts/Carlito-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Carlito';
    src: url('../fonts/Carlito-Italic.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}

@font-face {
    font-family: 'Carlito';
    src: url('../fonts/Carlito-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}

:root {
    --mipe-primary: #cd2653;
    --mipe-bg: #f5efe0;
    --mipe-text: #000000;
    --mipe-secondary: #6d6d6d;
    --mipe-border: #dcd7ca;
    --mipe-white: #ffffff;
}

body {
    background-color: var(--mipe-bg);
    color: var(--mipe-text);
    font-family: Carlito, Calibri, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* Navbar */
.navbar {
    background-color: var(--mipe-white) !important;
    border-bottom: 4px solid var(--mipe-primary);
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
}

.navbar-brand {
    color: var(--mipe-primary) !important;
    font-weight: 700;
    font-size: 1.4rem;
}

.nav-link {
    color: var(--mipe-text) !important;
    font-size: 1.05rem;
}

.nav-link:hover, .nav-link.active {
    color: var(--mipe-primary) !important;
}

/* Content */
.content-wrapper {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* Cards */
.card {
    border: 1px solid var(--mipe-border);
    background-color: var(--mipe-white);
}

.card-header {
    background-color: var(--mipe-primary);
    color: var(--mipe-white);
    font-weight: 600;
}

/* Summary tables */
.table-summary {
    font-size: 0.85rem;
}

.table-summary th {
    background-color: var(--mipe-primary);
    color: var(--mipe-white);
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
}

.table-summary td {
    text-align: center;
    vertical-align: middle;
}

.table-summary td a {
    color: var(--mipe-primary);
    text-decoration: none;
    font-weight: 500;
}

.table-summary td a:hover {
    text-decoration: underline;
}

.table-summary tfoot th,
.table-summary tfoot td {
    font-weight: 700;
}

/* Links */
a {
    color: var(--mipe-primary);
}

a:hover {
    color: #a11d42;
}

/* Buttons */
.btn-mipe {
    background-color: var(--mipe-primary);
    border-color: var(--mipe-primary);
    color: var(--mipe-white);
}

.btn-mipe:hover {
    background-color: #a11d42;
    border-color: #a11d42;
    color: var(--mipe-white);
}

/* Thesis list items */
.thesis-item {
    border-bottom: 1px solid var(--mipe-border);
    padding: 1.2rem 0;
}

.thesis-item h5 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

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

.thesis-item h5 a {
    color: var(--mipe-primary);
    text-decoration: none;
}

.thesis-item h5 a:hover {
    text-decoration: underline;
}

.thesis-meta {
    font-size: 0.9rem;
    color: var(--mipe-secondary);
}

/* Badge */
.badge-defended {
    background-color: #28a745;
    color: #fff;
}

.badge-inprogress {
    background-color: #ffc107;
    color: #000;
}

/* Search */
.search-box {
    max-width: 600px;
}

/* HTMX loading */
.htmx-indicator {
    display: none;
}

.htmx-request .htmx-indicator {
    display: inline-block;
}

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

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

.footer {
    background-color: var(--mipe-primary);
    color: var(--mipe-white);
    font-size: 0.85rem;
    padding: 1.5rem 0;
    margin-top: 2rem;
}

.footer a {
    color: var(--mipe-white);
}

.footer a:hover {
    color: var(--mipe-bg);
}

/* Backoffice */
.backoffice-nav {
    background-color: var(--mipe-white);
    border: 1px solid var(--mipe-border);
    border-radius: 0.25rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

/* Language switcher */
.lang-switch .btn {
    font-size: 0.8rem;
    padding: 0.15rem 0.5rem;
}

/* Responsive table */
@media (max-width: 768px) {
    .table-summary {
        font-size: 0.75rem;
    }

    .table-summary th,
    .table-summary td {
        padding: 0.3rem;
    }
}

/* Filters */
.active-filters {
    background-color: var(--mipe-white);
    border: 1px solid var(--mipe-border);
    border-radius: 0.25rem;
    padding: 0.75rem;
    margin-bottom: 1rem;
}
