* {
    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%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

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

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #333;
}

nav a {
    margin-left: 15px;
    text-decoration: none;
    color: #667eea;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover {
    color: #764ba2;
}

.hero {
    text-align: center;
    padding: 60px 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: #333;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: #666;
}

.auth-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

.auth-form {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.auth-form h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #333;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #667eea;
    outline: none;
}

.error-box {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.success-box {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

.admin-login-link {
    text-align: center;
    margin-top: 20px;
}

.admin-login-link a {
    color: #667eea;
    text-decoration: none;
}

.admin-login-link a:hover {
    text-decoration: underline;
}

/* Chat Styles */
.chat-container {
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    height: 90vh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    background: #667eea;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logout-btn {
    color: white;
    text-decoration: none;
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 70%;
    padding: 12px 15px;
    border-radius: 18px;
    position: relative;
    word-wrap: break-word;
}

.message.sent {
    align-self: flex-end;
    background: #667eea;
    color: white;
    border-bottom-right-radius: 5px;
}

.message.received {
    align-self: flex-start;
    background: #f1f1f1;
    color: #333;
    border-bottom-left-radius: 5px;
}

.message-info {
    font-size: 0.8rem;
    margin-top: 5px;
    opacity: 0.8;
}

.media-container {
    margin-top: 10px;
}

.media-container img {
    max-width: 100%;
    border-radius: 10px;
}

.media-container video {
    max-width: 100%;
    border-radius: 10px;
    cursor: pointer;
}

.chat-input {
    padding: 15px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
}

.input-group {
    display: flex;
    gap: 10px;
}

.input-group input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 25px;
    font-size: 1rem;
}

.file-options {
    display: flex;
    gap: 5px;
    align-items: center;
}

.file-btn {
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    background: #f1f1f1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.file-btn:hover {
    background: #e1e1e1;
}

.send-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 25px;
    background: #667eea;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.send-btn:hover {
    background: #5a6fd8;
}

#previewArea {
    margin-top: 10px;
    padding: 10px;
    background: #f1f1f1;
    border-radius: 5px;
}

#mediaPreview img, #mediaPreview video {
    max-width: 200px;
    max-height: 200px;
    border-radius: 5px;
}

#cancelUpload {
    margin-top: 10px;
    padding: 5px 10px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

/* Admin Styles */
.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    padding: 15px 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.admin-nav a {
    margin-left: 15px;
    text-decoration: none;
    color: #667eea;
    font-weight: 500;
    transition: color 0.3s;
}

.admin-nav a:hover {
    color: #764ba2;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.stat-card h3 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #667eea;
}

.stat-card p {
    color: #666;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.admin-table th, .admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.admin-table th {
    background: #f7f7f7;
    font-weight: 600;
}

.admin-table tr:hover {
    background: #f9f9f9;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    nav {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .auth-buttons {
        flex-direction: column;
    }
    
    .chat-container {
        height: 100vh;
        border-radius: 0;
    }
    
    .message {
        max-width: 85%;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}