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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #FFD700 0%, #FDB813 50%, #FF6B35 100%);
    min-height: 100vh;
    padding: 20px;
}

body[lang="ar"] {
    direction: rtl;
    text-align: right;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #FFD700 0%, #FDB813 50%, #FF6B35 100%);
    color: #2c3e50;
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
}

.language-switcher {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 10;
}

body[lang="ar"] .language-switcher {
    right: auto;
    left: 1rem;
}

.lang-btn {
    padding: 0.5rem 1rem;
    border: 2px solid rgba(44, 62, 80, 0.2);
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s;
    color: #2c3e50;
}

.lang-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    border-color: #2c3e50;
}

.lang-btn.active {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
}

.header h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    margin-top: 1rem;
}

.subtitle {
    opacity: 0.95;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.header-description {
    opacity: 0.9;
    font-size: 1rem;
    font-style: italic;
    margin-top: 0.5rem;
}

.main-content {
    padding: 2rem;
}

.chat-container {
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
    border: 2px solid #ffe4b3;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    background: #fffbf0;
    scroll-behavior: smooth;
}

.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: #fffbf0;
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #FFD700;
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: #FDB813;
}

.welcome-message {
    text-align: center;
    padding: 2rem;
    color: #2c3e50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.welcome-message h2 {
    color: #FF6B35;
    margin-bottom: 1rem;
    font-weight: 700;
}

.welcome-message p {
    margin-bottom: 1rem;
    color: #555;
}

.topics-list {
    list-style: none;
    margin: 1.5rem 0;
    text-align: left;
    display: inline-block;
}

.topics-list li {
    padding: 0.5rem 0;
    color: #2c3e50;
    font-weight: 600;
}

.topics-list li:before {
    content: "☀️ ";
    margin-right: 0.5rem;
}

body[lang="ar"] .topics-list li:before {
    margin-right: 0;
    margin-left: 0.5rem;
}

.job-sources-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(255, 107, 53, 0.1) 100%);
    border-radius: 12px;
    border: 2px solid #FFD700;
}

.job-sources-info h3 {
    color: #FF6B35;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.source-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.source-badge {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #FDB813;
    border-radius: 20px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.9rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.source-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.message {
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 18px;
    max-width: 85%;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.user-message {
    background: linear-gradient(135deg, #FFD700 0%, #FDB813 100%);
    color: #2c3e50;
    margin-left: auto;
    text-align: right;
    font-weight: 600;
}

body[lang="ar"] .user-message {
    margin-left: 0;
    margin-right: auto;
    text-align: left;
}

.bot-message {
    background: white;
    color: #333;
    border: 2px solid #ffe4b3;
    line-height: 1.6;
}

.bot-message a {
    color: #0066cc;
    text-decoration: none;
    font-weight: 600;
    border-bottom: 1px solid #0066cc;
    transition: all 0.2s ease;
}

.bot-message a:hover {
    color: #004499;
    border-bottom: 2px solid #004499;
    background-color: #fff3d4;
    padding: 2px 4px;
    border-radius: 4px;
}

.bot-message p {
    margin: 0.8rem 0;
}

.bot-message p:first-child {
    margin-top: 0;
}

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

.bot-message .list-item {
    margin: 0.5rem 0;
    padding-left: 1rem;
}

body[lang="ar"] .bot-message .list-item {
    padding-left: 0;
    padding-right: 1rem;
}

.bot-message .section-header {
    font-weight: 700;
    color: #FF6B35;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.bot-message .section-header:first-child {
    margin-top: 0;
}

.bot-message strong {
    color: #FF6B35;
    font-weight: 700;
}

.sources-message {
    background: #fff9e6;
    color: #555;
    border: 1px solid #FFD700;
    font-size: 0.9rem;
}

.sources-message a {
    color: #FF6B35;
    text-decoration: none;
    font-weight: 600;
}

.sources-message a:hover {
    text-decoration: underline;
}

.error-message {
    background: #ffe4e1;
    color: #dc2626;
    border: 2px solid #ff6b6b;
}

.loading {
    opacity: 0.6;
    font-style: italic;
}

.input-container {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

#questionInput {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #FDB813;
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    font-family: 'Poppins', sans-serif;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#questionInput:focus {
    border-color: #FF6B35;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

#sendBtn {
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #FFD700 0%, #FF6B35 100%);
    color: #2c3e50;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

#sendBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
}

#sendBtn:active {
    transform: translateY(0);
}

#sendBtn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
}

.examples {
    text-align: center;
    margin-bottom: 1.5rem;
}

.examples p {
    margin-bottom: 1rem;
    color: #666;
    font-weight: 600;
}

.example-btn {
    margin: 0.5rem;
    padding: 1rem 2rem;
    background: white;
    border: 2px solid #ffe4b3;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: #2c3e50;
}

.example-btn:hover {
    background: linear-gradient(135deg, #FFD700 0%, #FDB813 100%);
    color: #2c3e50;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(253, 184, 19, 0.4);
}

.footer {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: #ecf0f1;
    padding: 2rem;
    text-align: center;
    font-size: 0.9rem;
}

.author-section {
    margin-bottom: 1rem;
}

.author-section p {
    margin: 0;
    line-height: 1.6;
}

.author-section a {
    color: #FFD700;
    text-decoration: none;
    font-weight: 600;
}

.author-section a:hover {
    color: #FDB813;
    text-decoration: underline;
}

.powered-by {
    color: #bdc3c7;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #ffe4b3;
    border-top: 4px solid #FF6B35;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-overlay p {
    color: #2c3e50;
    font-weight: 600;
    font-size: 1.1rem;
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        border-radius: 16px;
    }

    .header {
        padding: 1.5rem 1rem;
        padding-top: 3.5rem;
    }

    .language-switcher {
        top: 0.5rem;
        right: 0.5rem;
        flex-direction: column;
        gap: 0.3rem;
    }

    body[lang="ar"] .language-switcher {
        left: 0.5rem;
        right: auto;
    }

    .lang-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .header-description {
        font-size: 0.9rem;
    }

    .main-content {
        padding: 1.5rem 1rem;
    }

    .chat-container {
        padding: 1rem;
        min-height: 300px;
        max-height: 400px;
    }

    .welcome-message {
        padding: 1rem;
    }

    .welcome-message h2 {
        font-size: 1.3rem;
    }

    .job-sources-info {
        padding: 1rem;
    }

    .source-badges {
        gap: 0.5rem;
    }

    .source-badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    .message {
        max-width: 90%;
        padding: 0.8rem 1rem;
        font-size: 0.95rem;
    }

    .input-container {
        flex-direction: column;
        gap: 0.8rem;
    }

    #questionInput {
        width: 100%;
        padding: 0.9rem 1.2rem;
        font-size: 0.95rem;
    }

    #sendBtn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }

    .examples {
        margin-bottom: 1rem;
    }

    .example-btn {
        margin: 0.4rem;
        padding: 0.8rem 1.3rem;
        font-size: 0.9rem;
    }

    .footer {
        padding: 1.5rem 1rem;
    }

    .author-section p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .powered-by {
        font-size: 0.8rem;
    }

    .loading-overlay p {
        font-size: 0.9rem;
        padding: 0 1rem;
    }
}

