:root {
    --soft-bg: #f8fafc;
    --sidebar-bg: #ffffff;
    --accent-color: #6366f1;
    --text-main: #1e293b;
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 80px;
    --transition-speed: 0.3s;
}

body {
    font-family: "Grandstander", cursive;
    font-optical-sizing: auto;
    font-style: normal;
    background-color: var(--soft-bg);
    color: var(--text-main);
    overflow-x: hidden;
}

#wrapper {
    display: flex;
    width: 100%;
    align-items: stretch;
}

/* --- Sidebar --- */
#sidebar {
    min-width: var(--sidebar-width);
    max-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid #e2e8f0;
    height: 100vh;
    position: sticky;
    top: 0;
    overflow-y: auto;
    z-index: 1001;
}

/* Hide scrollbar tapi tetap bisa scroll */
#sidebar {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

#sidebar::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

#sidebar.collapsed {
    min-width: var(--sidebar-collapsed-width);
    max-width: var(--sidebar-collapsed-width);
}

#sidebar.collapsed .sidebar-header span,
#sidebar.collapsed .nav-link span,
#sidebar.collapsed .nav-label span {
    display: none;
}

.nav-label {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

#sidebar.collapsed .nav-label {
    padding: 0.8rem 0;
    text-align: center;
}

#sidebar.collapsed .nav-label::after {
    content: '•';
    display: block;
    color: #cbd5e1;
    font-size: 0.5rem;
}

#sidebar.collapsed .sidebar-header {
    justify-content: center;
    padding: 2rem 0;
}

#sidebar.collapsed .nav-link {
    justify-content: center;
    margin: 0.2rem 0.5rem;
    padding: 0.8rem 0;
}

/* Styling untuk menu kelas */
.nav-link .class-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    /* Enable flex truncation */
    width: 100%;
}

.nav-link .class-avatar {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    flex-shrink: 0;
}

.nav-link .class-details {
    min-width: 0;
    /* Enable text truncation */
    flex: 1;
    overflow: hidden;
}

.nav-link .class-details h6 {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

.nav-link .class-details small {
    font-size: 0.75rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 140px;
}

/* Responsive saat sidebar collapsed */
#sidebar.collapsed .nav-link .class-details {
    display: none;
}

#sidebar.collapsed .nav-link .class-info {
    justify-content: center;
}

#sidebar.collapsed .empty-class-notice {
    display: none;
}

.sidebar-header {
    padding: 2rem 1.5rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.nav-link {
    padding: 0.8rem 1.5rem;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    margin: 0.2rem 1rem;
    white-space: nowrap;
    transition: 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
    background: #f1f5f9;
}

/* --- Content Area --- */
#content {
    width: 100%;
    min-width: 0;
    /* Required for flex child to shrink properly */
    overflow-x: clip;
    /* Enables text-truncate but preserves sticky header */
    transition: all var(--transition-speed);
}

.top-navbar {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 0.8rem 2rem;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* --- Custom Modal --- */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid #f1f5f9;
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #f1f5f9;
    padding: 1.2rem;
}

.form-control {
    border-radius: 10px;
    padding: 0.6rem 1rem;
    border: 1px solid #e2e8f0;
    background-color: #f8fafc;
}

.form-control:focus {
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    border-color: var(--accent-color);
}

/* Responsive Mobile */
@media (max-width: 768px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        position: fixed;
    }

    #sidebar.active {
        margin-left: 0;
    }

    .top-navbar {
        padding: 0.8rem 1rem;
    }
}

.btn-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #e2e8f0;
    transition: 0.2s;
}

.btn-toggle:hover {
    background: #f1f5f9;
    color: var(--accent-color);
}

.btn {
    border-radius: 10px;
    padding: 0.6rem 1rem;
}

.btn-primary-soft {
    background-color: var(--accent-color);
    color: white;
    border: none;
    font-weight: 500;
    transition: 0.3s;
}

