:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-color: #10b981;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --input-bg: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #475569;
}

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

body {
    font-family: 'Inter', 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: var(--card-bg) !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    padding: 1rem 0;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-brand i {
    -webkit-text-fill-color: #667eea;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    margin: 0 0.5rem;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 0.5rem 1rem !important;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary) !important;
    background: rgba(102, 126, 234, 0.1);
}

.dropdown-menu {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.dropdown-item {
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-primary);
}

/* Main Container */
.main-container {
    padding: 3rem 1rem;
    min-height: calc(100vh - 76px);
}

/* Compose Card */
.compose-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
    animation: fadeInUp 0.5s ease;
}

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

.compose-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
}

.compose-header h2 {
    font-size: 2rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

/* Form Sections */
.form-section {
    background: rgba(255,255,255,0.03);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.form-section:hover {
    border-color: #667eea;
    box-shadow: 0 0 20px rgba(102, 126, 234, 0.1);
}

.section-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    color: #667eea;
    font-size: 1.3rem;
}

/* Form Controls */
.form-label {
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-control,
.form-select {
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus,
.form-select:focus {
    background: var(--input-bg);
    border-color: #667eea;
    color: var(--text-primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: #64748b;
}

textarea.message-textarea {
    min-height: 200px;
    font-family: inherit;
    resize: vertical;
}

/* Attachment Area */
.attachment-area {
    background: rgba(102, 126, 234, 0.05);
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;​​​​​​​​​​​​​​​​
    transition: all 0.3s ease;
}

.attachment-area:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

#attachmentPreview {
    display: none;
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    border: 1px solid #10b981;
}

#attachmentPreview i {
    color: #10b981;
    margin-right: 0.5rem;
}

/* Send Button */
.btn-send {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

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

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

/* Auth Pages */
.auth-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    position: relative;
    overflow: hidden;
}

.auth-body::before {
    content: '';
    position: absolute;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(102, 126, 234, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    top: -250px;
    right: -250px;
}

.auth-body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(118, 75, 162, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    bottom: -200px;
    left: -200px;
}

.auth-container {
    width: 100%;
    max-width: 450px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    animation: fadeInUp 0.6s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-icon {
    font-size: 4rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.auth-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

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

.btn-auth {
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

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

/* Modal Customization */
.modal-content {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-primary);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
}

.modal-footer {
    border-top: 1px solid var(--border-color);
}

.btn-close {
    filter: invert(1);
}

/* Admin Dashboard Styles */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Tables */
.table-container {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    overflow-x: auto;
    border: 1px solid var(--border-color);
}

.table {
    color: var(--text-primary);
    margin-bottom: 0;
}

.table thead th {
    border-bottom: 2px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 1rem;
}

.table tbody td {
    border-bottom: 1px solid var(--border-color);
    padding: 1rem;
    vertical-align: middle;
}

.table tbody tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* Badges */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8rem;
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Buttons */
.btn {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: var(--primary-gradient);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-success {
    background: #10b981;
    border: none;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: #ef4444;
    border: none;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1rem 1.25rem;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border-left: 4px solid #10b981;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-left: 4px solid #ef4444;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border-left: 4px solid #f59e0b;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border-left: 4px solid #3b82f6;
}

/* Subscription Card */
.subscription-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.subscription-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    margin-bottom: 1rem;
}

.subscription-status.active {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.subscription-status.expired {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* Responsive Design */
@media (max-width: 768px) {
    .compose-card {
        padding: 1.5rem;
    }
    
    .form-section {
        padding: 1.5rem;
    }
    
    .compose-header h2 {
        font-size: 1.5rem;
    }
    
    .btn-send {
        padding: 0.875rem 2rem;
        font-size: 1rem;
    }
    
    .auth-card {
        padding: 2rem;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}

/* Loading Spinner */
.spinner-border {
    border-color: rgba(102, 126, 234, 0.2);
    border-right-color: #667eea;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--dark-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #667eea;
}