:root {
    /* Color Palette */
    --primary-color: #d92f29; /* Refreshed primary red */
    --primary-hover: #b92420;
    --bg-color: #f7f9fa; /* Outer background */
    --app-bg: #fff; /* Inner background */
    --surface-color: #ffefe8; /* Warm light pink/peach for cards */
    --surface-hover: #ffe2d4;
    --text-main: #111827;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --sidebar-bg: #ffffff;
    --success-color: #10b981;
    
    /* Typography */
    --font-family: 'Inter', sans-serif;
    
    /* Shadows & Transitions */
    --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);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --sidebar-width: 260px;
    --border-radius: 12px;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    /* optional dot pattern background as seen in images */
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Base Layout */
.app-layout {
    display: flex;
    width: 100%;
    max-width: 1300px;
    height: 90vh; /* Premium windowed look */
    max-height: 900px;
    background-color: var(--app-bg);
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.08); /* Float effect */
    overflow: hidden;
    margin: 20px;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.sidebar-header {
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.brand {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 32px;
}

.brand img {
    max-height: 60px !important;
    width: auto;
}

.btn-create {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    transform: translateY(0);
}

.btn-create:hover, .btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(217, 47, 41, 0.25);
}

.sidebar-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0 12px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    border-radius: 6px;
    transition: var(--transition);
    margin-bottom: 4px;
}

.nav-item:hover {
    background-color: #fff;
    color: var(--text-main);
}

.nav-item.active {
    color: #1d4ed8;
    background-color: #eff6ff;
    border-left: 3px solid #3b82f6;
    border-radius: 0 6px 6px 0;
}

.sidebar-footer {
    padding: 24px;
    border-top: 1px solid var(--border-color);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f8f8f8; /* Ultra light gray tint */
    overflow-y: auto;
}

.top-header {
    height: 72px;
    padding: 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 5;
}

.page-title {
    font-size: 16px;
    font-weight: 600;
    color: #1d4ed8; /* Blue brand title */
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.lang-selector select {
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    outline: none;
    transition: var(--transition);
}

.lang-selector select:hover {
    background: var(--surface-hover);
}

/* Wizard */
.campaign-wizard {
    padding: 40px;
    max-width: 1000px;
    margin: 0 auto;
    width: 100%;
}

.wizard-header {
    margin-bottom: 40px;
}

.step-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 8px;
    color: var(--text-main);
}

.step-subtitle {
    color: var(--text-muted);
    font-size: 16px;
}

/* Progress area differences based on step (horizontal vs vertical) */
/* We will use a mixed approach or horizontal top-bar for simplicity */
.wizard-progress {
    display: flex;
    justify-content: flex-start;
    gap: 40px;
    margin-bottom: 40px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
}

.progress-step {
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0.5;
    transition: var(--transition);
}

.progress-step.active, .progress-step.completed {
    opacity: 1;
}

.step-marker {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e2e8f0;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

.progress-step.active .step-marker {
    background: var(--primary-color);
    color: white;
}

.progress-step.completed .step-marker {
    background: var(--primary-color);
    color: white;
}

.step-labels {
    display: flex;
    flex-direction: column;
}

.step-name {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--text-main);
}

.step-desc {
    font-size: 11px;
    color: var(--text-muted);
}

/* Forms & Panels */
.step-panel {
    display: none;
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-panel.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-group {
    margin-bottom: 24px;
    background: var(--surface-color);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid transparent;
    transition: var(--transition);
}

.form-group:focus-within {
    border-color: #ffcaba;
    background: #fff9f6;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-main);
}

.field-desc {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

input[type="text"], input[type="url"], input[type="tel"] {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: rgba(255,255,255,0.7);
    transition: var(--transition);
    outline: none;
}

input:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(217, 47, 41, 0.1);
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-icon svg {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
}

.input-with-icon input {
    padding-left: 36px;
}

.input-group {
    display: flex;
    gap: 8px;
}

select.country-code {
    padding: 12px;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 8px;
    background: rgba(255,255,255,0.7);
    outline: none;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-main);
}

/* Actions */
.step-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background-color: rgba(217, 47, 41, 0.05);
}

.full-width {
    width: 100%;
}

.margin-top-sm {
    margin-top: 16px;
}

.flex-align {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Split Layout (Step 2 and 3) */
.split-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.layout-column {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.layout-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

/* Budget Slider Native Styling */
.budget-display {
    font-size: 48px;
    font-weight: 700;
    color: var(--primary-color);
    display: flex;
    align-items:baseline;
    gap: 4px;
    margin: 24px 0;
}

.budget-display .currency {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
}

.slider-container {
    margin-bottom: 32px;
}

input[type=range] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
    height: 6px;
    border-radius: 3px;
    border: none;
    background-color: #e2e8f0;
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    background: #1d4ed8;
    cursor: pointer;
    margin-top: -7px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.1s;
}

input[type=range]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type=range]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    cursor: pointer;
    background: transparent; /* Track colored via JS based on value */
    border-radius: 3px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.stat-box {
    background: var(--surface-color);
    padding: 16px;
    border-radius: 8px;
}
.stat-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
}
.stat-value {
    font-size: 16px;
    font-weight: 700;
}

/* Channels Grid */
.channels-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.selection-badge {
    background: var(--surface-color);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.channels-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 4px; /* for scrollbar */
}

/* Scrollbar styling for grids */
.channels-grid::-webkit-scrollbar {
    width: 6px;
}
.channels-grid::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.1);
    border-radius: 3px;
}

.channel-card {
    border: 1px solid transparent;
    background: #fff;
    border-radius: 4px;
    padding: 20px 8px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    user-select: none;
    color: #715b55;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

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

.channel-card.selected {
    border-color: var(--primary-color);
    background: #fff;
    color: var(--primary-color);
    box-shadow: 0 0 0 1px var(--primary-color);
}

.channel-icon {
    font-size: 24px;
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: currentColor;
}

.channel-card.selected .channel-icon {
    color: var(--primary-color);
}

.channel-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-main);
}

.check-icon {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 16px;
    height: 16px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: var(--transition);
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.channel-card.selected .check-icon {
    opacity: 1;
    transform: scale(1);
}

/* Duration Grid */
.duration-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-top: 16px;
}

.duration-box {
    background: #ffebe3;
    color: var(--primary-color);
    text-align: center;
    padding: 12px 0;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.duration-box:hover {
    background: #ffd6c5;
}

.duration-box.selected {
    background: var(--primary-color);
    color: white;
    border: 2px solid #a62420;
}

/* Summary Card */
.summary-card {
    background: var(--surface-color);
    border: none;
}

.summary-list {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    border-bottom: 1px dashed rgba(0,0,0,0.1);
    padding-bottom: 8px;
}

.summary-item span {
    color: var(--text-muted);
    font-size: 13px;
}

.summary-item strong {
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    max-width: 60%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.step-text {
    font-size: 12px;
    text-align: center;
    color: var(--text-muted);
    margin: 24px 0 12px 0;
}

/* Responsive constraints */
@media (max-width: 900px) {
    .app-layout {
        flex-direction: column;
        height: auto;
        max-height: none;
        margin: 0;
        border-radius: 0;
    }
    
    .sidebar {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 12px;
    }
    
    .sidebar-nav {
        flex-direction: row;
        overflow-x: auto;
    }
    
    .brand { margin-bottom: 0; }
    .btn-create { display: none; }
    
    .split-layout {
        grid-template-columns: 1fr;
    }
    
    .wizard-progress {
        overflow-x: auto;
    }
}
