/**
 * MailPulse - Modern SaaS Stylesheet
 */

:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --primary-light: #eef2ff;
    --sidebar-bg: #0f172a;
    --sidebar-hover: #1e293b;
    --sidebar-active: #312e81;
    --sidebar-width: 260px;
    --body-bg: #f8fafc;
    --card-border: #e2e8f0;
    --text-main: #1e293b;
}

html {
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--body-bg);
    color: var(--text-main);
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
}

/* Sidebar & Layout Styles */
#wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    align-items: stretch;
    position: relative;
}

#page-content-wrapper {
    min-width: 0 !important;
    max-width: 100% !important;
    width: auto !important;
    flex: 1 1 0%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

main {
    min-width: 0 !important;
    max-width: 100% !important;
    width: 100%;
}

/* Single Universal Horizontal Table Scrollbar */
.table-responsive {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: auto;
    scrollbar-color: #4f46e5 #e2e8f0;
    position: relative;
    margin-bottom: 0.5rem;
}

.table-responsive > table {
    min-width: 980px;
}

.table-responsive::-webkit-scrollbar {
    height: 12px;
    width: 12px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 6px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #4f46e5;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #4338ca;
}

#sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background-color: var(--sidebar-bg) !important;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    align-self: stretch;
    transition: margin 0.3s ease-in-out;
    z-index: 1040;
}

@media (min-width: 992px) {
    #sidebar {
        position: relative;
        height: auto;
        min-height: 100%;
        overflow-y: visible !important;
        overflow-x: hidden !important;
    }
}

#sidebar .nav-link {
    color: #94a3b8;
    padding: 0.65rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

#sidebar .nav-link i {
    font-size: 1.1rem;
}

#sidebar .nav-link:hover {
    color: #f8fafc;
    background-color: var(--sidebar-hover);
}

#sidebar .nav-link.active {
    color: #ffffff;
    background-color: var(--primary);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.avatar-circle {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    font-size: 14px;
}

/* Card Styling */
.card {
    border: 1px solid var(--card-border);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    background-color: #ffffff;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid var(--card-border);
    padding: 1rem 1.25rem;
}

/* Stat Cards */
.stat-card {
    border-radius: 0.75rem;
    overflow: hidden;
    position: relative;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Badges */
.badge {
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.4em 0.7em;
}

/* Tables */
.table thead th {
    background-color: #f8fafc;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #64748b;
    font-weight: 700;
    border-bottom: 1px solid var(--card-border);
    padding: 0.75rem 1rem;
}

.table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--card-border);
}

.table-hover tbody tr:hover {
    background-color: #f8fafc;
}

/* Device Preview Frame */
.device-preview-wrapper {
    background: #e2e8f0;
    padding: 20px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 500px;
}

.device-desktop {
    width: 100%;
    max-width: 780px;
    background: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.device-mobile {
    width: 380px;
    background: #ffffff;
    box-shadow: 0 15px 30px -5px rgba(0, 0, 0, 0.2);
    border: 8px solid #334155;
    border-radius: 28px;
    overflow: hidden;
}

/* Responsive Mobile Navigation */
@media (max-width: 991.98px) {
    #sidebar {
        margin-left: calc(-1 * var(--sidebar-width));
        position: fixed;
        top: 0;
        bottom: 0;
        left: 0;
        height: 100vh;
        overflow-y: auto !important;
        overflow-x: hidden !important;
    }

    #sidebar.show {
        margin-left: 0;
    }

    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1030;
    }
}

/* Utilities */
.text-purple {
    color: #9333ea !important;
}

.cursor-pointer {
    cursor: pointer;
}

.max-w-2xl {
    max-width: 42rem;
}

.max-w-md {
    max-width: 28rem;
}