.btn-primary-soft:hover {
    background-color: #4f46e5;
    transform: translateY(-1px);
    color: white;
}

.breadcrumb-primary-soft {
    color: var(--accent-color);
}

.breadcrumb-primary-soft:hover {
    color: #4f46e5;
}

.btn-primary-outline {
    background-color: var(--soft-bg);
    color: var(--accent-color);
    border: 1px solid var(--accent-color);
    font-weight: 500;
    transition: 0.3s;
}

.btn-primary-outline:hover {
    background-color: var(--accent-color);
    transform: translateY(-1px);
    color: white;
}

.bg-primary-soft {
    background-color: #6366f1;
    color: var(--soft-bg);
}

.card {
    border-radius: 10px;
    box-shadow: 0 5px 25px -12px rgba(0, 0, 0, 0.1);
}

.nav-tabs .nav-link {
    isolation: isolate;
    border: 1px solid var(--soft-bg);
    border-radius: 10px;
    transition: 0.3s ease-in-out;
    margin: 0px 2px 2px 2px;
}

.nav-tabs .nav-link:focus {
    background: var(--accent-color);
    color: var(--soft-bg);
    border: 1px solid var(--accent-color);
}

.nav-tabs .nav-link:hover {
    border: 1px solid var(--accent-color);
}

.nav-tabs .nav-link.active {
    background: var(--accent-color);
    color: var(--soft-bg);
    border: 1px solid var(--accent-color);
}

.post-card-body {
    transition: 0.3s ease-in-out;
    border-radius: 10px;
}

.post-card-body:hover {
    box-shadow: 0 5px 25px -12px rgba(0, 0, 0, 0.1);
}

.rounded {
    border-radius: 10px !important;
}

/* ============================================
   LOGIN PAGE STYLES
   ============================================ */

body.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 500px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #8b5cf6 100%);
    border-radius: 20px;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.4);
}

.login-logo i {
    font-size: 32px;
    color: white;
}

.login-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 8px;
}

.login-header p {
    color: #64748b;
    font-size: 14px;
}

/* Login Form Group */
.login-card .form-group {
    margin-bottom: 20px;
}

.login-card .form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.input-group-custom {
    position: relative;
}

.input-group-custom>i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    font-size: 18px;
    transition: color 0.3s;
    z-index: 1;
}

.login-card .form-control:focus {
    outline: none;
    border-color: var(--accent-color);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.input-group-custom:focus-within>i {
    color: var(--accent-color);
}

/* Form Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.login-card .form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-card .form-check-input {
    width: 18px;
    height: 18px;
    border: 2px solid #cbd5e1;
    border-radius: 5px;
    cursor: pointer;
    accent-color: var(--accent-color);
}

.login-card .form-check-label {
    font-size: 14px;
    color: #64748b;
    cursor: pointer;
}

.forgot-password {
    font-size: 14px;
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.forgot-password:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

.divider span {
    padding: 0 16px;
    color: #94a3b8;
    font-size: 13px;
}

/* Register Link */
.register-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: #64748b;
}

.register-link a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.register-link a:hover {
    color: #4f46e5;
    text-decoration: underline;
}

/* Floating Shapes Decoration */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.shape {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 15s infinite;
}

.shape:nth-child(1) {
    width: 80px;
    height: 80px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape:nth-child(2) {
    width: 120px;
    height: 120px;
    top: 70%;
    left: 80%;
    animation-delay: 2s;
}

.shape:nth-child(3) {
    width: 60px;
    height: 60px;
    top: 40%;
    left: 70%;
    animation-delay: 4s;
}

.shape:nth-child(4) {
    width: 100px;
    height: 100px;
    top: 80%;
    left: 20%;
    animation-delay: 6s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 0;
    transition: color 0.3s;
}

.password-toggle:hover {
    color: var(--accent-color);
}

.min-w-0 {
    min-width: 0;
}

.post-card .text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 100%;
}