/* ==============================================================================
   MailPanel - Premium Custom Design System Stylesheet
   ============================================================================== */

:root {
    /* Color Palette */
    --bg-dark: #08090d;
    --bg-surface: #10121a;
    --bg-panel: #161822;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(139, 92, 246, 0.4);
    
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --primary-glow: rgba(139, 92, 246, 0.25);
    
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --status-active: #10b981;
    --status-active-bg: rgba(16, 185, 129, 0.15);
    --status-suspended: #ef4444;
    --status-suspended-bg: rgba(239, 68, 68, 0.15);
    
    --purple-glow: rgba(139, 92, 246, 0.15);
    --blue-glow: rgba(59, 130, 246, 0.15);
    --green-glow: rgba(16, 185, 129, 0.15);
    --red-glow: rgba(239, 68, 68, 0.15);
    --yellow-glow: rgba(245, 158, 11, 0.15);
    
    /* Layout Configurations */
    --sidebar-width: 280px;
    --sidebar-collapsed: 70px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font-primary: 'Outfit', 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

/* Light Theme Variables */
[data-theme="light"] {
    --bg-dark: #f3f4f6;
    --bg-surface: #ffffff;
    --bg-panel: #f9fafb;
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(139, 92, 246, 0.6);
    
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;
    
    --primary: #7c3aed;
    --primary-hover: #6d28d9;
    --primary-glow: rgba(124, 58, 237, 0.2);
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-primary);
    line-height: 1.5;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}
a:hover {
    color: var(--primary-hover);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ------------------------------------------------------------------------------
   Auth pages layout
   ------------------------------------------------------------------------------ */
.auth-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 24px;
    background: radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 40%);
}

.auth-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    padding: 40px;
    width: 100%;
    max-width: 480px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.auth-brand {
    text-align: center;
    margin-bottom: 32px;
}

.brand-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    background-color: var(--primary);
    border-radius: 50%;
    margin-bottom: 12px;
    box-shadow: 0 0 15px var(--primary);
}

.auth-brand h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    margin-bottom: 6px;
}

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

.auth-tabs {
    display: flex;
    background: var(--bg-panel);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
}

.auth-tab {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-primary);
    font-size: 0.9rem;
    font-weight: 600;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.auth-tab.active {
    background: var(--primary);
    color: #ffffff;
}

/* Forms Styling */
.auth-form .form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
select,
textarea {
    width: 100%;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: var(--transition);
}

.input-wrapper input {
    padding-left: 42px;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-footer-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

/* Custom Checkbox styles */
.checkbox-container {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 28px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    user-select: none;
}
.checkbox-container input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}
.checkmark {
    position: absolute;
    left: 0;
    height: 18px;
    width: 18px;
    background-color: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: var(--transition);
}
.checkbox-container:hover input ~ .checkmark {
    border-color: var(--primary);
}
.checkbox-container input:checked ~ .checkmark {
    background-color: var(--primary);
    border-color: var(--primary);
}
.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}
.checkbox-container input:checked ~ .checkmark:after {
    display: block;
}
.checkbox-container .checkmark:after {
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Button UI */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-primary);
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    gap: 8px;
}

.btn-primary {
    background-color: var(--primary);
    color: #ffffff;
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 0 15px var(--primary-glow);
}

.btn-secondary {
    background-color: var(--bg-panel);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    border-color: var(--text-secondary);
}

.btn-danger {
    background-color: var(--status-suspended);
    color: #ffffff;
}
.btn-danger:hover {
    background-color: #dc2626;
}

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-xs {
    padding: 4px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
}

.btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Toast Alerts */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: 100%;
}

.toast {
    background: var(--bg-surface);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius-sm);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    color: var(--text-primary);
    display: flex;
    padding: 16px 20px;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    align-items: center;
    border: 1px solid var(--border-color);
    border-left-width: 4px;
    cursor: pointer;
}

.toast-success {
    border-left-color: var(--status-active);
}

.toast-error {
    border-left-color: var(--status-suspended);
}

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

@keyframes slideIn {
    0% { transform: translateX(120%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    0% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-10px); }
}

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}
