/* =========================================================
   THEME VARIABLES
   ========================================================= */

:root {
    --beta-primary: #0d6efd;   /* Bootstrap primary blue */
    --beta-muted: #6c757d;
    --beta-bg-light: #f8f9fa;
    --beta-border: #e9ecef;
}

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

body {
    background-color: var(--beta-bg-light);
}

/* Standard container used everywhere */
.page-box {
    background-color: #ffffff;
    border-radius: 0.5rem;
    padding: 1.75rem;
    box-shadow: 0 0.25rem 0.75rem rgba(0, 0, 0, 0.05);
}

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

.page-box h1,
.page-box h2,
.page-box h3 {
    color: var(--beta-primary);
    font-weight: 600;
}

.page-box h4,
.page-box h5 {
    font-weight: 600;
}

.page-box .lead {
    font-size: 1.05rem;
}

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

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

.table th {
    vertical-align: middle;
}

.table td.vertical-top {
    vertical-align: top;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* =========================================================
   BUTTONS
   ========================================================= */

.icon-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.btn {
    font-weight: 500;
}

.btn-sm {
    padding: 0.25rem 0.6rem;
}

.btn-icon {
    padding: 0.25rem 0.45rem;
    line-height: 1;
}

.btn i {
    vertical-align: middle;
}

/* =========================================================
   LIST GROUPS (Resources)
   ========================================================= */

.list-group-item {
    border-radius: 0.4rem;
    margin-bottom: 0.5rem;
    border: 1px solid var(--beta-border);
}

.list-group-item:hover {
    background-color: #ffffff;
}

/* =========================================================
   RESOURCE DISPLAY (module.php)
   ========================================================= */

.resource-title {
    font-weight: 600;
    color: #212529;
}

.resource-author {
    font-weight: 400;
    color: #495057;
}

.resource-description {
    font-size: 0.9rem;
    color: var(--beta-muted);
    margin-top: 0.25rem;
}

.resource-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.resource-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.resource-pill {
    display: inline-flex;          /* instead of inline-block */
    align-items: center;           /* vertical centring of text */
    justify-content: center;

    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background-color: #0d6efd;     /* Bootstrap primary blue */
    color: #fff;

    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;

    line-height: 1.2;              /* prevents vertical stretching */
    height: fit-content;           /* key fix */
}

.resource-pill:hover {
    background-color: #0b5ed7;
    color: #fff;
    text-decoration: none;
}
/* =========================================================
   COLLAPSE / EXPAND (SUBTLE ANIMATION)
   ========================================================= */

/*
   Apply this class to the container being collapsed.
   Works with Bootstrap collapse OR manual toggling.
*/
.collapse,
.collapsing {
    transition: height 0.25s ease, opacity 0.2s ease;
}

.collapsing {
    opacity: 0.6;
}

.collapse.show {
    opacity: 1;
}

/* Optional: pill used to toggle sections */
.section-toggle {
    cursor: pointer;
    user-select: none;
}

/* =========================================================
   NAVBAR
   ========================================================= */

.navbar {
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.08);
}

.navbar .user-name {
    font-weight: 600;
    color: #ffc107;
}

/* =========================================================
   ADMIN DASHBOARD CARDS
   ========================================================= */

.admin-card {
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.25rem;
    height: 100%;
}

.admin-card h4 {
    color: var(--beta-primary);
}

.admin-card p {
    color: var(--beta-muted);
}

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

.form-label {
    font-weight: 500;
}

.form-text {
    font-size: 0.85rem;
}

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

.alert {
    border-radius: 0.4rem;
}

/* =========================================================
   UTILITIES
   ========================================================= */

.text-small {
    font-size: 0.85rem;
}

.no-wrap {
    white-space: nowrap;
}

/* =========================================================
   MOBILE IMPROVEMENTS
   ========================================================= */

@media (max-width: 768px) {

    .page-box {
        padding: 1.25rem;
    }

    .resource-title {
        font-size: 0.95rem;
    }

    .resource-description {
        font-size: 0.85rem;
    }

    /* Tables scroll horizontally instead of breaking layout */
    .table-responsive {
        overflow-x: auto;
    }

    /* Buttons stack more naturally */
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn:last-child {
        margin-bottom: 0;
    }
}

.alert {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.alert.fade-out {
    opacity: 0;
    transform: translateY(-4px);
}