/* Abbas AI Styles - Following Main Site Design System */
:root {
    --primary-blue:  #800020;
    --secondary-blue:  #5D3A1A;
    --accent-yellow:  #D4AF37;
    --text-light: #FFFFFF;
    --text-dark:  #2C1810;
    --grey-background: #F8F8F8;
    --border-color:  #E8D4C1;
    --light-blue-bg:  #E8D4C1;
    --shadow-light: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --shadow-strong: rgba(0, 0, 0, 0.15);
    --ai-chat-bg:  #F5ECE4;
    --user-message-bg: var(--secondary-blue);
    --ai-message-bg: var(--light-blue-bg);
}

/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--grey-background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header and Navigation (Same as Main Site) */
.hero-section {
    background-color: var(--primary-blue);
    color: var(--text-light);
    padding: 20px 0 0;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    background-image: url('./pics/ai.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
    overflow: hidden;
}

.hero-section .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.navbar-top-logo {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 40px;
    max-width: 1200px;
    z-index: 10;
}

.logo img {
    height: 80px;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.2));
}

.hero-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding-top: 50px;
    padding-bottom: 50px;
    z-index: 5;
}

.hero-content h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 3.5em;
    margin-bottom: 10px;
    line-height: 1.1;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
}

.hero-content h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2em;
    margin-bottom: 15px;
    font-weight: 400;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.hero-content p {
    font-size: 1.2em;
    margin-bottom: 30px;
    opacity: 0.9;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.btn-primary {
    background-color: var(--accent-yellow);
    color: var(--primary-blue);
    padding: 15px 30px;
    border-radius: 5px;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 6px 15px var(--shadow-medium);
    border: none;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary:hover {
    background-color: #E6C229;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px var(--shadow-strong);
}

.main-nav-container {
    background-color: var(--secondary-blue);
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-nav {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 10px;
    box-sizing: border-box;
    height: auto;
    align-items: center;
    list-style-type: none;
}

.main-nav li a {
    color: var(--text-light);
    font-weight: 600;
    padding: 5px 0;
    transition: all 0.3s ease;
    text-transform: uppercase;
    white-space: nowrap;
    text-decoration: none;
    
}

.main-nav li a:hover,
.main-nav li a.active {
    color: var(--accent-yellow);
    border-bottom: 2px solid var(--accent-yellow);
}
/* Biography Card Styling */
.biography-card {
    background: var(--text-light);
    border-radius: 12px;
    padding: 25px;
    margin: 15px 0;
    box-shadow: 0 4px 15px var(--shadow-light);
    border-left: 5px solid var(--primary-blue);
}

.biography-card h3 {
    font-family: 'Montserrat', sans-serif;
    color: var(--primary-blue);
    margin-bottom: 20px;
    font-size: 1.5em;
    border-bottom: 2px solid var(--accent-yellow);
    padding-bottom: 10px;
}

.bio-details {
    line-height: 1.6;
}

.bio-item {
    margin-bottom: 12px;
    padding: 10px;
    background: var(--light-blue-bg);
    border-radius: 6px;
    border-left: 3px solid var(--secondary-blue);
}

.bio-item strong {
    color: var(--primary-blue);
    font-family: 'Montserrat', sans-serif;
}

/* AI Intro Section */
.ai-intro-section {
    background-color: var(--grey-background);
    padding: 60px 0;
}

.section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5em;
    color: var(--primary-blue);
    margin-bottom: 40px;
    text-align: center;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: 100px;
    height: 4px;
    background-color: var(--accent-yellow);
    border-radius: 2px;
}

.ai-profile {
    display: flex;
    align-items: center;
    gap: 40px;
    background-color: var(--text-light);
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 8px 25px var(--shadow-light);
    max-width: 900px;
    margin: 0 auto;
}

.profile-image {
    flex-shrink: 0;
}

.profile-image img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 5px solid var(--accent-yellow);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.profile-info {
    flex: 1;
}

.profile-info h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.2em;
    color: var(--primary-blue);
    margin-bottom: 10px;
}

.profile-info .title {
    font-size: 1.3em;
    color: var(--secondary-blue);
    margin-bottom: 20px;
    font-weight: 600;
}

.profile-info .description {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 25px;
    color: var(--text-dark);
}

.ai-stats {
    display: flex;
    gap: 30px;
}

.stat {
    text-align: center;
}

.stat .number {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8em;
    font-weight: 700;
    color: var(--primary-blue);
    margin-bottom: 5px;
}

.stat .label {
    font-size: 0.9em;
    color: var(--text-dark);
    opacity: 0.8;
}

/* Chat Section */
.chat-section {
    background-color: var(--text-light);
    padding: 60px 0;
}

.chat-container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--ai-chat-bg);
    border-radius: 15px;
    box-shadow: 0 10px 30px var(--shadow-medium);
    overflow: hidden;
}

