:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --bg-main: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.8);
    --text-dark: #1e293b;
    --text-light: #64748b;
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

body {
    background: linear-gradient(135deg, #e0e7ff 0%, #f1f5f9 100%);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

@media (max-width: 768px) {
    body {
        align-items: flex-start;
        padding: 10px;
        overflow-y: auto;
    }
}


.app-container {
    width: 95vw;
    height: 90vh;
    max-width: 1200px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 768px) {
    .app-container {
        width: 100%;
        height: auto;
        min-height: calc(100vh - 20px);
        border-radius: 16px;
    }
}


header {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
}

@media (max-width: 768px) {
    header {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}


.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-nav {
    display: flex;
    gap: 15px;
}

.nav-link {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.4);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: var(--primary);
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-icon {
    font-size: 24px;
    background: #4f46e5;
    padding: 8px;
    border-radius: 12px;
    color: white;
}

.logo h1 {
    font-size: 1.5rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-badge {
    background: linear-gradient(90deg, #4f46e5, #818cf8);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    text-transform: uppercase;
    font-weight: bold;
}

@media (max-width: 480px) {
    .logo h1 {
        font-size: 1.2rem;
    }

    .header-actions {
        width: 100%;
        flex-direction: column;
        gap: 12px;
    }

    .site-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .upload-btn {
        width: 100%;
        text-align: center;
    }
}


/* Hero Section */
.hero-section {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 20px;
}

.hero-section h1 {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.hero-section p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 40px;
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 1.6rem;
    }

    .steps-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}


.step-card {
    background: rgba(255, 255, 255, 0.4);
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--glass-border);
    transition: transform 0.3s ease;
}

.step-card:hover {
    transform: translateY(-5px);
}

.step-num {
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 15px;
    font-weight: bold;
}

.step-card h3 {
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.step-card p {
    font-size: 0.9rem;
    color: var(--text-light);
}

.upload-btn {
    background: var(--primary);
    color: white;
    padding: 10px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
}

.upload-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow: hidden;
}

.upload-zone {
    flex: 1;
    border: 3px dashed #cbd5e1;
    border-radius: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.5);
}

.upload-zone:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.upload-content {
    text-align: center;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.chat-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow: hidden;
}

@media (max-width: 768px) {
    main {
        padding: 10px;
        height: auto;
        overflow: visible;
    }

    .upload-zone {
        min-height: 250px;
    }

    .chat-section {
        height: 60vh;
    }

    .file-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}


.file-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px 20px;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.change-file {
    background: #f1f5f9;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-light);
    font-size: 0.9rem;
}

.chat-window {
    flex: 1;
    background: white;
    border-radius: 16px;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 16px;
    line-height: 1.6;
    white-space: pre-line;
}

.message.assistant {
    background: #f1f5f9;
    align-self: flex-start;
    border-bottom-right-radius: 4px;
}

.message.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-left-radius: 4px;
}

.input-area {
    display: flex;
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: 16px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

textarea {
    flex: 1;
    border: none;
    resize: none;
    padding: 10px;
    font-size: 1rem;
    outline: none;
}

#send-btn {
    background: var(--primary);
    color: white;
    border: none;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s;
}

#send-btn:hover {
    background: var(--primary-hover);
}

.hidden {
    display: none !important;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid #e2e8f0;
    border-bottom-color: var(--primary);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Footer Styles */
footer {
    padding: 20px 40px;
    border-top: 1px solid #e2e8f0;
    margin-top: auto;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    border-radius: 20px 20px 0 0;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 768px) {
    footer {
        padding: 15px;
    }

    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}


.footer-info p {
    color: var(--text-light);
    font-weight: 500;
}

.social-links {
    display: flex;
    gap: 15px;
}

.social-icon {
    color: var(--text-light);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.social-icon:hover {
    transform: scale(1.1);
}

.social-icon.fb:hover {
    color: #1877f2;
}

.social-icon.yt:hover {
    color: #ff0000;
}