/* Campaign Studio v2 Styles */

/* Campaign Studio Workspace */
.campaign-studio-workspace {
    background: #f9fafb;
    border-radius: 1rem;
    padding: 0;
    margin: 2rem 0;
    overflow: hidden;
}

.studio-tabs {
    display: flex;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.studio-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #6b7280;
    border-bottom: 2px solid transparent;
}

.studio-tab:hover {
    background: #f9fafb;
    color: #374151;
}

.studio-tab.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
    background: #f9fafb;
}

.studio-content {
    position: relative;
}

.studio-panel {
    display: none;
    padding: 2rem;
    min-height: 600px;
}

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

/* Overview Panel */
.studio-overview {
    padding: 0;
}

.overview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.overview-header h3 {
    color: #374151;
    font-size: 1.5rem;
}

.sync-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #10b981;
    font-size: 0.9rem;
}

.sync-status .spinning {
    animation: spin 2s linear infinite;
}

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

.element-card {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #e5e7eb;
}

.element-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #4f46e5;
}

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

.element-header i {
    color: #4f46e5;
    margin-right: 0.5rem;
}

.element-header span {
    font-weight: 600;
    color: #374151;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

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

.status-badge.processing {
    background: #fef3c7;
    color: #92400e;
    animation: pulse 2s infinite;
}

.element-preview {
    color: #6b7280;
}

.mini-journey {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.journey-step {
    font-size: 1.2rem;
}

.journey-arrow {
    color: #9ca3af;
}

.asset-thumbnails {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.asset-thumb {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #6b7280;
}

.asset-thumb.plus {
    background: #ddd6fe;
    color: #7c3aed;
}

.audience-segments {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.segment-bar {
    height: 20px;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: white;
}

.segment-bar.core {
    background: #4f46e5;
}

.segment-bar.browse {
    background: #10b981;
}

.segment-bar.lookalike {
    background: #f59e0b;
}

.cross-connections {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
}

.cross-connections h4 {
    color: #374151;
    margin-bottom: 1rem;
}

.connection-alerts {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
}

.alert.success {
    background: #dcfce7;
    color: #166534;
}

.alert.info {
    background: #dbeafe;
    color: #1e40af;
}

.alert.warning {
    background: #fef3c7;
    color: #92400e;
}

/* Journey Workspace */
.journey-workspace {
    padding: 0;
}

.workspace-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.workspace-header h3 {
    color: #374151;
    font-size: 1.25rem;
}

.journey-canvas-workspace {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.journey-flow-horizontal {
    display: flex;
    align-items: center;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.journey-step-card {
    min-width: 200px;
    background: #f9fafb;
    border-radius: 1rem;
    padding: 1.5rem;
    border: 2px solid #e5e7eb;
    transition: all 0.2s ease;
}

.journey-step-card:hover {
    border-color: #4f46e5;
    transform: translateY(-2px);
}

.journey-step-card.entry {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    border-color: #10b981;
}

.journey-step-card .step-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.journey-step-card h4 {
    color: #374151;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.journey-step-card.entry h4 {
    color: white;
}

.journey-step-card p {
    color: #6b7280;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.journey-step-card.entry p {
    color: rgba(255, 255, 255, 0.9);
}

.journey-step-card small {
    color: #9ca3af;
    font-size: 0.8rem;
}

.journey-step-card.entry small {
    color: rgba(255, 255, 255, 0.8);
}

.step-metrics {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #e5e7eb;
}

.step-metrics .metric {
    background: #ddd6fe;
    color: #7c3aed;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.journey-connector-h {
    width: 40px;
    height: 2px;
    background: #d1d5db;
    position: relative;
    flex-shrink: 0;
}

.journey-connector-h::after {
    content: '→';
    position: absolute;
    right: -8px;
    top: -8px;
    color: #6b7280;
    font-weight: bold;
}

.journey-insights {
    background: #fffbeb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    border: 1px solid #fbbf24;
}

.journey-insights h4 {
    color: #92400e;
    margin-bottom: 1rem;
}

.insight-cards {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.insight-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
}

.insight-card i {
    color: #f59e0b;
}

.insight-card span {
    flex: 1;
    color: #374151;
}

/* Creative Workspace */
.creative-workspace {
    padding: 0;
}

.creative-workspace-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
}

.asset-library {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
}

.asset-library h4 {
    color: #374151;
    margin-bottom: 1rem;
}

.asset-grid-compact {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.asset-item-compact {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.asset-item-compact:hover {
    background: #e5e7eb;
}

.asset-preview-compact {
    width: 40px;
    height: 40px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    font-weight: bold;
    flex-shrink: 0;
}

.asset-item-compact span {
    font-size: 0.9rem;
    color: #374151;
}

.generated-variants {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
}

.generated-variants h4 {
    color: #374151;
    margin-bottom: 1.5rem;
}

.variant-workspace {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.variant-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.variant-card-large {
    border: 2px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1.5rem;
    background: #f9fafb;
    transition: all 0.2s ease;
}

.variant-card-large:hover {
    border-color: #4f46e5;
    transform: translateY(-2px);
}

.variant-card-large.primary {
    border-color: #f59e0b;
    background: #fffbeb;
}

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

.variant-name {
    font-weight: 600;
    color: #374151;
}

.performance-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.performance-badge.top {
    background: #fbbf24;
    color: white;
}

.performance-badge {
    background: #e5e7eb;
    color: #6b7280;
}

.variant-preview-large {
    background: white;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.preview-content {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.preview-image {
    font-size: 3rem;
    flex-shrink: 0;
}

.preview-text h5 {
    color: #374151;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.preview-text p {
    color: #6b7280;
    font-size: 0.9rem;
}

.variant-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-label {
    font-size: 0.8rem;
    color: #6b7280;
}

.metric-value {
    font-weight: 600;
    color: #374151;
}

.creative-insights {
    background: #f0f9ff;
    border-radius: 1rem;
    padding: 1.5rem;
    margin-top: 2rem;
    grid-column: 1 / -1;
}

.creative-insights h4 {
    color: #1e40af;
    margin-bottom: 1rem;
}

.insight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.insight-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: white;
    border-radius: 0.5rem;
    color: #374151;
    font-size: 0.9rem;
}

.insight-item i {
    color: #3b82f6;
}

/* Audience Workspace */
.audience-workspace {
    padding: 0;
}

.audience-workspace-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.segments-overview {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
}

.segment-visual {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.segment-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    font-weight: 600;
}

.segment-circle:hover {
    transform: scale(1.05);
}

.segment-circle.core {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.segment-circle.browse {
    background: linear-gradient(135deg, #10b981, #059669);
}

.segment-circle.lookalike {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.segment-info {
    text-align: center;
}

.segment-info h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.segment-size {
    font-size: 1.5rem;
    font-weight: 700;
}

.segment-details {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
}

.segment-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.segment-detail-tab {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.9rem;
    color: #6b7280;
    border-bottom: 2px solid transparent;
}

.segment-detail-tab.active {
    color: #4f46e5;
    border-bottom-color: #4f46e5;
}

.segment-detail-content {
    min-height: 300px;
}

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

.stat-card {
    text-align: center;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.5rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5;
}

.stat-label {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

.segment-insights h5 {
    color: #374151;
    margin-bottom: 0.75rem;
}

.segment-insights ul {
    list-style: none;
    padding: 0;
}

.segment-insights li {
    padding: 0.5rem 0;
    color: #6b7280;
    font-size: 0.9rem;
    position: relative;
    padding-left: 1rem;
}

.segment-insights li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: #4f46e5;
    font-weight: bold;
}

.budget-allocation {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    grid-column: 1 / -1;
    margin-top: 1rem;
}

.budget-allocation h4 {
    color: #374151;
    margin-bottom: 1.5rem;
}

.allocation-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.allocation-item {
    display: grid;
    grid-template-columns: 150px 1fr 150px;
    gap: 1rem;
    align-items: center;
}

.allocation-label {
    font-size: 0.9rem;
    color: #374151;
    font-weight: 500;
}

.allocation-bar {
    height: 20px;
    background: #f3f4f6;
    border-radius: 10px;
    overflow: hidden;
}

.allocation-fill {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease;
}

.allocation-fill.core {
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
}

.allocation-fill.browse {
    background: linear-gradient(135deg, #10b981, #059669);
}

.allocation-fill.lookalike {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.allocation-value {
    font-size: 0.9rem;
    color: #374151;
    font-weight: 600;
    text-align: right;
}

/* Collaboration Panel */
.collaboration-panel {
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 1.5rem 2rem;
}

.collaboration-panel h4 {
    color: #374151;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.active-agents-mini {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.agent-mini {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.agent-mini.working {
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
}

.agent-mini.idle {
    background: #f0fdf4;
    border-left: 3px solid #10b981;
}

.agent-mini .agent-icon {
    font-size: 1.2rem;
}

.agent-mini .agent-task {
    font-size: 0.9rem;
    color: #374151;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .creative-workspace-content {
        grid-template-columns: 1fr;
    }

    .audience-workspace-content {
        grid-template-columns: 1fr;
    }

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

    .journey-flow-horizontal {
        flex-direction: column;
        align-items: stretch;
    }

    .journey-connector-h {
        width: 2px;
        height: 40px;
        align-self: center;
        transform: rotate(90deg);
    }
}

@media (max-width: 768px) {
    .studio-tabs {
        flex-wrap: wrap;
    }

    .studio-tab {
        flex: none;
        min-width: 50%;
    }

    .studio-panel {
        padding: 1rem;
    }

    .allocation-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .segment-visual {
        flex-direction: column;
        align-items: center;
    }

    .segment-circle {
        width: 120px;
        height: 120px;
    }
}