:root {
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a855f7 100%);
    --secondary-gradient: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 100%);
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --card-bg: rgba(255, 255, 255, 0.95);
    --glass-bg: rgba(255, 255, 255, 0.1);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #6366f1 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(600px circle at 20% 30%, rgba(120, 119, 198, 0.3), transparent 40%),
        radial-gradient(800px circle at 80% 70%, rgba(255, 119, 198, 0.3), transparent 40%),
        radial-gradient(600px circle at 40% 90%, rgba(120, 219, 255, 0.3), transparent 40%);
    pointer-events: none;
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 3rem;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    z-index: -1;
}

.header h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.025em;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.3);
}

.header p {
    font-size: clamp(1rem, 2vw, 1.25rem);
    opacity: 0.9;
    font-weight: 300;
    letter-spacing: 0.025em;
}

.tabs {
    display: flex;
    background: var(--glass-bg);
    border-radius: 1rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: relative;
}

.tabs::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.tab {
    flex: 1;
    padding: 1.25rem 1.5rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    border-radius: 1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.6s ease;
}

.tab:hover::before {
    left: 100%;
}

.tab:hover {
    color: white;
    transform: translateY(-2px);
}

.tab.active {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    font-weight: 600;
}

.tab-content {
    display: none;
    background: var(--card-bg);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.tab-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(99, 102, 241, 0.3), transparent);
}

.tab-content.active {
    display: block;
    animation: fadeInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab-content h2 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tab-content>p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--border-color);
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.btn {
    background: var(--primary-gradient);
    color: white;
    padding: 1rem 2rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.btn:active {
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-blue {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.btn-blue {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.btn-blue:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
}

.blue-select {
    border-color: #3b82f6 !important;
    background: rgba(59, 130, 246, 0.05);
}

.blue-select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1) !important;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stats-card {
    background: var(--primary-gradient);
    color: white;
    padding: 2rem;
    border-radius: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    transition: transform 0.6s ease;
}

.stats-card:hover {
    transform: translateY(-5px);
}

.stats-card:hover::before {
    transform: translate(25%, 25%);
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stats-card p {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 500;
}

.stats-card i {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.5rem;
    opacity: 0.3;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 2.5rem 0 1.5rem 0;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.section-title i {
    color: #6366f1;
}

.user-card {
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.user-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.user-card:hover::before {
    opacity: 1;
}

.user-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.status-submitted {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
}

.status-email-sent {
    background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
    color: #be185d;
}

.status-opened {
    background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
    color: #166534;
}

.status-clicked {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
}

.status-paid {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
}

.status-stopped {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
}

.user-card h4 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.user-card p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.user-card strong {
    color: var(--text-primary);
}

.email-log {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
}

.email-log::-webkit-scrollbar {
    width: 6px;
}

.email-log::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.email-log::-webkit-scrollbar-thumb {
    background: var(--primary-gradient);
    border-radius: 3px;
}

.log-entry {
    padding: 0.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    transition: background-color 0.2s ease;
}

.log-entry:hover {
    background: rgba(99, 102, 241, 0.05);
}

.log-entry:last-child {
    border-bottom: none;
}

.simulation-controls {
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
}

.simulation-controls h3 {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.control-group {
    display: flex;
    gap: 1rem;
    align-items: end;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.control-group label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.control-group>div {
    flex: 1;
    min-width: 200px;
}

.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    color: white;
    font-weight: 600;
    transform: translateX(400px);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    max-width: 350px;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.notification.info {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
}

.notification.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.success-message {
    text-align: center;
    padding: 3rem;
    animation: slideInUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.success-message h3 {
    color: var(--success-color);
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.success-message p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 1.5rem;
    }

    .tab-content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .tabs {
        flex-direction: column;
        gap: 0.5rem;
        padding: 0.5rem;
    }

    .tab {
        padding: 1rem;
        margin: 0;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .control-group {
        flex-direction: column;
        align-items: stretch;
    }

    .control-group>div {
        min-width: auto;
    }

    .notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        transform: translateY(-100px);
        max-width: none;
    }

    .notification.show {
        transform: translateY(0);
    }

    .stats-card h3 {
        font-size: 2rem;
    }

    .user-card {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    .tab-content {
        padding: 1.5rem;
    }

    .header h1 {
        font-size: 2.5rem;
    }

    .control-group {
        gap: 0.75rem;
    }

    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
}

/* Loading animations */
.loading-shimmer {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

/* Improved focus styles for accessibility */
.btn:focus-visible,
.tab:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.5);
    outline-offset: 2px;
}