/* ===================================================
   AUT Smart Chatbot - World Class Premium Design
   Aqaba University of Technology
   Design: Enterprise-Grade AI Interface
   =================================================== */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* --- Modern Deep Navy Palette --- */
    --bg-base: #020617;
    --bg-sidebar: #0B1120;
    --bg-card: rgba(15, 23, 42, 0.6);
    --bg-glass: rgba(30, 41, 59, 0.4);

    --primary: #3B82F6;
    --primary-bright: #60A5FA;
    --primary-glow: rgba(59, 130, 246, 0.5);

    --accent: #F59E0B;
    --accent-glow: rgba(245, 158, 11, 0.3);

    --text-white: #F8FAFC;
    --text-muted: #94A3B8;
    --border-light: rgba(255, 255, 255, 0.08);

    --radius-full: 9999px;
    --radius-xl: 28px;
    --radius-lg: 18px;
    --radius-md: 12px;

    --transition-premium: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

body.light-mode {
    --bg-base: #F8FAFC;
    --bg-sidebar: #FFFFFF;
    --bg-card: rgba(241, 245, 249, 0.8);
    --bg-glass: rgba(255, 255, 255, 0.6);
    --text-white: #0F172A;
    --text-muted: #64748B;
    --border-light: rgba(15, 23, 42, 0.08);
    --primary: #2563EB;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

body {
    font-family: 'IBM Plex Sans Arabic', 'Outfit', sans-serif;
    background: var(--bg-base);
    color: var(--text-white);
    height: 100vh;
    display: flex;
    overflow: hidden;
}

/* --- Entrance Animation --- */
#app {
    display: flex;
    width: 100%;
    height: 100%;
    animation: appEntrance 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes appEntrance {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(10px);
        filter: blur(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0);
    }
}

/* --- SIDEBAR: Ultra-Modern --- */
.sidebar {
    width: 320px;
    background: var(--bg-sidebar);
    border-left: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    padding: 32px 20px;
    position: relative;
    z-index: 10;
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.2);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 12px 40px;
}

.brand-icon {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.brand-text h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-white);
    letter-spacing: -0.5px;
}

.brand-text p {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.nav-section {
    margin-bottom: 32px;
}

.section-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 0 12px 12px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-premium);
    margin-bottom: 4px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-white);
    transform: translateX(-5px);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(59, 130, 246, 0.15) 0%, transparent 100%);
    color: var(--primary-bright);
    border-right: 3px solid var(--primary);
}

/* --- MAIN VIEW: Glass & Depth --- */
.main-view {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.05), transparent 400px),
        radial-gradient(circle at bottom left, rgba(245, 158, 11, 0.03), transparent 400px);
}

.top-bar {
    height: 80px;
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    backdrop-filter: blur(10px);
}

.view-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.status-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #10B981;
    background: rgba(16, 185, 129, 0.1);
    padding: 6px 14px;
    border-radius: 20px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10B981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* --- CHAT AREA: Immersive --- */
.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    scrollbar-width: none;
}

.chat-window::-webkit-scrollbar {
    display: none;
}

.message {
    display: flex;
    gap: 20px;
    max-width: 850px;
    width: 100%;
    opacity: 0;
    transform: translateY(20px);
    animation: msgIn 0.6s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes msgIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-start;
    flex-direction: row-reverse;
    margin-right: auto;
}

.message.bot {
    align-self: flex-end;
    margin-left: auto;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid var(--border-light);
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bubble {
    padding: 18px 24px;
    border-radius: 22px;
    font-size: 1.05rem;
    line-height: 1.7;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
}

.message.bot .bubble {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-top-right-radius: 4px;
}

.message.user .bubble {
    background: linear-gradient(135deg, var(--primary) 0%, #1D4ED8 100%);
    color: white;
    border-top-left-radius: 4px;
    box-shadow: 0 10px 30px var(--primary-glow);
}

/* --- INPUT: Floating Dock --- */
.input-dock {
    padding: 0 40px 40px;
}

.input-container {
    background: var(--bg-sidebar);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transition: var(--transition-premium);
}

.input-container:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 40px var(--primary-glow);
    transform: translateY(-2px);
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-white);
    padding: 12px;
    font-size: 1.05rem;
    font-family: inherit;
    resize: none;
    max-height: 150px;
}

.send-button {
    width: 52px;
    height: 52px;
    background: var(--primary);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    color: white;
    transition: var(--transition-premium);
}

.send-button:hover {
    transform: scale(1.05) rotate(-5deg);
    background: var(--primary-bright);
    box-shadow: 0 10px 25px var(--primary-glow);
}

/* --- DASHBOARD: Grid --- */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 0 40px 20px;
}

.grid-item {
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    padding: 14px;
    border-radius: 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-white);
    cursor: pointer;
    text-align: center;
    transition: var(--transition-premium);
}

.grid-item:hover {
    background: var(--primary);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px var(--primary-glow);
    border-color: transparent;
}

/* --- GPA Premium UI --- */
.gpa-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 24px;
    margin-top: 16px;
}

.gpa-row {
    display: grid;
    grid-template-columns: 1fr 100px 80px 40px;
    gap: 12px;
    margin-bottom: 12px;
    align-items: center;
}

.gpa-input-styled {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 12px;
    color: white;
    outline: none;
    transition: 0.3s;
    width: 100%;
}

.gpa-input-styled:focus {
    border-color: var(--primary);
    background: rgba(59, 130, 246, 0.1);
}

.btn-add {
    background: var(--bg-glass);
    border: 1px solid var(--border-light);
    color: var(--text-white);
    padding: 10px 20px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
}

.btn-calc {
    background: var(--primary);
    color: white;
    padding: 10px 30px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    box-shadow: 0 5px 15px var(--primary-glow);
}

/* --- Responsive --- */
@media (max-width: 1100px) {
    .sidebar {
        width: 260px;
    }
}

@media (max-width: 900px) {
    .sidebar {
        position: fixed;
        right: -320px;
        transition: 0.4s;
    }

    .sidebar.open {
        right: 0;
    }
}

/* --- Markdown Fixes --- */
.bubble h2 {
    color: var(--accent);
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.bubble li {
    margin-bottom: 6px;
}

.bubble a {
    color: var(--primary-bright);
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: 0.3s;
}

.bubble a:hover {
    border-bottom-color: var(--primary-bright);
}

/* --- Faculty Card Premium UI --- */
.faculty-header {
    font-size: 1.3rem;
    color: var(--accent);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.faculty-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 15px;
    direction: rtl;
}

.faculty-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: 18px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition-premium);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.faculty-card:hover {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--primary);
    transform: translateX(-5px);
}

.faculty-card::after {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary);
    opacity: 0;
    transition: 0.3s;
}

.faculty-card:hover::after {
    opacity: 1;
}

.faculty-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    flex-shrink: 0;
}

.faculty-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.faculty-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-white);
    margin-bottom: 2px;
}

.faculty-title {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.faculty-link-btn {
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-bright);
    text-decoration: none;
    transition: 0.3s;
}

.faculty-link-btn:hover {
    background: var(--primary);
    color: white;
    border-color: transparent;
    transform: scale(1.1);
}