/* Live Optimization Shared Styles */
.optimization-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
}

.main-optimization {
    padding: 32px;
    background: var(--bg-primary);
    overflow-y: auto;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

/* Progress Ring */
.progress-ring-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 48px;
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.05) 0%, rgba(0, 122, 255, 0.05) 100%);
    border-radius: 24px;
    border: 1px solid var(--border-subtle);
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.progress-ring-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(0, 212, 170, 0.1) 0%, transparent 50%);
    animation: pulse-bg 4s ease-in-out infinite;
}

@keyframes pulse-bg {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.1);
    }
}

.progress-ring {
    position: relative;
    width: 200px;
    height: 200px;
    z-index: 1;
}

.progress-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.progress-ring circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.progress-ring .bg {
    stroke: var(--border-subtle);
}

.progress-ring .progress {
    stroke: url(#pg);
    stroke-dasharray: 565;
    stroke-dashoffset: 565;
    transition: stroke-dashoffset 0.5s ease;
    filter: drop-shadow(0 0 8px rgba(0, 212, 170, 0.5));
}

.progress-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.progress-value {
    font-size: 42px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.progress-label {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Phase Timeline */
.phase-timeline {
    display: flex;
    justify-content: space-between;
    margin-top: 32px;
    width: 100%;
    max-width: 700px;
}

.phase-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
}

.phase-item:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 14px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: var(--border-subtle);
    z-index: -1;
}

.phase-item.completed::after {
    background: var(--accent-primary);
}

.phase-icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-secondary);
    border: 2px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.phase-item.completed .phase-icon {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.phase-item.active .phase-icon {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px rgba(0, 212, 170, 0.2);
    animation: pulse-icon 1.5s ease-in-out infinite;
}

@keyframes pulse-icon {

    0%,
    100% {
        box-shadow: 0 0 0 4px rgba(0, 212, 170, 0.2);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(0, 212, 170, 0.1);
    }
}

.phase-name {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 6px;
    text-align: center;
}

.phase-item.completed .phase-name,
.phase-item.active .phase-name {
    color: var(--text-primary);
    font-weight: 500;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-subtle);
    text-align: center;
}

.metric-name {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.metric-values {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.before {
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: line-through;
}

.arrow {
    color: var(--success);
}

.after {
    font-size: 18px;
    font-weight: 700;
    color: var(--success);
}

.after.pending {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Results Section */
.results-section {
    display: none;
    margin-top: 32px;
}

.results-section.visible {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-subtle);
    margin-bottom: 24px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.results-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.savings-badge {
    background: linear-gradient(135deg, var(--success) 0%, #00a884 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

/* Data Table */
.data-table {
    width: 100%;
}

.data-table th {
    text-align: left;
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.data-table td {
    padding: 14px 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.sku-id {
    font-weight: 600;
    color: var(--accent-secondary);
}

.action-order {
    color: var(--accent-primary);
    font-weight: 500;
}

.action-markdown {
    color: var(--warning);
    font-weight: 500;
}

/* Action Bar & Buttons */
.action-bar {
    display: flex;
    gap: 16px;
    margin-top: 24px;
}

.btn-primary {
    flex: 1;
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 212, 170, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Sidebar styles moved to components.css */