@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyN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wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Notes panel in sidebar */
.notes-sidebar-section {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin-top: 0.5rem;
}

.notes-sidebar-toggle {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    color: rgba(255, 255, 255, 0.75);
    cursor: pointer;
    font-size: 0.9rem;
}

.notes-sidebar-toggle:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.notes-sidebar-body {
    padding: 0 0.75rem 0.75rem;
    max-height: 350px;
    overflow-y: auto;
}

.notes-sidebar-body textarea {
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.9);
}

.notes-sidebar-body .note-item {
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.notes-sidebar-body .note-content {
    margin-top: 2px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.85);
    white-space: pre-wrap;
    word-break: break-word;
}

.print-only {
    display: none;
}

@media print {
    .sidebar, .top-row, .no-print, #blazor-error-ui {
        display: none !important;
    }

    .print-only {
        display: block !important;
    }

    .page {
        display: block !important;
    }

    main {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .content {
        padding: 0 !important;
    }

    .card {
        break-inside: avoid;
    }
}

/* Calendar */
.calendar-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.calendar-grid th { text-align: center; padding: 8px; background: #f8f9fa; border: 1px solid #dee2e6; font-size: 0.85rem; }
.calendar-grid td { border: 1px solid #dee2e6; padding: 4px; vertical-align: top; height: 90px; width: 14.28%; cursor: pointer; overflow: hidden; max-width: 0; }
.calendar-grid td:hover { background: #f0f7ff; }
.calendar-grid td.today { background: #fff3cd; }
.calendar-grid td.other-month { background: #f8f9fa; color: #adb5bd; }
.calendar-grid td.selected { background: #e7f1ff; border-color: #0d6efd; }
.calendar-day-num { font-weight: bold; font-size: 0.85rem; margin-bottom: 2px; }
.calendar-event { font-size: 0.65rem; padding: 1px 4px; margin-bottom: 1px; border-radius: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; max-width: 100%; }
.calendar-event.meet { background: #cfe2ff; color: #0a58ca; }
.calendar-event.practice { background: #d1e7dd; color: #0f5132; }
.calendar-event.payment { background: #fff3cd; color: #664d03; }

/* Mobile Optimization */
@media (max-width: 768px) {
    /* Cards stack properly */
    .card-body { padding: 0.75rem; }

    /* Larger touch targets */
    .btn { min-height: 44px; }
    .btn-sm { min-height: 36px; font-size: 0.85rem; }
    .form-control, .form-select { min-height: 44px; font-size: 1rem; }

    /* Table scroll */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    table { font-size: 0.85rem; }

    /* Summary cards in rows */
    .row > [class*="col-md"] { margin-bottom: 0.5rem; }

    /* Payment buttons stack */
    .row.g-2 > div { flex: 0 0 100%; max-width: 100%; }

    /* Hide non-essential columns on small screens */
    .hide-mobile { display: none !important; }

    /* Compact headers */
    h3 { font-size: 1.3rem; }
    h5 { font-size: 1.1rem; }
    h6 { font-size: 0.95rem; }
}

/* Bottom nav for parent portal on mobile */
@media (max-width: 640.98px) {
    .parent-portal .sidebar { display: none; }
    .parent-portal .parent-top-row { display: none; }

    .parent-bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: #1a6b3c;
        display: flex;
        justify-content: space-around;
        padding: 8px 0;
        z-index: 1000;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
    }

    .parent-bottom-nav a {
        color: rgba(255,255,255,0.7);
        text-decoration: none;
        text-align: center;
        font-size: 0.65rem;
        padding: 4px 8px;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2px;
    }

    .parent-bottom-nav a.active,
    .parent-bottom-nav a:hover {
        color: #fff;
    }

    .parent-bottom-nav .oi {
        font-size: 1.2rem;
    }

    /* Add padding at bottom so content isn't hidden behind bottom nav */
    .parent-portal main article {
        padding-bottom: 70px !important;
    }
}

/* Show bottom nav only on mobile */
@media (min-width: 641px) {
    .parent-bottom-nav { display: none; }
}

/* Chat */
.chat-container { display: flex; height: calc(100vh - 120px); border: 1px solid #dee2e6; border-radius: 8px; overflow: hidden; }
.chat-rooms { width: 300px; border-right: 1px solid #dee2e6; overflow-y: auto; background: #f8f9fa; flex-shrink: 0; }
.chat-room-item { padding: 12px 16px; border-bottom: 1px solid #dee2e6; cursor: pointer; }
.chat-room-item:hover { background: #e9ecef; }
.chat-room-item.active { background: #0d6efd; color: white; }
.chat-room-item.active .text-muted { color: rgba(255,255,255,0.7) !important; }
.chat-messages-area { flex: 1; display: flex; flex-direction: column; }
.chat-messages-header { padding: 12px 16px; border-bottom: 1px solid #dee2e6; background: #fff; font-weight: bold; }
.chat-messages-list { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-bubble { max-width: 70%; padding: 8px 14px; border-radius: 16px; font-size: 0.9rem; word-wrap: break-word; }
.chat-bubble.mine { align-self: flex-end; background: #0d6efd; color: white; border-bottom-right-radius: 4px; }
.chat-bubble.other { align-self: flex-start; background: #e9ecef; color: #212529; border-bottom-left-radius: 4px; }
.chat-bubble .sender { font-size: 0.75rem; font-weight: bold; margin-bottom: 2px; }
.chat-bubble .time { font-size: 0.65rem; opacity: 0.7; margin-top: 2px; }
.chat-input-bar { padding: 12px 16px; border-top: 1px solid #dee2e6; background: #fff; display: flex; gap: 8px; align-items: center; }
.chat-input-bar input { flex: 1; border-radius: 20px; padding: 8px 16px; }
.chat-input-bar button { border-radius: 20px; min-width: 60px; }
.emoji-picker { position: absolute; bottom: 50px; right: 0; background: #fff; border: 1px solid #dee2e6; border-radius: 12px; padding: 10px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; width: 320px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1000; }
.emoji-item { font-size: 1.4rem; cursor: pointer; text-align: center; padding: 4px; border-radius: 6px; }
.emoji-item:hover { background: #e9ecef; }

@media (max-width: 768px) {
    .chat-rooms { width: 100%; }
    .chat-messages-area { display: none; }
    .chat-container.room-selected .chat-rooms { display: none; }
    .chat-container.room-selected .chat-messages-area { display: flex; }
}

/* Budget Calculator */
.budget-tabs { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 8px; border-bottom: 2px solid #dee2e6; margin-bottom: 16px; }
.budget-tab { padding: 8px 16px; border: 1px solid #dee2e6; border-bottom: none; border-radius: 8px 8px 0 0; background: #f8f9fa; cursor: pointer; white-space: nowrap; font-size: 0.85rem; }
.budget-tab.active { background: #0d6efd; color: white; border-color: #0d6efd; }
.budget-tab:hover:not(.active) { background: #e9ecef; }
.budget-grand-total { position: sticky; bottom: 0; background: #212529; color: white; padding: 12px 16px; border-radius: 8px; margin-top: 16px; }

/* Roster table */
.roster-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid #dee2e6; border-radius: 8px; }
.roster-table-wrap table { font-size: 0.75rem; min-width: 100%; margin: 0; }
.roster-table-wrap th, .roster-table-wrap td { white-space: nowrap; padding: 3px 6px !important; vertical-align: middle; }
.roster-table-wrap th:first-child, .roster-table-wrap td:first-child { position: sticky; left: 0; background: white; z-index: 1; min-width: 140px; padding-left: 10px !important; border-right: 2px solid #dee2e6; }
.roster-table-wrap thead th:first-child { background: #f8f9fa; }
.roster-table-wrap tfoot td:first-child { background: #f8f9fa; }
.roster-table-wrap .form-check-input { margin: 0; }

@media (max-width: 768px) {
    .roster-table-wrap { margin: 0 -1rem; border-radius: 0; }
    .roster-table-wrap table { font-size: 0.65rem; }
    .roster-table-wrap th, .roster-table-wrap td { padding: 2px 3px !important; }
    .roster-table-wrap th:first-child, .roster-table-wrap td:first-child { min-width: 90px; }
}
