/* app/static/css/style.css */
:root {
    --sidebar-width: 260px;
    --sidebar-bg: #1a1a2e;
    --sidebar-color: #e0e0e0;
    --sidebar-active: #0d6efd;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f4f6f9;
    overflow-x: hidden;
}

/* Wrapper */
.wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-color);
    transition: all 0.3s;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 999;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.sidebar .sidebar-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar .sidebar-header h3 {
    color: #fff;
    font-weight: 600;
    font-size: 1.3rem;
    margin: 0;
}

.sidebar .sidebar-header h3 i {
    color: #667eea;
    margin-right: 8px;
}

.sidebar .sidebar-header .badge {
    font-size: 0.65rem;
    padding: 0.3rem 0.6rem;
}

.sidebar-nav {
    list-style: none;
    padding: 1rem 0;
    flex: 1;
    margin: 0;
}

.sidebar-nav .nav-item {
    padding: 0 0.75rem;
    margin-bottom: 0.2rem;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    padding: 0.7rem 1rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.sidebar-nav .nav-link i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 12px;
}

.sidebar-nav .nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.05);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: var(--sidebar-active);
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

.sidebar-nav .nav-link.active i {
    color: #fff;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.sidebar-footer .user-info {
    display: flex;
    align-items: center;
    color: rgba(255,255,255,0.7);
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}

.sidebar-footer .user-info i {
    font-size: 1.5rem;
    margin-right: 10px;
}

/* Main Content */
#content {
    width: calc(100% - var(--sidebar-width));
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: all 0.3s;
}

/* Top Navbar */
.navbar {
    background: #fff !important;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.navbar .btn-link {
    color: #6c757d;
    padding: 0;
}

.navbar .btn-link:hover {
    color: #0d6efd;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    border-left: 4px solid #0d6efd;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.stat-card .stat-icon {
    font-size: 1.5rem;
    color: #0d6efd;
    opacity: 0.7;
}

.stat-card .stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0.25rem 0;
}

.stat-card .stat-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.stat-card .stat-trend {
    font-size: 0.75rem;
    font-weight: 600;
}

.stat-card .stat-trend.up {
    color: #28a745;
}

.stat-card .stat-trend.down {
    color: #dc3545;
}

.stat-card.primary { border-left-color: #0d6efd; }
.stat-card.success { border-left-color: #28a745; }
.stat-card.warning { border-left-color: #ffc107; }
.stat-card.danger { border-left-color: #dc3545; }
.stat-card.info { border-left-color: #17a2b8; }

/* Domain Cards */
.domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.domain-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    transition: all 0.2s;
}

.domain-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.domain-card .domain-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.domain-card .domain-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.domain-card .domain-status {
    font-size: 0.7rem;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
}

.domain-card .domain-details {
    font-size: 0.85rem;
    color: #6c757d;
}

.domain-card .domain-details .detail-item {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px solid #f8f9fa;
}

.domain-card .domain-details .detail-item:last-child {
    border-bottom: none;
}

.domain-card .domain-details .detail-label {
    color: #6c757d;
}

.domain-card .domain-details .detail-value {
    font-weight: 500;
    color: #1a1a2e;
}

.domain-card .domain-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
}

/* Filter Chips */
.filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.filter-chip {
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    border: 1px solid #dee2e6;
    background: #fff;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-chip:hover {
    background: #f8f9fa;
}

.filter-chip.active {
    background: #0d6efd;
    color: #fff;
    border-color: #0d6efd;
}

.filter-chip i {
    margin-right: 4px;
}

/* Email List */
.email-list {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.email-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #f1f3f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
    cursor: pointer;
}

.email-item:hover {
    background: #f8f9fa;
}

.email-item:last-child {
    border-bottom: none;
}

.email-item .email-info {
    flex: 1;
}

.email-item .email-sender {
    font-weight: 500;
    color: #1a1a2e;
}

.email-item .email-subject {
    color: #6c757d;
    font-size: 0.9rem;
    margin-left: 0.5rem;
}

.email-item .email-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.8rem;
    color: #6c757d;
}

.email-item .email-time {
    white-space: nowrap;
}

.email-item .email-status {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

/* Buttons */
.btn-add-domain {
    background: #0d6efd;
    color: #fff;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-add-domain:hover {
    background: #0b5ed7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* Modals */
.modal-content {
    border-radius: 16px;
    border: none;
}

.modal-header {
    border-bottom: 1px solid #f1f3f5;
    padding: 1.25rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #f1f3f5;
    padding: 1rem 1.5rem;
}

/* Toggle Switch */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    transition: .3s;
    border-radius: 50%;
}

.toggle-switch input:checked + .toggle-slider {
    background: #0d6efd;
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        margin-left: -260px;
    }
    
    .sidebar.active {
        margin-left: 0;
    }
    
    #content {
        width: 100%;
        margin-left: 0;
    }
    
    #content.active {
        margin-left: 260px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .domain-grid {
        grid-template-columns: 1fr;
    }
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}
/* Logo styles */
.sidebar-header {
    position: relative;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header img {
    max-width: 100%;
    height: auto;
}

.sidebar-header .badge {
    position: absolute;
    top: 10px;
    right: 15px;
}

/* Login logo */
.login-logo img {
    max-width: 100%;
    height: auto;
}

/* Responsive logo */
@media (max-width: 768px) {
    .sidebar-header img {
        width: 140px;
    }
    
    .login-logo img {
        width: 200px;
    }
}
/* Logo styles - ensure they display correctly */
.sidebar-header {
    position: relative;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header img {
    max-width: 100%;
    height: auto;
    display: block;
    /* Prevent any color changes */
    filter: none !important;
    -webkit-filter: none !important;
}

.login-logo img {
    max-width: 100%;
    height: auto;
    display: block;
    /* Prevent any color changes */
    filter: none !important;
    -webkit-filter: none !important;
}

/* Responsive logos */
@media (max-width: 768px) {
    .sidebar-header img {
        width: 140px;
    }
    
    .login-logo img {
        width: 220px;
    }
}
