/* Faustball - Admin Styles (scoped under .FaustballApp) */

.FaustballAdminContainer {
    display: grid;
    grid-template-columns: 250px 1fr;
    min-height: 100vh;
}

/* Mobile Header Bar - hidden on desktop */
.FaustballAdminMobileHeader {
    display: none;
}

/* Admin Sidebar */
.FaustballAdminSidebar {
    background: var(--fb-dark-bg);
    color: white;
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.FaustballAdminSidebarHeader {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.FaustballAdminSidebarHeader a {
    color: white;
    text-decoration: none;
    font-size: 1.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.FaustballAdminSidebarHeader .back-link {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
}

.FaustballAdminSidebarHeader .back-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

.FaustballAdminNav {
    display: flex;
    flex-direction: column;
    padding: 0.5rem 0;
    flex: 1;
}

.FaustballAdminNavGroup {
    padding: 0.5rem 0;
}

.FaustballAdminNavGroupTitle {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.FaustballAdminNavLink {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.FaustballAdminNavLink:hover {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

.FaustballAdminNavLinkActive {
    background: rgba(37, 99, 235, 0.2);
    color: white;
    border-left-color: var(--fb-primary);
}

/* Admin Content */
.FaustballAdminContent {
    padding: 1.5rem 2rem;
    background: var(--fb-light-bg);
    overflow-y: auto;
    min-width: 0;
}

/* Admin Dashboard */
.FaustballApp .admin-dashboard h1 {
    margin-bottom: 2rem;
    color: var(--fb-dark-bg);
}

.FaustballApp .dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.FaustballApp .dashboard-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.FaustballApp .dashboard-card h3 {
    color: var(--fb-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.FaustballApp .dashboard-stat {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--fb-primary);
    margin: 0;
}

/* Admin Tables - responsive wrapper */
.FaustballApp .admin-table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.FaustballApp .admin-table {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    width: 100%;
    min-width: 500px;
}

.FaustballApp .admin-table th {
    background: var(--fb-dark-bg);
    color: white;
    white-space: nowrap;
    padding: 0.75rem 1rem;
}

.FaustballApp .admin-table td {
    padding: 0.75rem 1rem;
}

.FaustballApp .admin-table tr:hover {
    background: var(--fb-light-bg);
}

/* Admin action buttons in table cells */
.FaustballApp .admin-table .admin-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Admin Section */
.FaustballApp .admin-section {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.FaustballApp .admin-section h1,
.FaustballApp .admin-section h2 {
    margin-bottom: 1.5rem;
    color: var(--fb-dark-bg);
}

.FaustballApp .admin-section .btn {
    margin-bottom: 1rem;
}

/* Mobile Admin Menu Button */
.FaustballAdminMenuBtn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.FaustballAdminMenuIcon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 22px;
}

.FaustballAdminMenuIcon span {
    display: block;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

/* Mobile overlay */
.FaustballAdminMobileOverlay {
    display: none;
}

/* ============================================
   ADMIN FORMS
   ============================================ */
.FaustballApp .admin-form-card {
    background: #f1f5f9;
    border: 1px solid var(--fb-border);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.FaustballApp .admin-form-card h2,
.FaustballApp .admin-form-card h3 {
    margin-bottom: 1rem;
    color: var(--fb-dark-bg);
}

.FaustballApp .form-group {
    margin-bottom: 1rem;
}

.FaustballApp .form-group label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--fb-dark-bg);
}

.FaustballApp .form-control {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--fb-text);
    background: white;
    border: 1px solid var(--fb-border);
    border-radius: 6px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.FaustballApp .form-control:focus {
    border-color: var(--fb-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.FaustballApp .form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 0.25rem;
    cursor: pointer;
}

.FaustballApp .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.FaustballApp .form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.FaustballApp .admin-add-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-end;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.FaustballApp .admin-detail-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.FaustballApp .admin-detail-header h1 {
    margin: 0;
    flex: 1;
}

.FaustballApp .admin-detail-grid {
    margin-bottom: 1.5rem;
}

.FaustballApp .detail-info p {
    margin: 0.5rem 0;
    color: var(--fb-text);
}

.FaustballApp .admin-hint {
    color: var(--fb-text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

/* Alert component */
.FaustballApp .alert {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.FaustballApp .alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--fb-success);
    color: #065f46;
}

.FaustballApp .alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--fb-danger);
    color: #991b1b;
}

.FaustballApp .alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid var(--fb-info);
    color: #1e40af;
}

.FaustballApp .alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid var(--fb-warning);
    color: #92400e;
}

/* Team Autocomplete */
.FaustballApp .team-autocomplete {
    position: relative;
}

.FaustballApp .autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--fb-border);
    border-top: none;
    border-radius: 0 0 6px 6px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.FaustballApp .autocomplete-item {
    padding: 0.6rem 0.75rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.15s;
}

.FaustballApp .autocomplete-item:hover {
    background: var(--fb-light-bg);
}

.FaustballApp .autocomplete-create {
    color: var(--fb-primary);
    font-weight: 600;
    border-top: 1px solid var(--fb-border);
}

.FaustballApp .team-selected-hint {
    display: block;
    margin-top: 0.25rem;
    color: var(--fb-success);
    font-size: 0.8rem;
}

/* Court badge in public pages */
.FaustballApp .court-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background: var(--fb-light-bg);
    border: 1px solid var(--fb-border);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--fb-text-light);
    margin-left: 0.5rem;
}

/* ============================================
   TABLET BREAKPOINT (768px - 1024px)
   ============================================ */
@media (max-width: 1024px) {
    .FaustballAdminContainer {
        grid-template-columns: 220px 1fr;
    }

    .FaustballAdminContent {
        padding: 1.25rem 1.5rem;
    }
}

/* ============================================
   MOBILE BREAKPOINT (<768px)
   ============================================ */
@media (max-width: 768px) {
    .FaustballAdminContainer {
        display: flex;
        flex-direction: column;
        grid-template-columns: none;
    }

    /* Show mobile top bar */
    .FaustballAdminMobileHeader {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1rem;
        background: var(--fb-dark-bg);
        color: white;
        position: sticky;
        top: 0;
        z-index: 200;
        min-height: 52px;
    }

    .FaustballAdminMobileTitle {
        font-weight: 600;
        font-size: 1rem;
    }

    .FaustballAdminMobileBack {
        color: rgba(255, 255, 255, 0.7);
        text-decoration: none;
        font-size: 0.85rem;
        padding: 0.25rem 0.5rem;
    }

    .FaustballAdminMobileBack:hover {
        color: white;
    }

    /* Sidebar slides in from left */
    .FaustballAdminSidebar {
        position: fixed;
        left: -280px;
        top: 0;
        bottom: 0;
        width: 270px;
        z-index: 350;
        transition: left 0.3s ease;
        height: 100%;
    }

    .FaustballAdminSidebar.open {
        left: 0;
    }

    /* Touch-friendly nav links on mobile */
    .FaustballAdminNavLink {
        padding: 0.85rem 1rem;
        font-size: 1rem;
        min-height: 44px;
    }

    /* Overlay behind sidebar */
    .FaustballAdminMobileOverlay.open {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 300;
        animation: fbAdminFadeIn 0.2s ease;
    }

    @keyframes fbAdminFadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    /* Content area */
    .FaustballAdminContent {
        padding: 1rem;
        min-height: calc(100vh - 52px);
    }

    /* Dashboard grid: 2 columns on tablet-ish mobile */
    .FaustballApp .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
    }

    .FaustballApp .dashboard-card {
        padding: 1rem;
    }

    .FaustballApp .dashboard-stat {
        font-size: 2rem;
    }

    /* Section headings */
    .FaustballApp .admin-section h1 {
        font-size: 1.4rem;
    }

    .FaustballApp .admin-section {
        padding: 1rem;
    }

    /* Tables scroll horizontally */
    .FaustballApp .admin-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .FaustballApp .admin-table th,
    .FaustballApp .admin-table td {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    /* Forms responsive */
    .FaustballApp .form-row {
        grid-template-columns: 1fr;
    }

    .FaustballApp .admin-form-card {
        padding: 1rem;
    }

    .FaustballApp .admin-add-row {
        flex-direction: column;
        align-items: stretch;
    }

    .FaustballApp .admin-add-row .form-control {
        max-width: 100% !important;
    }

    .FaustballApp .admin-detail-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* ============================================
   SMALL MOBILE (<480px)
   ============================================ */
@media (max-width: 480px) {
    .FaustballApp .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .FaustballApp .dashboard-stat {
        font-size: 1.75rem;
    }

    .FaustballApp .dashboard-card h3 {
        font-size: 0.8rem;
    }

    .FaustballApp .admin-section h1 {
        font-size: 1.2rem;
    }

    .FaustballApp .admin-section .btn {
        display: block;
        width: 100%;
        text-align: center;
    }

    /* Stack action buttons vertically in table cells */
    .FaustballApp .admin-table .admin-actions {
        flex-direction: column;
        gap: 0.35rem;
    }

    .FaustballApp .admin-table .admin-actions .btn {
        width: 100%;
        text-align: center;
    }
}
