:root {
    --bg-gradient-1: #0f172a;
    --bg-gradient-2: #1e1b4b;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-1), var(--bg-gradient-2));
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Background Animated Blobs */
body::before, body::after {
    content: '';
    position: fixed;
    width: 300px;
    height: 300px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.6;
}

body::before {
    background: #6366f1;
    top: -100px;
    left: -100px;
}

body::after {
    background: #c026d3;
    bottom: -100px;
    right: -100px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.center-full {
    align-items: center;
}

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

.logo {
    width: 60px;
    margin-bottom: 1rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #a5b4fc, #fbcfe8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.card {
    padding: 2.5rem;
    animation: fadeInUp 1s ease;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

textarea, input[type="text"], input[type="password"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.2rem;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    resize: none;
    transition: all 0.3s ease;
}

textarea:focus, input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

button {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1.2rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

button:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--primary-color);
    margin-top: 1rem;
}

.secondary-btn:hover {
    background: rgba(99, 102, 241, 0.1);
}

.hidden {
    display: none;
}

#replyContainer {
    margin-top: 2rem;
    text-align: center;
}

#replyContainer h3 {
    margin-bottom: 1rem;
    color: #a5b4fc;
}

#aiReply {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 2rem;
}

footer {
    text-align: center;
    padding: 2rem;
}

.login-link, .back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

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

/* Login Page */
.login-card {
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-card h2 {
    margin-bottom: 2rem;
}

.login-card form {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.alert-success {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Admin Dashboard */
.admin-container {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
}

.logout-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.4);
}

.messages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.message-card {
    padding: 1.5rem;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 0.5rem;
}

.message-card .timestamp {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.delete-btn {
    background: transparent;
    border: none;
    padding: 0.3rem;
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.delete-btn:hover {
    transform: scale(1.2) translateY(0);
    background: transparent;
}

.message-card .content {
    line-height: 1.6;
    word-wrap: break-word;
}

@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); }
}