@media print {
    body {
        background: white;
    }

    .language-switcher,
    .input-container,
    .examples,
    .footer {
        display: none;
    }

    .container {
        box-shadow: none;
    }

    .message {
        page-break-inside: avoid;
    }
}

/* Job Card Styles */
.job-card {
    background: linear-gradient(135deg, #fff8f0 0%, #fffbf5 100%);
    border: 2px solid #ffe4b3;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.1);
    transition: all 0.3s ease;
}

.job-card:hover {
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
    transform: translateY(-2px);
}

.job-header {
    margin-bottom: 1rem;
    border-bottom: 2px solid #FFD700;
    padding-bottom: 0.75rem;
}

.job-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #FF6B35;
    margin-bottom: 0.5rem;
}

.job-employer {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.3rem;
}

.job-location {
    font-size: 0.95rem;
    color: #555;
    margin-top: 0.3rem;
}

.job-contact {
    background: white;
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0.75rem 0;
    border-left: 4px solid #FFD700;
}

.contact-section {
    margin-bottom: 0.75rem;
}

.contact-section:last-child {
    margin-bottom: 0;
}

.contact-label {
    font-weight: 700;
    color: #FF6B35;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.contact-person {
    background: #f9f9f9;
    padding: 0.5rem;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.person-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.2rem;
}

.person-contact {
    color: #555;
    font-size: 0.85rem;
    line-height: 1.4;
}

.contact-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.contact-link {
    display: inline-block;
    background: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    border: 1px solid #ffe4b3;
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.contact-link:hover {
    background: #fff3d4;
    border-color: #FFD700;
    color: #004499;
}

.contact-phone {
    display: inline-block;
    background: #fff;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    border: 1px solid #ffe4b3;
    font-size: 0.9rem;
    color: #2c3e50;
}

.job-deadline {
    background: #fff3d4;
    border-left: 4px solid #FFD700;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    margin: 0.75rem 0;
    font-weight: 500;
    color: #2c3e50;
}

.job-footer {
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
}

.apply-button {
    display: inline-block;
    background: linear-gradient(135deg, #FF6B35 0%, #FDB813 100%);
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 53, 0.3);
}

.apply-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.4);
    text-decoration: none;
}

.apply-button:active {
    transform: translateY(0);
}

.follow-up-prompt {
    background: linear-gradient(135deg, #fff9e6 0%, #fff3d4 100%);
    border: 2px solid #FFD700;
    border-radius: 12px;
    padding: 1rem;
    margin-top: 1.5rem;
    color: #2c3e50;
    text-align: center;
}

.follow-up-prompt a {
    color: #FF6B35;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s ease;
}