/**
 * Sidebar Component Styles
 * Clean, professional design for the campaign management sidebar
 */

.sidebar {
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e2e8f0;
    width: 280px;
    min-width: 280px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
#sidebar-container {
    /* Fixed column width on desktop; mobile handled in responsive CSS */
    flex: 0 0 280px !important;
}
.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
    background: white;
}

.sidebar-header h2 {
    color: #1e293b;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

.sidebar-nav {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-shrink: 0;
    background: white;
    border-bottom: 1px solid #e2e8f0;
}

.sidebar-nav a,
.nav-btn {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: #64748b;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.sidebar-nav a:hover,
.nav-btn:hover {
    background-color: #f1f5f9;
    color: #475569;
}

.sidebar-nav a.active {
    background-color: #3b82f6;
    color: white;
}

/* Navigation Dropdown Styles */
.nav-dropdown-container {
    position: relative;
}

.nav-dropdown-trigger {
    width: 100%;
    text-align: left;
}

.nav-dropdown-arrow {
    transition: transform 0.2s ease;
}

.nav-dropdown-arrow.rotate-180 {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    margin-top: 0.25rem;
    margin-left: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    overflow: hidden;
    transition: all 0.2s ease;
    max-height: 0;
    opacity: 0;
}

/* Navigation Dropdown Styles */
.nav-dropdown-container {
    position: relative;
}

.nav-dropdown-trigger {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-dropdown-arrow {
    transition: transform 0.2s ease;
    font-size: 0.75rem;
}

.nav-dropdown-arrow.rotate-180 {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    margin-top: 0.25rem;
    margin-left: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    overflow: hidden;
    transition: all 0.2s ease;
    max-height: 0;
    opacity: 0;
}

.nav-dropdown-menu.open {
    max-height: 200px;
    opacity: 1;
    margin-bottom: 0.5rem;
}

.dropdown-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    color: #64748b;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: all 0.2s ease;
    font-size: 0.8125rem;
    font-weight: 400;
}

.dropdown-item:hover {
    background-color: #f1f5f9;
    color: #475569;
}

/* Campaigns Section */
.campaigns-section {
    flex: 1;
    padding: 1rem;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: #f8fafc;
}

.campaigns-header {
    flex-shrink: 0;
    margin-bottom: 1rem;
}

.campaigns-header h3 {
    color: #1e293b;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

.campaigns-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    overflow-y: auto;
    min-height: 0;
    padding-right: 0.25rem;
    /* Custom scrollbar */
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.campaigns-list::-webkit-scrollbar {
    width: 4px;
}

.campaigns-list::-webkit-scrollbar-track {
    background: transparent;
}

.campaigns-list::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 2px;
}

.campaigns-list::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}
.campaign-item {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: all 0.15s ease;
    cursor: pointer;
}

.campaign-item:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.campaign-item h4 {
    color: #1e293b;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.campaign-status {
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    display: inline-block;
}

.status-running {
    background-color: #dcfce7;
    color: #166534;
}

.status-paused {
    background-color: #fef3c7;
    color: #92400e;
}

.status-completed {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-error {
    background-color: #fecaca;
    color: #991b1b;
}

.campaigns-actions {
    flex-shrink: 0;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    margin-top: 1rem;
}

/* Quick Action Buttons */
.quick-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    margin: 0.125rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background: white;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.quick-action-btn:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #475569;
    transform: translateY(-1px);
}

.quick-action-btn.primary {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.quick-action-btn.primary:hover {
    background-color: #2563eb;
    border-color: #2563eb;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    flex-shrink: 0;
    background: white;
    border-top: 1px solid #e2e8f0;
}

/* Notification Styles */
.sidebar-notification {
    background: #3b82f6;
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.sidebar-notification.success {
    background: #10b981;
}

.sidebar-notification.warning {
    background: #f59e0b;
}

.sidebar-notification.error {
    background: #ef4444;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
    width: 100%;
    min-width: 100%;
    /* Full viewport height minus fixed header; use dvh when supported */
    height: calc(100dvh - 64px);
    min-height: calc(100vh - 64px);
    max-height: none;
    overflow-y: auto;
    }
    
    .campaigns-list {
    max-height: none;
    }
}

.status-completed {
    background-color: #22c55e;
}

.status-draft {
    background-color: #9ca3af;
}

/* Active Navigation States */
.nav-item-active {
    background-color: #dbeafe;
    color: #1d4ed8;
    border-color: #93c5fd;
}

.nav-item-inactive {
    color: #4b5563;
    border-color: #e5e7eb;
}

.nav-item-inactive:hover {
    background-color: #f3f4f6;
}

/* Focus States */
.sidebar button:focus,
.sidebar a:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5);
}

/* Loading States */
.campaigns-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 0;
    color: #6b7280;
}

.campaigns-loading::before {
    content: '';
    width: 1rem;
    height: 1rem;
    border: 2px solid #d1d5db;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

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

/* Empty State */
.campaigns-empty {
    text-align: center;
    padding: 2rem 0;
    color: #6b7280;
}

.campaigns-empty svg {
    margin: 0 auto 0.5rem auto;
    height: 3rem;
    width: 3rem;
    color: #d1d5db;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .sidebar *,
    .sidebar *::before,
    .sidebar *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .sidebar {
        border-color: black;
    }
    
    .campaign-item:hover {
        background-color: black;
        color: white;
    }
    
    .quick-action-btn:hover {
        background-color: black;
        color: white;
    }
}
