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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #ec4899;
    --bg-color: #0f172a;
    --bg-light: #1e293b;
    --text-color: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
}

html {
    height: 100%;
    background: linear-gradient(135deg, var(--bg-color) 0%, #1a1f3a 100%);
    background-repeat: no-repeat;
    background-size: cover;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-color) 0%, #1a1f3a 100%);
    background-repeat: no-repeat;
    background-size: cover;
    color: var(--text-color);
    min-height: 100vh;
    min-height: 100%;
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-color) 0%, #1a1f3a 100%);
    z-index: -1;
    pointer-events: none;
}

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

.header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.back-link {
    display: inline-block;
    color: var(--text-muted);
    text-decoration: none;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: var(--primary-color);
}

.title {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
}

.main-content {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.demo-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.demo-card {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: block;
}

.demo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.1), transparent);
    transition: left 0.5s ease;
}

.demo-card:hover::before {
    left: 100%;
}

.demo-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.card-xss:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 10px 30px rgba(236, 72, 153, 0.3);
}

.card-sql:hover {
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: inline-block;
    animation: bounce 2s infinite;
}

.demo-card h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.demo-card > p {
    color: var(--text-muted);
    margin-bottom: 1rem;
    font-weight: 500;
}

.card-description {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.card-arrow {
    position: absolute;
    bottom: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    transition: transform 0.3s ease;
}

.demo-card:hover .card-arrow {
    transform: translateX(5px);
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 2px solid var(--warning-color);
    border-radius: 0.5rem;
    padding: 1.5rem;
    color: var(--text-color);
    animation: fadeIn 0.6s ease-out 0.4s both;
}

.demo-info {
    background: var(--bg-light);
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 2px solid var(--border-color);
}

.demo-info h2 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.demo-info p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.example-box {
    background: rgba(99, 102, 241, 0.1);
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    border-radius: 0.5rem;
    margin-top: 1rem;
}

.example-box code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    display: inline-block;
    margin-top: 0.5rem;
}

.chat-container {
    background: var(--bg-light);
    border-radius: 1rem;
    padding: 2rem;
    border: 2px solid var(--border-color);
}

.chat-messages {
    max-height: 500px;
    overflow-y: auto;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
}

.message {
    background: var(--bg-color);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
    animation: slideIn 0.3s ease-out;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.message-username {
    font-weight: 600;
    color: var(--primary-color);
}

.message-time {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.message-content {
    color: var(--text-color);
    word-wrap: break-word;
}

.chat-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.input-field {
    background: var(--bg-color);
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
    width: 100%;
}

.input-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

.textarea-field {
    min-height: 100px;
    resize: vertical;
}

.btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.login-container {
    max-width: 400px;
    margin: 0 auto;
}

.login-form {
    background: var(--bg-light);
    border-radius: 1rem;
    padding: 2rem;
    border: 2px solid var(--border-color);
    width: 100%;
}

.login-form h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.login-result {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 0.5rem;
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.login-result.show {
    display: block;
}

.login-result.success {
    background: rgba(16, 185, 129, 0.1);
    border: 2px solid var(--success-color);
    color: var(--success-color);
}

.login-result.error {
    background: rgba(239, 68, 68, 0.1);
    border: 2px solid var(--error-color);
    color: var(--error-color);
}

.login-result .user-info {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

/* Responsive Design */
@media (max-width: 768px) {
    .title {
        font-size: 2rem;
    }
    
    .demo-cards {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 1rem;
    }
}
