/* ===== School Teachers PWA Styles =====
   This stylesheet works in two modes:
   1. Full-screen template (template-teachers-pwa.php) - theme is completely bypassed
   2. Shortcode fallback on regular pages - hides theme via .stpwa-page body class
*/

/* Common app styles */
#school-teachers-app,
.stpwa-login,
.stpwa-denied {
    min-height: 100dvh;
    background: #080c15;
    color: #f1f3ff;
    font-family: Inter, system-ui, sans-serif;
    padding: env(safe-area-inset-top) 20px env(safe-area-inset-bottom);
    box-sizing: border-box;
}

.stpwa-app {
    max-width: 1180px;
    margin: 0 auto;
}

.stpwa-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
    border-bottom: 1px solid #293653;
}

.stpwa-header h1,
.stpwa-view h2 {
    margin: .15rem 0;
    font-size: clamp(1.5rem, 3vw, 2.3rem);
}

.stpwa-kicker {
    color: #8c82ff;
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .16em;
    margin: 0;
}

.stpwa-header-actions {
    display: flex;
    gap: 8px;
}

.stpwa-header button,
.stpwa-qr,
.stpwa-install-link {
    border: 1px solid #5751bb;
    border-radius: 10px;
    background: #1a1d48;
    color: #b4aaff;
    padding: 10px 13px;
    font-weight: 800;
    cursor: pointer;
}

.stpwa-main {
    padding: 28px 0 60px;
}

.stpwa-view-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.stpwa-class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.stpwa-class {
    display: grid;
    gap: 8px;
    text-align: left;
    padding: 20px;
    border: 1px solid #293653;
    border-radius: 16px;
    background: #101629;
    color: #fff;
    cursor: pointer;
}

.stpwa-class:hover {
    border-color: #7566ff;
    transform: translateY(-1px);
}

.stpwa-class span,
.stpwa-student small {
    color: #9aa6c3;
}

.stpwa-roster-list {
    display: grid;
    gap: 10px;
}

.stpwa-student {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border: 1px solid #293653;
    border-radius: 14px;
    background: #101629;
}

.stpwa-student.has-warning {
    border-color: #8a6330;
}

.stpwa-student > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stpwa-status {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.stpwa-status button {
    border: 1px solid #293653;
    border-radius: 8px;
    background: #1a1d48;
    color: #b4aaff;
    padding: 8px 12px;
    font-weight: 700;
    font-size: .8rem;
    cursor: pointer;
}

.stpwa-status button.active,
.stpwa-status button[aria-pressed="true"] {
    border-color: #7566ff;
    background: #312e6e;
    color: #fff;
}

.stpwa-note summary {
    cursor: pointer;
    color: #8c82ff;
    font-weight: 700;
    margin: 10px 0 6px;
}

.stpwa-note form {
    display: grid;
    gap: 8px;
}

.stpwa-note input,
.stpwa-note textarea {
    background: #1a1d48;
    border: 1px solid #293653;
    border-radius: 8px;
    color: #fff;
    padding: 10px 12px;
    font-family: inherit;
}

.stpwa-note button {
    border: 1px solid #5751bb;
    border-radius: 8px;
    background: #312e6e;
    color: #fff;
    padding: 8px 12px;
    font-weight: 700;
    cursor: pointer;
}

.stpwa-materials {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #293653;
}

.stpwa-materials h3 {
    margin: 0 0 12px;
    font-size: 1.1rem;
}

.stpwa-materials form {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.stpwa-materials input[type="text"],
.stpwa-materials input[type="url"] {
    flex: 1;
    min-width: 200px;
    background: #1a1d48;
    border: 1px solid #293653;
    border-radius: 8px;
    color: #fff;
    padding: 10px 12px;
}

.stpwa-materials input[type="file"] {
    background: #1a1d48;
    border: 1px solid #293653;
    border-radius: 8px;
    color: #fff;
    padding: 8px 12px;
}

.stpwa-materials button {
    border: 1px solid #5751bb;
    border-radius: 8px;
    background: #312e6e;
    color: #fff;
    padding: 10px 16px;
    font-weight: 700;
    cursor: pointer;
}

.stpwa-material-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid #293653;
    border-radius: 10px;
    background: #101629;
    margin-bottom: 8px;
}

.stpwa-material-item a {
    color: #8c82ff;
    text-decoration: none;
    font-weight: 600;
}

.stpwa-material-item a:hover {
    text-decoration: underline;
}

.stpwa-qr-box {
    margin: 16px 0;
    padding: 16px;
    border: 1px solid #293653;
    border-radius: 12px;
    background: #101629;
    text-align: center;
}

.stpwa-qr-box p {
    margin: 0 0 12px;
    color: #9aa6c3;
}

.stpwa-error,
.stpwa-message {
    padding: 12px;
    border-radius: 8px;
    margin: 12px 0;
    font-weight: 600;
}

.stpwa-error,
.stpwa-message.is-error {
    background: #3a1a1a;
    border: 1px solid #8a3a3a;
    color: #ffb3b3;
}

.stpwa-message:not(.is-error) {
    background: #1a3a1a;
    border: 1px solid #3a8a3a;
    color: #b3ffb3;
}

.stpwa-empty {
    text-align: center;
    color: #9aa6c3;
    padding: 40px 0;
}

.stpwa-back {
    border: 1px solid #5751bb;
    border-radius: 10px;
    background: #1a1d48;
    color: #b4aaff;
    padding: 10px 16px;
    font-weight: 800;
    cursor: pointer;
    margin-bottom: 16px;
}

.stpwa-install-link {
    display: none;
}

/* Login / Denied screens */
.stpwa-login-card,
.stpwa-denied-card {
    max-width: 360px;
    margin: 0 auto;
    text-align: center;
    padding: 2rem;
}

.stpwa-login-card h2,
.stpwa-denied-card h2 {
    margin: 1rem 0 .5rem;
}

.stpwa-login-card p,
.stpwa-denied-card p {
    color: #9aa6c3;
    line-height: 1.6;
}

.stpwa-login-card form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 1.5rem;
}

.stpwa-login-card label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}

.stpwa-login-card input {
    background: #1a1d48;
    border: 1px solid #293653;
    border-radius: 10px;
    color: #fff;
    padding: 14px 16px;
    font-size: 1rem;
    font-family: inherit;
}

.stpwa-login-card button {
    border: 1px solid #5751bb;
    border-radius: 10px;
    background: #312e6e;
    color: #fff;
    padding: 14px;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    margin-top: 8px;
}

/* ===== Theme hiding for shortcode fallback mode ===== */
body.stpwa-page {
    margin: 0 !important;
}

body.stpwa-page header.site-header,
body.stpwa-page footer.site-footer,
body.stpwa-page #colophon,
body.stpwa-page .site-footer,
body.stpwa-page .elementor-location-header,
body.stpwa-page .elementor-location-footer {
    display: none !important;
}

body.stpwa-page #page,
body.stpwa-page .site,
body.stpwa-page .site-content,
body.stpwa-page .content-area {
    max-width: none !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Template mode: the template handles full-screen, but keep these as safety */
body.stpwa-template #wpadminbar {
    display: none !important;
}