.home-page {
    margin: 0;
    padding: 20px;
    font-family: Arial, sans-serif;
    color: #0f172a;
    background:
        linear-gradient(120deg, rgba(14, 9, 66, 0.74), rgba(26, 11, 70, 0.6)),
        radial-gradient(circle at 15% 10%, rgba(66, 93, 255, 0.26), transparent 44%),
        radial-gradient(circle at 85% 5%, rgba(255, 132, 78, 0.2), transparent 40%),
        url("../img/bgForLogin.png") center / cover no-repeat fixed;
}

.home-page header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.54) 0%, rgba(246, 250, 255, 0.46) 100%);
    border: 1px solid rgba(219, 228, 240, 0.6);
    border-radius: 16px;
    padding: 14px 18px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
    position: relative;
    overflow: hidden;
}

.home-page header::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(44, 123, 229, 0.09), transparent 42%);
}

.home-page header .logo {
    width: clamp(52px, 5vw, 74px);
    height: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 6px 10px rgba(29, 78, 216, 0.15));
    position: relative;
    z-index: 1;
}

.home-page header h2 {
    margin: 0;
    font-size: clamp(22px, 2.2vw, 33px);
    line-height: 1.15;
    letter-spacing: 0.2px;
    color: #0f2e66;
    text-wrap: balance;
    position: relative;
    z-index: 1;
}

.home-page .login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 10px 16px;
    text-decoration: none;
    color: #ffffff;
    background: linear-gradient(135deg, #2c7be5 0%, #1d4ed8 100%);
    font-weight: 700;
    box-shadow: 0 8px 18px rgba(44, 123, 229, 0.3);
    white-space: nowrap;
    position: relative;
    z-index: 1;
}

.home-page .login-btn:hover {
    filter: brightness(0.98);
}

.home-page .cards-section,
.home-page .chart,
.home-page .teachers-below {
    margin-top: 18px;
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(219, 228, 240, 0.56);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.15);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.home-page .cards-section {
    margin-top: 0;
}

.home-page h3 {
    margin: 0 0 12px;
    font-size: 20px;
}

.home-page .home-search {
    margin-bottom: 12px;
}

.home-page .home-search input[type="search"] {
    width: min(460px, 100%);
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    background: rgba(255, 255, 255, 0.56);
    color: #0f172a;
}

.home-page .home-search input[type="search"]:focus {
    outline: none;
    border-color: #2c7be5;
    box-shadow: 0 0 0 3px rgba(44, 123, 229, 0.18);
}

.teacher-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
}

.home-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    padding: 18px 14px;
    color: #475569;
    background: rgba(248, 250, 252, 0.48);
}

.teacher-card {
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(219, 228, 240, 0.6);
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 6px 16px rgba(44, 123, 229, 0.08);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.teacher-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(44, 123, 229, 0.16);
}

.teacher-card-clickable {
    cursor: pointer;
}

.teacher-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.teacher-card-head-text {
    min-width: 0;
}

.teacher-card-avatar-wrap {
    width: 54px;
    height: 54px;
    flex: 0 0 54px;
}

.teacher-card-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #dbe4f0;
    background: rgba(241, 245, 249, 0.5);
    display: block;
}

.teacher-card-avatar-fallback {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    background: rgba(227, 239, 255, 0.56);
    color: #2c7be5;
    border: 1px solid #dbe4f0;
}

.teacher-card-name {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

.teacher-card-rating {
    font-size: 22px;
    font-weight: 700;
    color: #1d4ed8;
    line-height: 1.2;
    margin-bottom: 8px;
}

.teacher-card-score {
    font-size: 13px;
    color: #475569;
    margin-bottom: 8px;
}

.teacher-card-progress {
    height: 8px;
    background: rgba(226, 232, 240, 0.56);
    border-radius: 999px;
    overflow: hidden;
}

.teacher-card-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2c7be5 0%, #f59e0b 100%);
}

.home-page .chart-wrap {
    width: 100%;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.58) 0%, rgba(248, 251, 255, 0.5) 100%);
    border: 1px solid rgba(219, 228, 240, 0.58);
    border-radius: 12px;
    padding: 12px;
}

.teacher-item {
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 0;
    list-style: none;
}

.teacher-item:last-child {
    border-bottom: 0;
}