.chat-header {
    background: var(--primary-blue);
    color: var(--text-light);
    padding: 20px 30px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.chat-header .ai-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--accent-yellow);
}

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

.ai-info h3 {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    font-size: 1.3em;
}

.status {
    font-size: 0.9em;
    opacity: 0.8;
}

.chat-messages {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: var(--grey-background);
}

.message {
    display: flex;
    margin-bottom: 20px;
    gap: 12px;
}

.ai-message {
    flex-direction: row;
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
}

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

.user-message .message-avatar {
    display: none; /* Hide avatar for user messages */
}

.message-content {
    max-width: 70%;
    padding: 15px 20px;
    border-radius: 18px;
    position: relative;
}

.ai-message .message-content {
    background: var(--ai-message-bg);
    color: var(--text-dark);
    border-bottom-left-radius: 5px;
}

.user-message .message-content {
    background: var(--user-message-bg);
    color: var(--text-light);
    border-bottom-right-radius: 5px;
}

.message-content p {
    margin-bottom: 8px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 5px;
}

.message-content em {
    font-style: italic;
    opacity: 0.8;
}

/* Math Formula Styling */
.math-formula {
    background: var(--text-light);
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    text-align: center;
    border-left: 4px solid var(--accent-yellow);
}

.formula-title {
    font-weight: 600;
    color: var(--primary-blue);
    margin-bottom: 10px;
    font-family: 'Montserrat', sans-serif;
}

.formula-latex {
    font-size: 1.1em;
    margin: 10px 0;
}

.formula-desc {
    font-size: 0.9em;
    color: var(--text-dark);
    opacity: 0.8;
    margin-top: 8px;
}

/* SIMPLE INPUT - Clean and minimal */
.simple-input-container {
    border-top: 1px solid var(--border-color);
    padding: 20px;
    background: var(--text-light);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

#user-input {
    flex: 1;
    padding: 15px 20px;
    border: 1px solid var(--border-color);
    border-radius: 25px;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s ease;
}

#user-input:focus {
    border-color: var(--primary-blue);
}

.send-button {
    background: var(--accent-yellow);
    color: var(--primary-blue);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-button:hover {
    background: #E6C229;
    transform: scale(1.05);
}

/* Footer & President Corner */
footer {
    background-color: var(--secondary-blue);
    color: var(--text-light);
    padding: 25px 0;
    text-align: center;
    font-size: 0.9em;
}

.president-corner {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: rgba(10, 38, 71, 0.95);
    color: var(--text-light);
    padding: 12px 18px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    z-index: 1000;
    opacity: 0.98;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.president-corner:hover {
    opacity: 1;
    transform: translateY(-3px);
}

.president-corner img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-yellow);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
}

.president-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.president-name {
    margin: 0;
    font-size: 1.2em;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
}

.president-title {
    margin: 0;
    font-size: 0.9em;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Open Sans', sans-serif;
}

/* Typing Animation */
.typing-indicator {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: var(--primary-blue);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* Navigation Confirmation */
.navigation-confirm {
    background: var(--accent-yellow) !important;
    color: var(--primary-blue) !important;
    border: 2px solid var(--primary-blue);
}

.navigation-confirm p {
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5em;
    }
    .hero-content h2 {
        font-size: 1.5em;
    }
    
    .main-nav {
        gap: 15px;
    }
    
    .ai-profile {
        flex-direction: column;
        text-align: center;
        gap: 25px;
        padding: 30px 20px;
    }
    
    .profile-image img {
        width: 140px;
        height: 140px;
    }
    
    .ai-stats {
        justify-content: center;
    }
    
    .chat-messages {
        height: 350px;
    }
    
    .message-content {
        max-width: 85%;
    }
    
    .president-corner {
        bottom: 18px;
        right: 18px;
        padding: 10px 15px;
    }
}

@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2em;
    }
    
    .main-nav {
        gap: 8px;
    }
    
    .profile-info h3 {
        font-size: 1.8em;
    }
    
    .chat-header {
        padding: 15px 20px;
    }
    
    .chat-header .ai-avatar {
        width: 40px;
        height: 40px;
    }
    
    .message-avatar {
        width: 35px;
        height: 35px;
    }
    
    .president-corner {
        bottom: 15px;
        right: 15px;
        padding: 8px 12px;
    }
    
    .president-corner img {
        width: 45px;
        height: 45px;
    }
}

