/* ===========================
   Basketball Training App
   Color Theme: Red / Black / White (RBA)
   =========================== */

:root {
    --primary: #CC0000;
    --primary-dark: #A30000;
    --primary-light: #FF1A1A;
    --secondary: #1A1A1A;
    --secondary-light: #2D2D2D;
    --accent: #CC0000;
    --light-bg: #F5F5F5;
    --card-bg: #FFFFFF;
    --text-primary: #1A1A1A;
    --text-muted: #6C757D;
    --border-color: #E0E0E0;
    --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --radius: 0.625rem;
}

/* Bootstrap primary color override */
.btn-primary {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}
.btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background-color: var(--primary-dark) !important;
    border-color: var(--primary-dark) !important;
}
.btn-outline-primary {
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}
.btn-outline-primary:hover, .btn-outline-primary:active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #fff !important;
}

/* ===========================
   Typography
   =========================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    background-color: var(--light-bg);
    font-size: 0.95rem;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: 700;
}

/* ===========================
   Login / Landing Page Background
   =========================== */
.login-bg {
    background-image: url('images/bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    background-color: var(--secondary);
}

.content-wrapper {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* ===========================
   App Navbar
   =========================== */
.app-navbar {
    background-color: var(--secondary) !important;
    box-shadow: var(--shadow-sm);
    padding: 0.5rem 1rem;
}
.app-navbar .navbar-brand {
    color: #fff !important;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.app-navbar .navbar-brand img {
    height: 36px;
}
.app-navbar .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem !important;
    transition: color 0.2s;
}
.app-navbar .nav-link:hover,
.app-navbar .nav-link:focus {
    color: #fff !important;
}
.app-navbar .nav-link.text-danger {
    color: #ff6b6b !important;
}
.app-navbar .nav-link.text-danger:hover {
    color: #ff4444 !important;
}
.app-navbar .navbar-toggler {
    border-color: rgba(255, 255, 255, 0.3);
    padding: 0.25rem 0.5rem;
}
.app-navbar .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.8%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ===========================
   Cards
   =========================== */
.card {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    background: var(--card-bg);
    margin-bottom: 1.25rem;
}
.card-header {
    background-color: var(--secondary);
    color: #fff;
    font-weight: 700;
    font-size: 0.95rem;
    border-radius: var(--radius) var(--radius) 0 0 !important;
    padding: 0.75rem 1.25rem;
    border-bottom: none;
}

/* ===========================
   Buttons
   =========================== */
.btn {
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}
.btn:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.btn:active {
    transform: translateY(0);
}

/* ===========================
   Tables
   =========================== */
.table {
    margin-bottom: 0;
}
.table thead th {
    background-color: var(--secondary);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    font-weight: normal;
    border: none;
    padding: 0.625rem 0.75rem;
    white-space: nowrap;
}
.table tbody tr {
    transition: background-color 0.15s;
}
.table tbody tr:hover {
    background-color: rgba(204, 0, 0, 0.04);
}
.table td {
    vertical-align: middle;
    padding: 0.625rem 0.75rem;
    font-size: 0.875rem;
}

/* ===========================
   Forms
   =========================== */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(204, 0, 0, 0.15);
}

/* ===========================
   Modals
   =========================== */
.modal-header {
    background-color: var(--secondary);
    color: #fff;
    border-bottom: none;
}
.modal-header .modal-title {
    font-weight: 700;
    font-size: 0.95rem;
}
.modal-header .btn-close {
    filter: invert(1);
}

/* ===========================
   Alerts
   =========================== */
.alert-sessions {
    background: var(--secondary);
    color: #fff;
    border: none;
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
}
.alert-sessions strong {
    color: var(--primary-light);
}

/* ===========================
   Pagination
   =========================== */
.page-link {
    color: var(--primary);
}
.page-item.active .page-link {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* ===========================
   FullCalendar Overrides
   =========================== */
.fc .fc-toolbar-title {
    font-weight: 700;
    font-size: 1rem;
}
.fc .fc-button-primary {
    background-color: var(--secondary) !important;
    border-color: var(--secondary) !important;
}
.fc .fc-button-primary:hover {
    background-color: var(--secondary-light) !important;
}
.fc .fc-button-primary.fc-button-active {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* ===========================
   Mobile: Table-to-Card Pattern
   =========================== */
@media (max-width: 767.98px) {
    .table-mobile-cards thead {
        display: none;
    }
    .table-mobile-cards tbody {
        padding: 0.75rem;
        display: block;
    }
    .table-mobile-cards tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        border-bottom: 2px solid var(--border-color);
        padding-bottom: 0.75rem;
    }
    .table-mobile-cards tbody tr:last-child {
        margin-bottom: 0;
        border-bottom: none;
        padding-bottom: 0;
    }
    .table-mobile-cards tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.3rem 0.75rem;
        border: none;
        font-size: 0.875rem;
        background: none;
    }
    .table-mobile-cards tbody td:last-child {
        justify-content: flex-end;
        padding-top: 0.4rem;
    }
    .table-mobile-cards tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.8rem;
        margin-right: 1rem;
        flex-shrink: 0;
    }
    .table-mobile-cards tbody td:last-child::before {
        display: none;
    }
}

/* ===========================
   Mobile: General
   =========================== */
@media (max-width: 767.98px) {
    .container,
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    h1 { font-size: 1.4rem; }
    h3, h4 { font-size: 1rem; }
    .btn-sm {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    .content-wrapper {
        margin: 0.75rem;
        padding: 1.5rem;
    }
    .login-bg {
        background-attachment: scroll; /* iOS fix */
    }

    /* FullCalendar mobile */
    .fc .fc-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .fc .fc-toolbar-title {
        font-size: 0.85rem;
        width: 100%;
        text-align: center;
    }
    .fc .fc-button {
        font-size: 0.7rem !important;
        padding: 0.2rem 0.4rem !important;
    }

    /* Navbar brand text hide on very small */
    .app-navbar .navbar-brand .brand-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 575.98px) {
    .content-wrapper {
        margin: 0.5rem;
        padding: 1.25rem;
    }
    h1 { font-size: 1.2rem; }
}
