/* ==========================================================
   CLASSES PAGE (GOOGLE CLASSROOM STYLE)
   ========================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

body {
    font-family: 'Roboto', 'Google Sans', sans-serif;
    background-color: #f4f7fb;
    color: #3C4043;
}

/* --- Header --- */
.cl-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    height: 64px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    position: relative;
    z-index: 100;
}

.cl-header-left,
.cl-header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cl-icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.cl-icon-btn:hover {
    background-color: rgba(60, 64, 67, 0.08);
}

.cl-icon-btn svg {
    fill: #5f6368;
    width: 24px;
    height: 24px;
}

.cl-logo-wrap {
    display: flex;
    align-items: center;
    margin-left: 8px;
}

.cl-logo-icon {
    width: 24px;
    height: 24px;
    background: #1e8e3e;
    border-radius: 6px;
    margin-right: 12px;
}

.cl-logo-text {
    font-size: 22px;
    font-weight: 600;
    color: #2c3e50;
    font-family: 'Google Sans', sans-serif;
}

.cl-profile {
    position: relative;
    cursor: pointer;
}

.cl-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
}

/* --- Avatar Dropdown --- */
.cl-avatar-dropdown {
    display: none !important;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 280px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    padding: 8px 0;
}

.cl-avatar-dropdown.open {
    display: block !important;
    animation: cl-dropdown-in 0.2s ease-out;
}

@keyframes cl-dropdown-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cl-avatar-dd-header {
    display: flex;
    align-items: center;
    padding: 16px;
}

.cl-avatar-dd-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    margin-right: 16px;
    object-fit: cover;
}

.cl-avatar-dd-name {
    font-size: 16px;
    font-weight: 500;
    color: #202124;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.cl-avatar-dd-email {
    font-size: 14px;
    color: #5f6368;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.cl-avatar-dd-divider {
    height: 1px;
    background: #dadce0;
    margin: 8px 0;
}

.cl-avatar-dd-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: #3c4043;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: transparent;
    border: none;
    width: 100%;
    text-align: left;
    transition: background-color 0.2s;
}

.cl-avatar-dd-item:hover {
    background-color: #f1f3f4;
}

.cl-avatar-dd-item svg {
    width: 20px;
    height: 20px;
    margin-right: 16px;
    fill: #5f6368;
}

.cl-avatar-dd-logout {
    color: #d93025;
}

.cl-avatar-dd-logout svg {
    fill: #d93025;
}

/* --- Layout --- */
.cl-layout {
    display: flex;
    height: calc(100vh - 64px);
    overflow: hidden;
}

/* --- Sidebar --- */
.cl-sidebar {
    width: 300px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: none;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
    padding-top: 12px;
    transition: margin-left 0.3s ease;
}

.cl-sidebar.hidden {
    margin-left: -300px;
}

.cl-nav {
    display: flex;
    flex-direction: column;
}

.cl-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    text-decoration: none;
    color: #3c4043;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    border-radius: 0 24px 24px 0;
    margin-right: 8px;
    transition: background 0.2s;
}

.cl-nav-item:hover {
    background-color: rgba(226, 232, 240, 0.6);
}

.cl-nav-item.active {
    background-color: #e2e8f0;
    color: #3b82f6;
    box-shadow: 0 4px 10px rgba(59, 130, 246, 0.1);
}

.cl-nav-item.active .cl-nav-icon {
    fill: #1a73e8;
}

.cl-nav-icon {
    width: 24px;
    height: 24px;
    margin-right: 24px;
    fill: #5f6368;
}

.cl-nav-divider {
    height: 1px;
    background-color: #e0e0e0;
    margin: 8px 0;
}

.cl-nav-section-title {
    display: flex;
    align-items: center;
    padding: 8px 24px;
    font-size: 13px;
    font-weight: 500;
    color: #3c4043;
}

.cl-chevron {
    width: 20px;
    height: 20px;
    fill: #5f6368;
    margin-left: auto;
}

/* Sidebar class avatar */
.cl-class-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    margin-right: 16px;
    flex-shrink: 0;
}

.cl-class-link {
    padding: 8px 24px;
}

