/* This file is for global HTML elements (body, links, typography, tables, forms, alerts) */

/* ===========================
   GLOBAL
=========================== */

body {
    font-family: "Inter", sans-serif;
    background: var(--background);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

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

a:hover {
    color: #4338CA;
}

.text-muted {
    color: #6B7280;
}

.text-muted-small {
    color: #6B7280;
    font-size: 0.9rem;
}

/* ===========================
   TYPOGRAPHY
=========================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

.page-title {
    margin-bottom: 2rem;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 700;
}


/* ===========================
   Bootstrap Form Overrides
=========================== */

.form-control,
.form-select,
textarea,
input {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

.form-control:focus,
.form-select:focus,
textarea:focus,
input:focus {
    background: var(--surface);
    color: var(--text);
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(79,70,229,0.15);
}

.form-control::placeholder,
textarea::placeholder {
    color: #9CA3AF;
}

.form-select {
    color: var(--text);
}

/* ===========================
   TABLES
=========================== */

table,
.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
}

.table {
    margin-bottom: 0;
    padding: 0.5rem;
}

.table td,
.table th {
    vertical-align: middle;
    padding: 1rem;
}

.table thead th {
    border-bottom-width: 1px;
    color: #6B7280;
    font-weight: 600;
}

.table tbody tr:nth-child(even) {
    background-color: rgba(79, 70, 229, 0.03);
}

.table tbody tr:hover {
    background-color: rgba(79, 70, 229, 0.06);
}

.table-hover tbody tr:hover {
    --bs-table-hover-bg: rgba(79,70,229,0.06);
}

/* ===========================
   FORMS
=========================== */

.form-control,
.form-select {
    border-radius: 10px;
    border: 1px solid var(--border);
    padding: 0.7rem 0.9rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}

form p {
    margin-bottom: 1.25rem;
}

form label {
    display: block;
    margin-bottom: 0.45rem;
    font-weight: 600;
    color: var(--text);
}

form input,
form select,
form textarea {
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    transition: 0.2s ease;
}

form textarea {
    min-height: 140px;
    resize: vertical;
}

form input:focus,
form select:focus,
form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(79, 70, 229, 0.15);
}

.helptext {
    display: block;
    margin-top: 0.35rem;
    color: #6B7280;
    font-size: 0.85rem;
}

.errorlist {
    list-style: none;
    padding-left: 0;
    margin: 0.4rem 0;
    color: var(--danger);
    font-size: 0.9rem;
}

/* ===========================
   List Groups
=========================== */

.list-group {
    --bs-list-group-bg: var(--surface);
    --bs-list-group-color: var(--text);
    --bs-list-group-border-color: var(--border);
}

.list-group-item {
    background: var(--surface);
    color: var(--text);
    border-color: var(--border);
}

/* ===========================
   ALERTS / MESSAGES
=========================== */

.alert {
    border: none;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
}

.sf-alert {
    border: none;
    border-left: 5px solid;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
}

.sf-alert i {
    font-size: 1.1rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.12);
    border-left-color: var(--success);
    color: #065F46;
}

.alert-error,
.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border-left-color: var(--danger);
    color: #991B1B;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-left-color: var(--warning);
    color: #92400E;
}

.alert-info {
    background: rgba(14, 165, 233, 0.12);
    border-left-color: var(--secondary);
    color: #0C4A6E;
}

.sf-alert {
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
