/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

/* Container and layout */
.container {
    max-width: 1500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* padding: 20px; */
}

.header {
    text-align: center;
    padding: 30px 0;
    color: white;
    position: relative;
}

.header-nav {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 2;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.home-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.home-btn svg {
    width: 18px;
    height: 18px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.warning-badge {
    display: inline-block;
    background: rgba(255, 193, 7, 0.9);
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Main content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    height: 900px;
    overflow: hidden;
    
}
.chat-window {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fafafa;
    height: 100%;
}

/* Chat messages */
.welcome-message,
.chat-message {
    margin-bottom: 20px;
}

.user-message,
.ai-message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.user-message {
    justify-content: flex-end;
}

.user-message .message-content {
    background: #667eea;
    color: white;
    margin-left: 60px;
}

.ai-message .message-content {
    background: white;
    border: 1px solid #e0e0e0;
    margin-right: 60px;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user-avatar {
    background: #667eea;
    color: white;
    order: 2;
}

.ai-avatar {
    background: #f0f0f0;
    border: 2px solid #e0e0e0;
}

.message-content {
    padding: 15px 20px;
    border-radius: 18px;
    max-width: 100%;
    word-wrap: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.message-content strong {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    opacity: 0.8;
}

.vulnerability-note {
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.error-message {
    background: rgba(220, 53, 69, 0.1);
    border-left: 3px solid #dc3545;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    color: #dc3545;
}

.warning-message {
    background: rgba(255, 193, 7, 0.1);
    border-left: 3px solid #ffc107;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    color: rgb(236, 14, 14);
    font-weight: 500;
    font-size: 0.9rem;
}

.warning-message::selection {
    background: #ffc107;
    color: black;
}

.warning-message::-moz-selection {
    background: #ffc107;
    color: black;
}

/* Input area */
.input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.upload-section {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.file-input-wrapper {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.file-input {
    position: absolute;
    left: -9999px;
    opacity: 0;
}

.file-label {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: #f8f9fa;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #666;
}

.file-label:hover {
    background: #e9ecef;
    border-color: #667eea;
    color: #667eea;
}

.file-icon {
    font-size: 1.2rem;
}

.summarize-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 30px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.summarize-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.summarize-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.selected-file {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 20px;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #667eea;
}

.file-name {
    font-weight: 500;
}

.clear-file {
    background: none;
    border: none;
    color: #667eea;
    cursor: pointer;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.clear-file:hover {
    background: rgba(102, 126, 234, 0.2);
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-spinner {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.loading-spinner p {
    color: #666;
    font-weight: 500;
}

/* Footer */
.footer {
    text-align: center;
    /* padding: 20px 0; */
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
}

.footer a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

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

    .chat-container {
        height: 600px;
    }

    .upload-section {
        flex-direction: column;
        align-items: stretch;
    }

    .file-label,
    .summarize-btn {
        justify-content: center;
        width: 100%;
    }

    .user-message .message-content {
        margin-left: 20px;
    }

    .ai-message .message-content {
        margin-right: 20px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .chat-container {
        height: 550px;
    }

    .chat-window {
        padding: 15px;
    }

    .message-content {
        padding: 12px 16px;
    }
}