.teacher-header {
    cursor: pointer;
    font-weight: 600;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

.teacher-header:hover {
    background: rgba(238, 244, 255, 0.48);
}

.criteria-list {
    list-style: none;
    padding-left: 20px;
    margin-top: 5px;
}

.criteria-list li {
    padding: 5px 0;
    font-size: 14px;
    color: #444;
}

@media (max-width: 820px) {
    .home-page {
        padding: 14px;
    }

    .home-page header {
        grid-template-columns: 1fr;
        justify-items: start;
        gap: 10px;
        padding: 12px 14px;
    }

    .home-page header h2 {
        font-size: 22px;
    }

    .home-page .login-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    .home-page {
        padding: 10px;
    }

    .home-page header {
        padding: 10px 12px;
        border-radius: 12px;
        gap: 8px;
    }

    .home-page header .logo {
        width: 52px;
    }

    .home-page header h2 {
        font-size: 20px;
        line-height: 1.2;
    }

    .home-page .cards-section,
    .home-page .chart,
    .home-page .teachers-below {
        margin-top: 12px;
        padding: 10px;
        border-radius: 12px;
    }

    .home-page h3 {
        font-size: 18px;
        margin-bottom: 10px;
    }

    .home-page .home-search input[type="search"] {
        width: 100%;
        font-size: 15px;
        min-height: 42px;
    }

    .teacher-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .teacher-card {
        padding: 12px;
    }

    .teacher-card-rating {
        font-size: 20px;
    }

    .home-page .chart-wrap {
        padding: 8px;
    }

    .criteria-list {
        padding-left: 12px;
    }
}

@media (max-width: 480px) {
    .home-page header h2 {
        font-size: 18px;
    }

    .teacher-card-head {
        align-items: flex-start;
    }

    .teacher-card-avatar-wrap,
    .teacher-card-avatar,
    .teacher-card-avatar-fallback {
        width: 46px;
        height: 46px;
        flex-basis: 46px;
    }

    .teacher-card-name {
        font-size: 14px;
    }
}

.app-toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    width: min(94vw, 380px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 10000;
    pointer-events: none;
}

@media (max-width: 640px) {
    .app-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .app-toast {
        grid-template-columns: 18px 1fr 20px;
        gap: 8px;
        padding: 10px;
    }

    .app-toast-message {
        font-size: 13px;
    }
}

.app-toast {
    display: grid;
    grid-template-columns: 20px 1fr 22px;
    gap: 10px;
    align-items: start;
    border-radius: 12px;
    padding: 12px 12px;
    border: 1px solid transparent;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(20px);
    animation: appToastIn 0.2s ease forwards;
}

.app-toast-leaving {
    animation: appToastOut 0.18s ease forwards;
}

.app-toast-icon {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
}

.app-toast-message {
    font-size: 14px;
    line-height: 1.35;
    word-break: break-word;
}

.app-toast-close {
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    margin: 0;
    opacity: 0.7;
}

.app-toast-close:hover {
    opacity: 1;
}

.app-toast-success {
    background: rgba(236, 253, 243, 0.96);
    border-color: #86efac;
    color: #166534;
}

.app-toast-success .app-toast-icon {
    background: #22c55e;
    color: #ffffff;
}

.app-toast-error {
    background: rgba(254, 242, 242, 0.96);
    border-color: #fca5a5;
    color: #991b1b;
}

.app-toast-error .app-toast-icon {
    background: #ef4444;
    color: #ffffff;
}

.app-toast-warning {
    background: rgba(255, 251, 235, 0.96);
    border-color: #fcd34d;
    color: #92400e;
}

.app-toast-warning .app-toast-icon {
    background: #f59e0b;
    color: #ffffff;
}

.app-toast-info {
    background: rgba(239, 246, 255, 0.96);
    border-color: #93c5fd;
    color: #1d4ed8;
}

.app-toast-info .app-toast-icon {
    background: #3b82f6;
    color: #ffffff;
}

@keyframes appToastIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes appToastOut {
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

@media (max-width: 640px) {
    .app-toast {
        grid-template-columns: 18px 1fr 20px;
        gap: 8px;
        padding: 10px;
    }

    .app-toast-message {
        font-size: 13px;
    }
}