/* --- Main Content --- */
.cl-main {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background-color: transparent;
}

.cl-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* --- Empty State --- */
.cl-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    text-align: center;
    color: #80868b;
}

.cl-empty-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
}

.cl-empty-state h2 {
    font-size: 22px;
    font-weight: 400;
    color: #3c4043;
    margin-bottom: 8px;
}

.cl-empty-state p {
    font-size: 14px;
    color: #80868b;
}

/* --- Class Cards --- */
.cl-card {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease;
}

.cl-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.cl-card-header {
    height: 110px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    color: #fff;
    position: relative;
}

.cl-card-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.6));
    border-radius: 16px 16px 0 0;
}

/* Card background colors */
.bg-green {
    background: linear-gradient(135deg, #1e8e3e, #137333);
}

.bg-blue {
    background: linear-gradient(135deg, #4285f4, #1a73e8);
}

.bg-orange {
    background: linear-gradient(135deg, #e8710a, #d25f02);
}

.bg-dark-blue {
    background: linear-gradient(135deg, #174ea6, #0d47a1);
}

.bg-teal {
    background: linear-gradient(135deg, #009688, #00796b);
}

.bg-purple {
    background: linear-gradient(135deg, #7b1fa2, #6a1b9a);
}

.cl-card-header-content {
    z-index: 1;
    width: calc(100% - 40px);
}

.cl-card-title {
    margin: 0;
    font-size: 22px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cl-card-title a {
    color: #fff;
    text-decoration: none;
}

.cl-card-title a:hover {
    text-decoration: underline;
}

.cl-card-section {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 4px;
}

.cl-card-more {
    z-index: 1;
    width: 40px;
    height: 40px;
    margin-top: -8px;
    margin-right: -8px;
}

.cl-card-more svg {
    fill: #fff;
}

.cl-card-more:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.cl-card-body {
    flex: 1;
    background: #fff;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
}

.cl-card-footer {
    display: flex;
    justify-content: flex-end;
    padding: 4px;
    background: #fff;
}

.cl-footer-icon {
    width: 40px;
    height: 40px;
}

/* --- Modal --- */
.cl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.cl-modal-overlay.active {
    display: flex;
}

.cl-modal {
    background: #fff;
    border-radius: 8px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    animation: cl-modal-in 0.2s ease-out;
}

@keyframes cl-modal-in {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.cl-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.cl-modal-header h3 {
    font-size: 18px;
    font-weight: 500;
    color: #3c4043;
}

.cl-modal-close svg {
    fill: #5f6368;
}

.cl-form-group {
    padding: 12px 24px 0;
}

.cl-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #5f6368;
    margin-bottom: 6px;
}

.cl-required {
    color: #d93025;
}

.cl-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dadce0;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    outline: none;
    transition: border-color 0.2s;
}

.cl-form-group input:focus {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

/* Color Picker */
.cl-color-picker {
    display: flex;
    gap: 10px;
    padding: 4px 0;
}

.cl-color-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s;
}

.cl-color-dot:hover {
    transform: scale(1.15);
}

.cl-color-dot.active {
    border-color: #3c4043;
    transform: scale(1.1);
}

/* Modal Footer */
.cl-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
}

.cl-btn-cancel,
.cl-btn-create {
    padding: 8px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: 'Roboto', sans-serif;
}

.cl-btn-cancel {
    background: transparent;
    color: #1a73e8;
}

.cl-btn-cancel:hover {
    background: rgba(26, 115, 232, 0.04);
}

.cl-btn-create {
    background: #1a73e8;
    color: #fff;
}

.cl-btn-create:hover {
    background: #1557b0;
}

/* --- 3 dot Dropdown --- */
.cl-dropdown {
    position: absolute;
    top: 40px;
    right: 0;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 50;
    min-width: 160px;
    overflow: hidden;
}

.cl-dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    color: #3c4043;
    cursor: pointer;
    text-align: left;
}

.cl-dropdown-item:hover {
    background: #f1f3f4;
}

.cl-dropdown-delete {
    color: #d93025;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .cl-sidebar {
        width: 260px;
    }

    .cl-grid {
        grid-template-columns: 1fr;
    }
}