﻿/* ================= RESET ================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: Inter, Arial, sans-serif;
}

body {
    background: #f6f7fb;
    color: #303545;
    overflow-x: hidden;
}

/* ================= HEADER ================= */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    min-height: 72px;
    height: auto;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 28px;
    z-index: 1000;
}

/* Header left */
.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.menu-icon {
    font-size: 24px;
    cursor: pointer;
}

.logo {
    font-size: 32px;
    font-weight: 900;
    color: #4255ff;
    text-decoration: none;
    white-space: nowrap;
}

/* Search */
.search-box {
    position: relative;
    flex: 1;
    min-width: 0;
    max-width: 460px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 16px;
}

.search-box input {
    width: 100%;
    min-width: 0;
    padding: 12px 18px 12px 44px;
    border-radius: 999px;
    border: none;
    background: #f6f7fb;
    font-size: 15px;
    line-height: 1.5;
}

.search-box input:focus {
    outline: none;
}

/* Header right */
.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.btn-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #4255ff;
    color: white;
    cursor: pointer;
    font-size: 16px;
}

.btn-circle:hover {
    background: #2f3fe0;
}

.btn-upgrade {
    background: #ffcd1f;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
}

.avatar {
    width: 44px;
    height: 44px;
    background-color: #bfdbfe;
    /* fallback when no image */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 50%;
}

/* ================= SIDEBAR ================= */
.sidebar {
    position: fixed;
    top: 72px;
    left: 0;
    width: 300px;
    /* scale to */
    height: calc(100vh - 72px);
    background: #fff;
    border-right: 1px solid #e5e7eb;
    padding: 24px;
    display: flex;
    flex-direction: column;
    z-index: 900;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

/* Desktop collapse (GIỮ NGUYÊN) */
.sidebar.collapsed {
    transform: translateX(-100%);
}

/* Navigation */
.nav-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px 18px;
    border-radius: 14px;
    color: #374151;
    text-decoration: none;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
}

.nav-item i {
    font-size: 20px;
    min-width: 26px;
}

.nav-item:hover {
    background: #f3f4f6;
}

.nav-item.active {
    background: #eef2ff;
    color: #4255ff;
}

/* Sidebar Dropdown Menu */
.nav-dropdown {
    display: flex;
    flex-direction: column;
}

.nav-dropdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-radius: 14px;
    color: #374151;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    transition: background 0.2s;
}

.nav-dropdown-item:hover {
    background: #f3f4f6;
}

.nav-dropdown-item.active {
    color: #4255ff;
}

.nav-dropdown-title {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-dropdown-title i {
    font-size: 20px;
    min-width: 26px;
}

.dropdown-arrow {
    font-size: 14px;
    color: #6b7280;
    transition: transform 0.3s;
}

.nav-dropdown.expanded .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease-in-out;
}

.nav-dropdown-menu.show {
    max-height: 400px;
}

.nav-sub-item {
    padding: 12px 18px 12px 64px; /* thụt lề vào trong */
    color: #4b5563;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
}

.nav-sub-item:hover {
    background: #f3f4f6;
    color: #111827;
}

.nav-sub-item.active {
    background: #eef2ff;
    color: #4255ff;
}

/* Divider */
.sidebar hr {
    border: none;
    border-top: 1px solid #f1f5f9;
    margin: 28px 0;
}

/* Workspace */
.workspace-title {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    color: #9ca3af;
    margin-bottom: 14px;
}

.workspace-btn {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: none;
    border: none;
    border-radius: 14px;
    color: #374151;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
}

.workspace-btn:hover {
    background: #eef2ff;
    color: #4255ff;
}

