:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --secondary: #a855f7;
    --bg-dark: #030712;
    --text-main: #f9fafb;
    --text-dim: #9ca3af;
    --glass: rgba(17, 24, 39, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-dark);
    color: var(--text-main);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Glow Background Effect */
.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.15) 0%, transparent 40%);
    filter: blur(80px);
}

/* Navigation */
.glass-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 10%;
    background: var(--glass);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.logo .icon {
    font-size: 1.5rem;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

/* Buttons */
button {
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    box-shadow: 0 4px 15px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-text {
    background: transparent;
    color: var(--text-dim);
    font-weight: 500;
}

.btn-text:hover {
    color: var(--text-main);
}

.btn-huge {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: 12px;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
}

.btn-outline:hover {
    background: var(--glass-border);
}

/* Hero Section */
#landing {
    padding-top: 15vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 4rem;
}

.hero-title {
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    line-height: 1.1;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, #a855f7 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
}

.hero-subtitle {
    color: var(--text-dim);
    max-width: 600px;
    font-size: 1.2rem;
    margin-bottom: 2.5rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Glass Card */
.glass-card {
    background: var(--glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.preview-card {
    width: 600px;
    height: 350px;
    position: relative;
    transform: perspective(1000px) rotateX(10deg);
}

.card-header {
    display: flex;
    gap: 8px;
    margin-bottom: 2rem;
}

.dot-red,
.dot-yellow,
.dot-green {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red {
    background: #ff5f56;
}

.dot-yellow {
    background: #ffbd2e;
}

.dot-green {
    background: #27c93f;
}

.skeleton-line {
    background: var(--glass-border);
    height: 12px;
    border-radius: 6px;
    margin-bottom: 1rem;
}

.skeleton-line.full {
    width: 100%;
}

.skeleton-line.half {
    width: 50%;
}

.skeleton-line.three-quarters {
    width: 75%;
}

/* Auth Section */
#auth {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.auth-card {
    width: 100%;
    max-width: 450px;
    text-align: left;
}

.auth-card h2 {
    margin-bottom: 2rem;
    font-size: 2rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

.full-width {
    width: 100%;
}

.auth-footer {
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-dim);
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Helpers */
.hidden {
    display: none !important;
}

.active {
    display: block;
}

/* Dashboard Layout */
#dashboard {
    padding-top: 80px;
    min-height: 100vh;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    padding: 2rem 5%;
    max-width: 1600px;
    margin: 0 auto;
}

/* Sidebar */
.sidebar {
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 100px;
}

.btn-compose {
    margin-bottom: 2rem;
    font-size: 1rem;
}

.mail-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.nav-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: var(--text-dim);
    text-decoration: none;
    transition: var(--transition);
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.nav-item.active {
    background: var(--primary);
    color: white;
}

.badge {
    background: var(--secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
}

.sidebar-footer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.sidebar-footer .btn-text {
    text-align: left;
    padding: 0.5rem;
    font-size: 0.9rem;
}

/* Mail Content */
.mail-content {
    min-height: 70vh;
}

.mail-list {
    padding: 2rem;
}

.mail-list h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.mail-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mail-item {
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    cursor: pointer;
    transition: var(--transition);
}

.mail-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(5px);
}

.mail-item.unread {
    border-left: 3px solid var(--primary);
    font-weight: 600;
}

.mail-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.mail-sender {
    font-weight: 600;
    color: var(--text-main);
}

.mail-date {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.mail-subject {
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.mail-preview {
    color: var(--text-dim);
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Mail Viewer */
.mail-viewer {
    padding: 2rem;
}

.mail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.mail-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-back,
.btn-delete,
.btn-spam {
    background: transparent;
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn-back:hover,
.btn-delete:hover {
    background: rgba(255, 255, 255, 0.05);
}

.btn-spam {
    border-color: #ef4444;
    color: #ef4444;
}

.btn-spam:hover {
    background: rgba(239, 68, 68, 0.1);
}

.mail-details h2 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.mail-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-dim);
}

.mail-body {
    line-height: 1.8;
    color: var(--text-main);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.5rem;
}

.btn-close {
    background: transparent;
    color: var(--text-dim);
    font-size: 1.5rem;
    cursor: pointer;
    border: none;
    padding: 0.5rem;
    transition: var(--transition);
}

.btn-close:hover {
    color: var(--text-main);
}

textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
    transition: var(--transition);
}

textarea:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

footer {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-dim);
    font-size: 0.9rem;
}

/* Profile Button */
.btn-profile {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    padding: 0.5rem 1rem;
    border-radius: 12px;
    color: var(--text-main);
    font-weight: 500;
    transition: var(--transition);
}

.btn-profile:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary);
}

.profile-icon {
    font-size: 1.2rem;
}

.hidden-auth {
    display: inline-block;
}

.auth-only {
    display: none;
}

.auth-only:not(.hidden) {
    display: inline-flex;
}

.hidden-auth.hidden {
    display: none;
}

/* Profile Modal */
.profile-section {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.profile-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.profile-email {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.profile-username {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--text-dim);
    font-size: 0.85rem;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.info-label {
    color: var(--text-dim);
    font-size: 0.9rem;
}

.info-value {
    color: var(--text-main);
    font-weight: 500;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--glass-border);
}

.profile-actions .btn-primary {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
}

.logo-preview {
    text-align: center;
    margin: 1rem 0;
}

.logo-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
}

.session-item {
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    transition: var(--transition);
}

.session-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 0.9rem;
    cursor: pointer;
}

input[type="file"]:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.1);
}

input[type="file"]::-webkit-file-upload-button {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    margin-right: 1rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: relative;
        top: 0;
    }

    .preview-card {
        width: 90%;
        height: 250px;
    }

    .hero-actions {
        flex-direction: column;
    }
}