/* Stylish Professional Admin Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --bg-body: #f1f5f9;
    --bg-sidebar: #ffffff;
    --text-sidebar: #64748b;
    --text-sidebar-hover: #2563eb;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
}

body {
    background-color: var(--bg-body) !important;
    font-family: 'Inter', sans-serif !important;
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
    margin: 0;
}

/* ANIMATIONS */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* SIDEBAR - Fixed Left */
/* SIDEBAR - Fixed Left */
.sidebar {
    background: var(--bg-sidebar) !important;
    border-right: 1px solid #e2e8f0 !important;
    color: var(--text-sidebar);
    transition: all 0.3s ease;
    width: 260px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    padding: 24px;
    z-index: 1000;
    /* Increased Z-index to ensure it stays on top */
    overflow-y: auto;
    /* enable scrolling for sidebar if needed */
}

.sidebar-logo {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 22px;
    color: var(--primary-color) !important;
    padding-left: 12px;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    margin-bottom: 24px;
}

.sidebar-link {
    color: var(--text-sidebar) !important;
    font-weight: 500;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 6px;
    margin-bottom: 4px;
    border: 1px solid transparent;
    display: flex !important;
    align-items: center !important;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none !important;
}

.sidebar-link:hover {
    background: #eff6ff !important;
    color: var(--text-sidebar-hover) !important;
    padding-left: 20px !important;
}

.sidebar-link.active {
    background: #eff6ff !important;
    color: var(--primary-color) !important;
    font-weight: 600;
    border: 1px solid #bfdbfe;
}

.sidebar-link ion-icon {
    font-size: 20px;
}

/* PREMIUM MODERN CARDS */
.card,
.edu-card {
    background: #ffffff;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04) !important;
    border-radius: 16px !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08) !important;
    border-color: rgba(226, 232, 240, 1) !important;
}

.card-header {
    border-bottom: 1px solid #f1f5f9 !important;
    background: #ffffff;
    padding: 16px 24px;
    border-radius: 16px 16px 0 0;
}

/* MAIN CONTENT - Adjusted for Fixed Sidebar */
.main-content {
    margin-left: 280px;
    /* Increased margin for better separation */
    padding: 32px 40px;
    /* More padding for cleaner look */
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    width: auto;
    /* Allow auto width */
}

/* CONTENT LAYOUT - Grid System */
.content-layout {
    display: flex;
    /* Changed to flex for better control in single-column pages */
    flex-direction: column;
    gap: 32px;
    max-width: 1400px;
    /* Increased max-width */
    margin: 0 auto;
    width: 100%;
    align-items: stretch;
}

/* Retain grid for dashboard if needed, but often flex column is easier for vertical stacking of sections */
.grid-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

.feed-wrapper {
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
}

/* Feed Wrapper */
.feed-wrapper {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
    /* Ensure it fills the grid cell */
}

/* Right Sidebar Animation */
.right-sidebar {
    animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) backwards;
    animation-delay: 0.2s;
    width: 100%;
    /* Ensure it fills grid cell */
}

/* TYPOGRAPHY */
h1,
h2,
h3,
h4,
h5,
h6,
.text-main {
    color: var(--text-main);
    letter-spacing: -0.01em;
}

.text-muted {
    color: var(--text-muted);
}

/* BUTTONS */
.btn-primary {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    border-radius: 10px !important;
    font-weight: 600 !important;
    letter-spacing: 0.3px;
    padding: 10px 24px !important;
    border: none;
    color: white !important;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.4);
    transform: translateY(-1px);
}

/* INPUTS */
input[type="text"],
textarea,
input[type="email"],
input[type="password"] {
    background: #f8fafc !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 12px !important;
    padding: 12px 16px;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

input:focus,
textarea:focus {
    background: #ffffff !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1) !important;
    outline: none;
}

/* UTILITIES */
.flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.flex-start {
    display: flex;
    align-items: start;
    gap: 12px;
}

.flex-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-sm {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-md {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-lg {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    background: #f1f5f9;
    color: var(--text-muted);
    border-radius: 50%;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: color 0.2s;
}

.btn-icon:hover {
    color: var(--primary-color);
}

.suggestion-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
}

.suggestion-btn {
    border: none;
    background: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 12px;
    cursor: pointer;
}

/* Widget Scrolling */
.widget-scroll {
    max-height: none;
    overflow-y: visible;
    padding-right: 0;
    /* Space for scrollbar */
}

.widget-scroll::-webkit-scrollbar {
    width: 4px;
}

.widget-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.widget-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.widget-scroll::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.mobile-header {
    display: none;
}

/* RESPONSIVE */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0;
        padding: 80px 20px 20px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.1);
    }

    .content-layout {
        grid-template-columns: 1fr;
    }

    .right-sidebar {
        display: none;
        /* Simplification for mobile */
    }

    .mobile-header {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: 60px;
        background: white;
        z-index: 999;
        border-bottom: 1px solid #e2e8f0;
        align-items: center;
        justify-content: space-between;
        padding: 0 20px;
    }

    .mobile-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.4);
        z-index: 99;
    }

    .mobile-overlay.active {
        display: block;
    }
}