/* ===================================================================
   TBS ACADEMY - AUTH MODAL & STUDENT PROFILE CSS
   =================================================================== */

/* Header Auth Button & User Profile Pill */
.auth-header-container {
    display: inline-flex;
    align-items: center;
    margin-left: 6px;
    position: relative;
}

.auth-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 30px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0.3px;
    box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
    transition: all 0.3s ease;
}

.auth-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.5);
    background: linear-gradient(135deg, #0369a1 0%, #0284c7 100%);
}

.student-profile-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    background: rgba(15, 23, 42, 0.85);
    border: 1px solid rgba(56, 189, 248, 0.4);
    border-radius: 30px;
    color: #f8fafc;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.student-profile-pill:hover {
    border-color: #38bdf8;
    background: rgba(30, 41, 59, 0.95);
    transform: translateY(-1px);
}

.student-pill-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #38bdf8;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.student-pill-name {
    font-weight: 600;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.student-pill-tag {
    font-size: 0.68rem;
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.3);
    font-weight: 600;
}

/* Profile Dropdown Popover */
.student-profile-popover {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(56, 189, 248, 0.15);
    z-index: 10000;
    display: none;
    flex-direction: column;
    gap: 12px;
    animation: fadeInDropdown 0.2s ease;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.student-profile-popover.show {
    display: flex;
}

.popover-header {
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 10px;
}

.popover-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
}

.popover-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: #f8fafc;
    line-height: 1.2;
}

.popover-id {
    font-size: 0.75rem;
    color: #38bdf8;
    font-family: monospace;
}

.popover-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: rgba(30, 41, 59, 0.5);
    padding: 8px 10px;
    border-radius: 10px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.stat-box-num {
    font-size: 0.95rem;
    font-weight: 700;
    color: #22c55e;
}

.stat-box-label {
    font-size: 0.68rem;
    color: #94a3b8;
}

.popover-batch-status {
    font-size: 0.78rem;
    padding: 6px 10px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #cbd5e1;
}

.popover-logout-btn {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.popover-logout-btn:hover {
    background: #ef4444;
    color: #ffffff;
}

/* ==========================================
   AUTH MODAL OVERLAY & POPUP BOX
   ========================================== */
.tbs-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 15, 29, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeInModal 0.25s ease;
}

.tbs-auth-overlay.open {
    display: flex;
}

.tbs-auth-card {
    background: #0f172a;
    border: 1px solid rgba(56, 189, 248, 0.35);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    padding: 30px 28px 24px 28px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85), 0 0 35px rgba(56, 189, 248, 0.2);
    position: relative;
    color: #f8fafc;
    animation: scaleUpModal 0.25s ease;
}

@keyframes scaleUpModal {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.tbs-auth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: #cbd5e1;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}

.tbs-auth-close:hover {
    background: #ef4444;
    color: #ffffff;
}

/* Limit Prompt Banner */
.auth-limit-banner {
    background: linear-gradient(135deg, rgba(234, 88, 12, 0.15) 0%, rgba(249, 115, 22, 0.22) 100%);
    border: 1px solid rgba(249, 115, 22, 0.4);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.82rem;
    color: #fdba74;
    line-height: 1.4;
}

.auth-limit-banner i {
    font-size: 1.2rem;
    flex-shrink: 0;
}

/* Modal Title */
.tbs-auth-header {
    text-align: center;
    margin-bottom: 20px;
}

.tbs-auth-header img {
    height: 44px;
    margin-bottom: 8px;
}

.tbs-auth-header h2 {
    font-size: 1.45rem;
    font-weight: 700;
    color: #f8fafc;
    margin-bottom: 4px;
}

.tbs-auth-header p {
    font-size: 0.82rem;
    color: #94a3b8;
}

/* Form Styles */
.tbs-auth-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tbs-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.tbs-input-group label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #cbd5e1;
    display: flex;
    justify-content: space-between;
}

.tbs-input-group label .hint {
    color: #38bdf8;
    font-weight: 400;
    cursor: pointer;
}

.tbs-input-group input,
.tbs-input-group select {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    padding: 10px 14px;
    color: #f8fafc;
    font-size: 0.9rem;
    outline: none;
    transition: all 0.25s ease;
}

.tbs-input-group input:focus,
.tbs-input-group select:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
    background: #0f172a;
}

.tbs-id-input-wrap {
    display: flex;
    gap: 6px;
}

.tbs-id-input-wrap input {
    flex: 1;
    font-family: monospace;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.tbs-gen-id-btn {
    background: rgba(56, 189, 248, 0.15);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: #38bdf8;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tbs-gen-id-btn:hover {
    background: #38bdf8;
    color: #0f172a;
}

.tbs-auth-submit-btn {
    margin-top: 6px;
    padding: 12px;
    background: linear-gradient(135deg, #0284c7 0%, #38bdf8 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.35);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tbs-auth-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(56, 189, 248, 0.5);
}

.tbs-auth-error {
    font-size: 0.8rem;
    color: #f87171;
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    display: none;
    line-height: 1.4;
}

.tbs-auth-success {
    font-size: 0.8rem;
    color: #4ade80;
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    display: none;
    line-height: 1.4;
}

/* Small bottom-left corner switch link (As specifically requested by user) */
.tbs-auth-footer-switch {
    margin-top: 14px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 0.82rem;
    color: #94a3b8;
}

.tbs-switch-link {
    color: #38bdf8;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    margin-left: 4px;
    transition: color 0.2s;
}

.tbs-switch-link:hover {
    color: #7dd3fc;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
    .tbs-auth-card {
        padding: 24px 20px 20px 20px;
    }
    .student-profile-popover {
        right: -40px;
        width: 260px;
    }
}