.icon-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Sidebar footer */
.sidebar-footer {
    margin-top: auto;
    background: #f9fafb;
    padding: 16px;
    border-radius: 16px;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

/* ================= MAIN ================= */
.main {
    margin-top: 72px;
    margin-left: 300px;
    padding: 32px;
    min-height: calc(100vh - 72px);
}

/* Sidebar collapsed layout (GIỮ NGUYÊN) */
.layout.sidebar-collapsed .main {
    margin-left: 0;
}

/* ================= MODAL ================= */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.tct-modal {
    background: #fff;
    width: 400px;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.18);
    animation: scaleIn 0.25s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-title {
    font-size: 20px;
    font-weight: 800;
    margin-bottom: 18px;
}

.modal-input {
    width: 100%;
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    font-size: 15px;
    margin-bottom: 22px;
}

.modal-input:focus {
    outline: none;
    border-color: #4255ff;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 14px;
}

.btn-decline {
    background: #f3f4f6;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
}

.btn-decline:hover {
    background: #e5e7eb;
}

.btn-confirm {
    background: #4255ff;
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
}

.btn-confirm:hover {
    background: #2f3fe0;
}

/* ================= RESPONSIVE ================= */

/* Tablet */
@media (max-width: 1024px) {
    .header {
        gap: 12px;
    }

    .header-left {
        gap: 18px;
    }

    .search-box {
        max-width: 320px;
    }

    .btn-upgrade {
        display: none;
    }

    .sidebar {
        width: 260px;
    }

    .main {
        margin-left: 260px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .header {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
    }

    .header-left {
        gap: 12px;
        min-width: 0;
    }

    .search-box {
        max-width: none;
        min-width: 0;
    }

    .header-right {
        gap: 8px;
        min-width: 0;
    }

    .btn-circle,
    .btn-notification {
        width: 40px;
        height: 40px;
    }

    .btn-circle,
    .btn-notification {
        font-size: 15px;
    }

    .search-box i {
        left: 14px;
        font-size: 14px;
    }

    .search-box input {
        padding: 10px 14px 10px 38px;
    }

    .notification-badge {
        top: 0;
        right: 0;
        font-size: 10px;
        padding: 1px 5px;
    }

    .user-menu-container {
        margin-left: 0;
    }

    .user-profile {
        gap: 8px;
        padding: 4px 8px;
    }

    .user-name-display {
        display: none;
    }

    .main {
        margin-left: 0;
        padding: 16px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .header {
        gap: 8px;
        padding: 8px 10px;
    }

    .logo {
        font-size: 24px;
    }

    .menu-icon {
        font-size: 22px;
    }

    .header-left {
        gap: 10px;
    }

    .header-right {
        gap: 6px;
    }

    .search-box i {
        left: 12px;
        font-size: 14px;
    }

    .search-box input {
        font-size: 13px;
        padding: 10px 12px 10px 36px;
    }

    .btn-circle,
    .btn-notification {
        width: 38px;
        height: 38px;
        font-size: 15px;
    }

    .notification-badge {
        font-size: 9px;
        padding: 1px 4px;
    }
}

/* ================= TOPIC SELECTION MODAL ================= */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.topic-card {
    border: 2px solid #edeff4;
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.topic-card:hover {
    border-color: #4255ff;
    background-color: #f6f7fb;
    transform: translateY(-2px);
}

.topic-card.create-new {
    border-style: dashed;
    background-color: #f9fafb;
}

.topic-card.create-new:hover {
    border-color: #4255ff;
    background-color: #eff6ff;
}

.topic-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.topic-name {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 4px;
    color: #282e3e;
}

.topic-desc {
    font-size: 13px;
    color: #586380;
}

/* Responsive Grid */
/* Responsive Grid */
@media (max-width: 600px) {
    .topic-grid {
        grid-template-columns: 1fr;
    }
}

/* ================= USER DROPDOWN ================= */
.user-menu-container {
    position: relative;
    margin-left: 12px;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: 99px;
    transition: background 0.2s;
    border: 1px solid transparent;
}

.user-profile:hover {
    background: #f6f7fb;
    border-color: #edeff4;
}

.user-name-display {
    font-weight: 700;
    font-size: 14px;
    color: #282e3e;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 280px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    padding: 8px;
    display: none;
    z-index: 10000;
    border: 1px solid #edeff4;
}

.user-dropdown.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
}

.avatar.small {
    width: 40px;
    height: 40px;
    background-size: cover;
    background-position: center;
}

.user-info-text .name {
    font-weight: 700;
    font-size: 15px;
    color: #282e3e;
}

.user-info-text .email {
    font-size: 12px;
    color: #586380;
    word-break: break-all;
}

.user-dropdown hr {
    border: none;
    border-top: 2px solid #f6f7fb;
    margin: 8px 0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    color: #586380;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: 0.2s;
}

.dropdown-item:hover {
    background: #f6f7fb;
    color: #282e3e;
}

.dropdown-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.dropdown-item.logout {
    color: #ef4444;
}

.dropdown-item.logout:hover {
    background: #fef2f2;
    color: #dc2626;
}
.search-dropdown {
    position: absolute;
    top: 48px;
    left: 0;
    width: 100%;
    background: #0f172a;
    border-radius: 12px;
    padding: 10px;
    box-shadow: 0 20px 40px rgba(0,0,0,.4);
    z-index: 1000;
}

.search-section {
    margin-bottom: 12px;
}

.search-title {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 6px 8px;
}

.search-item {
    display: flex;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    color: #e5e7eb;
    text-decoration: none;
}

    .search-item:hover {
        background: #1e293b;
    }

    .search-item .name {
        font-weight: 500;
    }

    .search-item .meta {
        font-size: 0.75rem;
        color: #9ca3af;
    }

.search-empty {
    padding: 12px;
    text-align: center;
    color: #9ca3af;
}
/* ================= HEADER NOTIFICATION ================= */

.btn-notification {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #f3f4f6;
    color: #374151;
    cursor: pointer;
    font-size: 18px;
    transition: 0.2s;
}

    .btn-notification:hover {
        background: #e5e7eb;
    }

.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 999px;
}
.nav-sub-item i {
    margin-right: 8px;
}
/* dropdown items alignment */
.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* small icon circle for dropdown */
.icon-circle.small {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
/* reset button nav-sub-item */
button.nav-sub-item {
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font: inherit;
}
/* ================= FOOTER ================= */

.tct-footer {
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    margin-top: 60px;
    overflow-x: auto; /* nếu màn hình quá nhỏ sẽ scroll ngang */
}

.footer-container {
    max-width: 1200px;
    margin: auto;
    padding: 50px 30px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: nowrap; /* KHÔNG BAO GIỜ xuống dòng */
}

    /* tránh cột bị bó quá nhỏ */
    .footer-container > div {
        min-width: 180px;
    }

/* ================= BRAND ================= */

.footer-brand {
    max-width: 320px;
}

    .footer-brand h3 {
        font-size: 22px;
        color: #4255ff;
        font-weight: 800;
        margin-bottom: 10px;
    }

    .footer-brand p {
        color: #6b7280;
        line-height: 1.6;
        margin-bottom: 20px;
    }

/* ================= CONTACT ================= */

.footer-contact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #4b5563;
    font-size: 14px;
}

    .contact-item i {
        width: 18px;
        color: #4255ff;
    }

/* ================= LINKS ================= */

.footer-links h4,
.footer-social h4 {
    margin-bottom: 14px;
    font-size: 16px;
    font-weight: 700;
}

.footer-links a {
    display: block;
    text-decoration: none;
    color: #6b7280;
    margin-bottom: 8px;
    transition: 0.2s;
}

    .footer-links a:hover {
        color: #4255ff;
        transform: translateX(2px);
    }

/* ================= SOCIAL ================= */

.social-icons {
    display: flex;
    gap: 12px;
}

    .social-icons a {
        width: 36px;
        height: 36px;
        border-radius: 10px;
        border: 1px solid #e5e7eb;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #6b7280;
        transition: 0.2s;
    }

        .social-icons a:hover {
            background: #4255ff;
            color: white;
            border-color: #4255ff;
        }

/* ================= BOTTOM ================= */

.footer-bottom {
    text-align: center;
    border-top: 1px solid #f1f5f9;
    padding: 18px;
    font-size: 13px;
    color: #6b7280;
}
