/* Waves Marketing Solutions - Professional Dashboard Theme */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #3b82f6;
    --secondary-color: #0f172a;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #0ea5e9;
    --bg-body: #f3f4f6;
    --bg-card: #ffffff;
    --text-main: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --transition: all 0.2s ease-in-out;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow-x: hidden; width: 100%; }
body { font-family: 'Inter', sans-serif; line-height: 1.6; color: var(--text-main); background-color: var(--bg-body); }

h1, h2, h3, h4, h5, h6 { color: var(--secondary-color); font-weight: 600; line-height: 1.2; }
h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

.container { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; width: 100%; }
.dashboard-grid { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; padding: 2rem 0; min-height: calc(100vh - 120px); width: 100%; }

.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }

.header { background: var(--bg-card); border-bottom: 1px solid var(--border-color); padding: 1rem 0; position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm); width: 100%; }
.nav-container { max-width: 1400px; margin: 0 auto; padding: 0 1.5rem; display: flex; justify-content: space-between; align-items: center; }
.logo { font-size: 1.5rem; font-weight: 700; color: var(--primary-color); text-decoration: none; display: flex; align-items: center; gap: 0.5rem; }
.nav-menu { display: flex; list-style: none; gap: 1.5rem; align-items: center; }
.nav-menu a { color: var(--text-muted); text-decoration: none; font-weight: 500; font-size: 0.95rem; transition: var(--transition); padding: 0.5rem 0.75rem; border-radius: var(--radius-md); }
.nav-menu a:hover { color: var(--primary-color); background: #eff6ff; }

.sidebar { background: var(--bg-card); border-radius: var(--radius-lg); padding: 1.5rem; box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); height: fit-content; position: sticky; top: 100px; }
.sidebar-menu { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.sidebar-menu a { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1rem; color: var(--text-muted); text-decoration: none; border-radius: var(--radius-md); transition: var(--transition); font-weight: 500; }
.sidebar-menu a:hover { background-color: #f3f4f6; color: var(--secondary-color); }
.sidebar-menu a.active { background-color: #eff6ff; color: var(--primary-color); font-weight: 600; }

.main-content { display: flex; flex-direction: column; gap: 2rem; }
.card { background: var(--bg-card); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--border-color); padding: 1.5rem; transition: var(--transition); }
.card:hover { box-shadow: var(--shadow-md); }
.card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-color); }
.card-title { font-size: 1.25rem; color: var(--secondary-color); margin: 0; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.stat-card { background: var(--bg-card); padding: 1.5rem; border-radius: var(--radius-lg); border: 1px solid var(--border-color); box-shadow: var(--shadow-sm); transition: var(--transition); position: relative; overflow: hidden; }
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--primary-color); }
.stat-number { font-size: 2.25rem; font-weight: 700; color: var(--secondary-color); display: block; line-height: 1; margin-bottom: 0.5rem; }
.stat-label { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }

.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th { background: #f9fafb; padding: 1rem; font-weight: 600; color: var(--text-muted); text-align: left; font-size: 0.875rem; border-bottom: 1px solid var(--border-color); text-transform: uppercase; letter-spacing: 0.05em; }
.table td { padding: 1rem; border-bottom: 1px solid var(--border-color); color: var(--text-main); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tbody tr:hover { background-color: #f9fafb; }

.btn { display: inline-flex; align-items: center; justify-content: center; padding: 0.625rem 1.25rem; font-size: 0.95rem; font-weight: 500; border-radius: var(--radius-md); cursor: pointer; transition: var(--transition); border: 1px solid transparent; text-decoration: none; gap: 0.5rem; }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-dark); box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2); }
.btn-secondary { background-color: white; border-color: var(--border-color); color: var(--text-main); }
.btn-secondary:hover { background-color: #f9fafb; border-color: #d1d5db; }
.btn-danger { background-color: var(--danger-color); color: white; }
.btn-danger:hover { background-color: #dc2626; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.875rem; }

.form-group { margin-bottom: 1.5rem; }
.form-label { display: block; margin-bottom: 0.5rem; font-weight: 500; color: var(--text-main); font-size: 0.95rem; }
.form-control { width: 100%; padding: 0.75rem; border: 1px solid var(--border-color); border-radius: var(--radius-md); font-size: 1rem; transition: var(--transition); background-color: #fff; }
.form-control:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); }

.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; background-color: var(--bg-body); background-image: radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.1) 0px, transparent 50%), radial-gradient(at 100% 100%, rgba(59, 130, 246, 0.1) 0px, transparent 50%); }
.login-card { background: white; padding: 3rem; border-radius: 1rem; box-shadow: var(--shadow-lg); width: 100%; max-width: 420px; border: 1px solid var(--border-color); }
.login-logo { text-align: center; margin-bottom: 2.5rem; }
.login-logo h1 { font-size: 2rem; color: var(--secondary-color); margin-bottom: 0.5rem; display: flex; align-items: center; justify-content: center; gap: 0.5rem; }

