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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* Hero section */
.hero {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 4rem 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.hero h1 {
    font-size: 3rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-description {
    font-size: 1.2rem;
    color: #4a5568;
    margin-bottom: 2.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    min-width: 140px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
    border: 2px solid #cbd5e0;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 450px;
    position: relative;
}

.close {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #a0aec0;
    transition: color 0.3s ease;
}

.close:hover {
    color: #4a5568;
}

.modal h2 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    text-align: center;
}

.modal p {
    color: #4a5568;
    margin-bottom: 1.5rem;
    text-align: center;
}

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

.modal input {
    padding: 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.modal input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Chat page styles */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.1);
}

.chat-header {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.home-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    min-width: auto;
}

.home-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: translateY(-1px);
}

.chat-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    background: #f8fafc;
}

.message {
    background: white;
    margin-bottom: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-left: 4px solid #667eea;
    max-width: 70%;
}

.message.own {
    margin-left: auto;
    margin-right: 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-left: none;
    border-right: 4px solid #4c51bf;
}

.message.own .username {
    color: #e2e8f0;
}

.message.own .timestamp {
    color: #cbd5e0;
}

.message.system {
    background: #f7fafc;
    border-left: 4px solid #4299e1;
    margin: 0.5rem auto;
    max-width: 80%;
    text-align: center;
    font-style: italic;
    color: #4a5568;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.username {
    font-weight: 600;
    color: #667eea;
    font-size: 0.9rem;
}

.timestamp {
    color: #a0aec0;
    font-size: 0.8rem;
}

.message-content {
    color: #2d3748;
    word-wrap: break-word;
}

.message-input {
    display: flex;
    padding: 1.5rem;
    gap: 1rem;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.message-input input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 25px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.message-input input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .hero {
        padding: 2rem 1.5rem;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero-description {
        font-size: 1rem;
    }
    
    .chat-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .header-left {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .message {
        max-width: 85%;
    }
    
    .message-input {
        padding: 1rem;
    }
    
    .modal-content {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success/Error messages */
.alert {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-success {
    background-color: #f0fff4;
    color: #38a169;
    border: 1px solid #9ae6b4;
}

.alert-error {
    background-color: #fed7d7;
    color: #e53e3e;
    border: 1px solid #feb2b2;
}
