body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #F7F8FC;
    color: #1E2022;
    margin: 0;
    padding: 20px;
    box-sizing: border-box;
    transition: padding-top 0.4s ease-out;
}

body.maintenance-active {
    padding-top: 74px;
}

#maintenance-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9999;
    padding: 12px;
    text-align: center;
    color: #856404;
    background-color: #fff3cd;
    border-bottom: 1px solid #ffeeba;
    box-sizing: border-box;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(-100%);
    transition: transform 0.4s ease-out;
    display: block;
    overflow: hidden;
}

#maintenance-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: repeating-linear-gradient(
        -45deg,
        transparent,
        transparent 10px,
        rgba(255, 255, 255, 0.2) 10px,
        rgba(255, 255, 255, 0.2) 20px
    );
    background-size: 40px 40px;
    animation: seamless-slide 2s infinite linear;
    z-index: 0;
}

#maintenance-banner strong {
    position: relative;
    z-index: 1;
}

#maintenance-banner.visible {
    transform: translateY(0);
}

#app-wrapper {
    width: 100%;
    min-height: calc(100vh - 40px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#login-view-container {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    margin: 0 auto 20px auto;
    background-color: #FFFFFF;
    background-image: url('assets/images/logo.webp');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    border: 1px solid #eee;
}

h1.main-title {
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 8px 0;
    color: #1E2022;
}

p.subtitle {
    font-size: 16px;
    color: #8A94A6;
    margin: 0 0 30px 0;
}

.form-card {
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.07);
    text-align: left;
}

.tabs {
    display: flex;
    border-bottom: 1px solid #EAEAEA;
    margin-bottom: 25px;
}

.tab {
    flex: 1;
    padding-bottom: 15px;
    text-align: center;
    font-size: 16px;
    font-weight: 500;
    color: #8A94A6;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: color 0.3s, border-color 0.3s;
    text-decoration: none;
}

.tab.active {
    color: #5A55E3;
    border-bottom-color: #5A55E3;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #4B5563;
    margin-bottom: 8px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    background-color: #404040;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
    transition: box-shadow 0.3s;
}

.form-group input:-webkit-autofill,
.form-group input:-webkit-autofill:hover,
.form-group input:-webkit-autofill:focus,
.form-group input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px #404040 inset !important;
    -webkit-text-fill-color: white !important;
}

.form-group input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(90, 85, 227, 0.4);
}

button[type="submit"] {
    width: 100%;
    padding: 14px;
    background-color: #5A55E3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px;
    transition: background-color 0.3s;
}

button[type="submit"]:hover {
    background-color: #4A45D1;
}

#learner-info-container {
    width: 100%;
    max-width: 1100px;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    padding: 15px 30px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.07);
    margin-bottom: 20px;
}

.header-logo {
    height: 40px;
    width: auto;
}

.dashboard-header h1 {
    font-size: 22px;
    margin: 0;
    color: #333;
}

#logout-button {
    width: auto;
    padding: 10px 20px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

#logout-button:hover {
    background-color: #5a6268;
}

.dashboard-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.panel {
    background-color: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.07);
}

.panel h2 {
    text-align: left;
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

.info-row {
    display: flex;
    margin-bottom: 12px;
    line-height: 1.6;
    align-items: flex-start;
}

.info-label {
    font-weight: bold;
    flex-basis: 200px;
    flex-shrink: 0;
    color: #555;
}

.info-value {
    flex-grow: 1;
}

.no-debts {
    color: green;
    font-weight: bold;
}

.has-debts {
    color: red;
    font-weight: bold;
}

#materials-list a {
    display: block;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    margin-bottom: 8px;
    text-decoration: none;
    color: #007bff;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}

#materials-list a:hover {
    background-color: #e9ecef;
    border-color: #c6d2d9;
}

#materials-list p {
    color: #6c757d;
}

.hidden {
    display: none !important;
}

.error {
    color: #dc3545;
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.info {
    color: #6c757d;
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #5A55E3;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
    margin: 15px auto 0;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
    box-sizing: border-box;
}

.modal-content.wide {
    max-width: 90vw;
    width: 900px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    max-height: 95vh;
}

.pdf-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    flex-shrink: 0;
}

#pdf-close-btn {
    width: auto;
    font-size: 24px;
    padding: 0 10px;
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
}

#pdf-viewer-container {
    border: 1px solid #ccc;
    overflow-y: auto;
    text-align: center;
    flex-grow: 1;
}

#pdf-canvas {
    max-width: 100%;
}

.pdf-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding: 5px;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 10px;
}

.pdf-controls span {
    flex-grow: 2;
    text-align: center;
    white-space: nowrap;
}

.pdf-controls button {
    flex-grow: 1;
    flex-basis: 120px;
    width: auto;
    padding: 8px 12px;
    background-color: #5A55E3;
    color: white;
    border: none;
    border-radius: 4px;
}

.pdf-controls button:hover {
    background-color: #4A45D1;
}

#save-blocker {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f0f2f5;
    color: #333;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: sans-serif;
    font-size: 24px;
}

.login-form {
    display: none;
}

.login-form.active {
    display: block;
}

.password-toggle-container {
    position: relative;
}

.password-toggle-container input[type="password"],
.password-toggle-container input[type="text"] {
    padding-right: 40px;
}

.password-toggle-icon {
    position: absolute;
    right: 12px;
    bottom: 11px;
    width: 20px;
    height: 20px;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7zM2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L21.73 21 20.46 22.27 3.27 5.54 2 4.27zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2zm4.31-.78l3.15 3.15.02-.16c0-1.66-1.34-3-3-3l-.17.01z"/></svg>');
    background-repeat: no-repeat;
    background-size: contain;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.password-toggle-icon.is-visible {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5zM12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3z"/></svg>');
}

.password-toggle-icon:hover {
    opacity: 1;
}

@keyframes seamless-slide {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(40px);
    }
}

#announcements-panel {
    grid-column: 1 / -1;
}

#announcements-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.announcement-item {
    background-color: #f8f9fa;
    border-left: 5px solid #0d6efd;
    padding: 15px;
    border-radius: 5px;
}

.announcement-item.type-group {
    border-left-color: #fd7e14;
}

.announcement-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.announcement-title {
    font-weight: bold;
    font-size: 1.1em;
}

.announcement-date {
    font-size: 0.9em;
    color: #6c757d;
}

.announcement-content {
    line-height: 1.6;
}

.announcement-attachment {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #e9ecef;
}

.announcement-attachment a {
    text-decoration: none;
    font-weight: 500;
    color: #007bff;
}

.announcement-attachment a:hover {
    text-decoration: underline;
}

@media (max-width: 800px) {
    .dashboard-content {
        grid-template-columns: 1fr;
    }
    .dashboard-header {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    .form-card {
        padding: 20px;
    }
    .dashboard-header h1 {
        font-size: 18px;
    }
    .panel {
        padding: 15px;
    }
    .info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        margin-bottom: 15px;
    }
    .info-label {
        flex-basis: auto;
    }
}

@media (max-width: 420px) {
    .pdf-controls {
        justify-content: center;
        gap: 15px;
    }
    .pdf-controls span {
       width: 100%;
       order: -1;
       margin-bottom: 5px;
    }
    .pdf-controls button {
       flex-basis: 130px;
    }
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #5A55E3;
}

.checkbox-group label {
    margin: 0;
    font-size: 14px;
    color: #4B5563;
    cursor: pointer;
    font-weight: 400;
}