.alert { padding: 1rem; border-radius: var(--radius-md); margin-bottom: 1rem; border: 1px solid transparent; }
.alert-success { background-color: #ecfdf5; border-color: #d1fae5; color: #065f46; }
.alert-danger { background-color: #fef2f2; border-color: #fee2e2; color: #991b1b; }

.text-center { text-align: center; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-3 { margin-top: 1rem; }
.w-100 { width: 100%; }
.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.text-muted { color: var(--text-muted) !important; }
.h-100 { height: 100%; }
.bg-light { background-color: #f9fafb; }
.rounded { border-radius: var(--radius-md); }
.font-weight-bold { font-weight: 700; }
.text-primary { color: var(--primary-color) !important; }
.p-2 { padding: 0.5rem; }
.d-block { display: block; }

.row { display: flex; flex-wrap: wrap; margin-right: -1rem; margin-left: -1rem; }
.col-md-6 { flex: 0 0 50%; max-width: 50%; padding-right: 1rem; padding-left: 1rem; }
.col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; padding-right: 1rem; padding-left: 1rem; }

.badge { padding: 0.25rem 0.5rem; font-size: 0.75rem; border-radius: 0.25rem; display: inline-block; font-weight: 600; }
.badge-success { background-color: var(--success-color); color: white; }
.badge-secondary { background-color: #6c757d; color: white; }

@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 240px 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .sidebar { position: static; margin-bottom: 1.5rem; }
    .nav-container { flex-direction: column; gap: 1rem; }
    .nav-menu { flex-wrap: wrap; justify-content: center; gap: 1rem; }
    .stat-card { text-align: center; }
    .col-md-6, .col-md-4 { flex: 0 0 100%; max-width: 100%; }
    
    /* Page Header on mobile */
    .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .page-header > div { width: 100%; }
    .page-header .d-flex { flex-wrap: wrap; width: 100%; }
    .page-header .btn, .page-header select, .page-header form { width: 100%; }
    
    /* Table responsiveness */
    .table th, .table td { padding: 0.75rem 0.5rem; font-size: 0.85rem; }
    .btn-sm { padding: 0.25rem 0.5rem; font-size: 0.75rem; }
    
    /* Stats grid mobile */
    .stats-grid { grid-template-columns: 1fr; gap: 1rem; }

    /* Flex utilities for mobile */
    .d-flex { flex-wrap: wrap; }
    .d-flex.gap-2 { gap: 0.5rem !important; }
    
    /* Form inputs on mobile */
    .form-control-sm { width: 100% !important; margin-bottom: 0.5rem; }
    
    /* Headers on mobile */
    .card-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .card-header .d-flex { width: 100%; }
    .card-header input[type="text"] { width: 100% !important; }
    
    /* Action buttons on mobile */
    .d-flex.gap-2 > form { width: 100%; }
    .d-flex.gap-2 > form > button { width: 100%; }

    /* Fix table inputs specifically */
    td input[type="text"] { min-width: 120px; }
}

@media (max-width: 480px) {
    .container { padding: 0 1rem; }
    .card { padding: 1rem; }
    .login-card { padding: 2rem; }
    
    /* Header mobile */
    .logo img { height: 60px !important; }
    .header { padding: 0.75rem 0; }
}

/* AI Insights Styling */
.ai-content {
    line-height: 1.7;
    color: var(--text-main);
}
.ai-content h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
}
.ai-content h3:first-child {
    margin-top: 0;
}
.ai-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}
.ai-content li {
    margin-bottom: 0.5rem;
}
.ai-content strong {
    font-weight: 600;
    color: var(--secondary-color);
}