/* MathJax Customization */
.MathJax {
    font-size: 1.1em !important;
}

.mjx-chtml {
    outline: none !important;
}
/* ========== MOBILE RESPONSIVENESS ========== */
@media (max-width: 768px) {
    /* Hero Section Mobile Fix */
    .hero-content h1 {
        font-size: 2em !important;
        line-height: 1.2;
    }
    
    .hero-content h2 {
        font-size: 1.3em !important;
    }
    
    .hero-content p {
        font-size: 1em !important;
    }

    /* Navigation Mobile Fix */
    .main-nav {
        gap: 8px !important;
        padding: 0 5px !important;
    }
    
    .main-nav li a {
        font-size: 0.8em !important;
        padding: 5px 3px !important;
        white-space: nowrap;
    }

    /* AI Profile Mobile Fix */
    .ai-profile {
        flex-direction: column !important;
        text-align: center;
        gap: 25px;
        padding: 25px 15px !important;
    }
    
    .profile-image img {
        width: 120px !important;
        height: 120px !important;
    }
    
    .profile-info h3 {
        font-size: 1.6em !important;
    }
    
    .ai-stats {
        justify-content: center;
        gap: 20px;
    }

    /* Chat Container Mobile Fix */
    .chat-container {
        margin: 0 10px !important;
        border-radius: 10px !important;
    }
    
    .chat-header {
        padding: 15px 20px !important;
    }
    
    .chat-header .ai-avatar {
        width: 40px !important;
        height: 40px !important;
    }
    
    .ai-info h3 {
        font-size: 1.1em !important;
    }
    
    .status {
        font-size: 0.8em !important;
    }

    /* Chat Messages Mobile Fix */
    .chat-messages {
        height: 300px !important;
        padding: 15px !important;
    }
    
    .message-avatar {
        width: 35px !important;
        height: 35px !important;
    }
    
    .message-content {
        max-width: 85% !important;
        padding: 12px 15px !important;
        font-size: 0.9em;
    }

    /* Input Section Mobile Fix */
    .simple-input-container {
        padding: 15px !important;
    }
    
    .input-wrapper {
        gap: 8px;
    }
    
    #user-input {
        padding: 12px 15px;
        font-size: 0.9em;
    }
    
    .send-button {
        width: 45px !important;
        height: 45px !important;
    }

    /* Biography Cards Mobile Fix */
    .biography-card {
        padding: 20px 15px !important;
        margin: 10px 0 !important;
    }
    
    .biography-card h3 {
        font-size: 1.3em !important;
    }
    
    .bio-item {
        padding: 8px !important;
        font-size: 0.9em;
    }

    /* Math Formulas Mobile Fix */
    .math-formula {
        padding: 15px !important;
        margin: 10px 0 !important;
    }
    
    .formula-title {
        font-size: 1.1em !important;
    }

    /* Solution Container Mobile Fix */
    .solution-container {
        padding: 20px 15px !important;
    }
    
    .solution-container h4 {
        font-size: 1.1em !important;
    }
    
    .solution-step {
        padding: 10px !important;
        font-size: 0.85em;
    }
}

@media (max-width: 480px) {
    /* Extra Small Phones */
    .hero-content h1 {
        font-size: 1.8em !important;
    }
    
    .hero-content h2 {
        font-size: 1.1em !important;
    }
    
    .main-nav {
        gap: 5px !important;
    }
    
    .main-nav li a {
        font-size: 0.75em !important;
        padding: 4px 2px !important;
    }
    
    .chat-messages {
        height: 250px !important;
    }
    
    .message-content {
        max-width: 90% !important;
    }
    
    .profile-image img {
        width: 100px !important;
        height: 100px !important;
    }
    
    .president-corner {
        bottom: 10px !important;
        right: 10px !important;
        padding: 8px 12px !important;
    }
    
    .president-corner img {
        width: 40px !important;
        height: 40px !important;
    }
}

/* Fix for MathJax on Mobile */
@media (max-width: 768px) {
    .MathJax {
        font-size: 0.9em !important;
    }
    
    .formula-latex {
        overflow-x: auto;
        padding: 5px 0;
    }
}

/* Prevent horizontal scrolling */
body {
    overflow-x: hidden;
}

.container {
    max-width: 100%;
    padding: 15px;
}

/* Touch-friendly buttons */
@media (max-width: 768px) {
    .send-button, 
    .btn-primary, 
    .btn-secondary {
        min-height: 44px; /* Minimum touch target size */
        min-width: 44px;
    }
    
    .suggestion-chip {
        padding: 10px 14px;
        font-size: 0.85em;
    }
}