/* ============================================
   AUTOMATION SECTION - ENHANCED AUTOPILOT + CONTROL
   Theme-aware styling for dual-panel automation cards
   ============================================ */

/* Autopilot & Control Badge */
.autopilot-control-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.1) 100%);
    border: 2px solid;
    border-image: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) 1;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    margin-bottom: 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

[data-theme="dark"] .autopilot-control-badge {
    background: linear-gradient(135deg, rgba(129, 140, 248, 0.15) 0%, rgba(167, 139, 250, 0.15) 100%);
}

.badge-icon {
    font-size: 1.25rem;
}

.badge-divider {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Badge text in autopilot control badge - ensure readable */
.autopilot-control-badge .badge-text {
    color: var(--text-primary);
    font-weight: 600;
    display: inline;
    flex-direction: row;
}

/* Practice Templates Section */
.practice-templates {
    margin: 4rem 0;
    padding: 3rem;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
}

.templates-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.75rem;
}

.templates-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 2.5rem;
}

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

.template-card {
    background: var(--bg-secondary);
    border: 2px solid var(--border-light);
    border-radius: 0.75rem;
    padding: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.template-card:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-xl);
    transform: translateY(-4px);
}

.template-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

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

.template-description {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.template-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Setup Timeline */
.setup-timeline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 2rem;
    background: var(--bg-primary);
    border-radius: 0.75rem;
    border: 1px solid var(--border-light);
}

.timeline-step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-radius: 0.5rem;
    border: 1px solid var(--border-light);
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
}

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

.step-title {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.step-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.timeline-arrow {
    color: var(--text-tertiary);
    font-size: 1.5rem;
    font-weight: 300;
}

.timeline-result {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    border-radius: 0.5rem;
    font-weight: 700;
}

.result-icon {
    font-size: 1.5rem;
}

/* Dual-Panel Automation Cards */
.capability-card.dual-panel {
    border: 2px solid var(--border-light);
    border-radius: 1.25rem;
    overflow: hidden;
}

.capability-card.dual-panel:hover {
    border-color: #8b5cf6;
}

.dual-panel-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-top: 1.5rem;
    border-radius: 0.75rem;
    overflow: hidden;
}

.autopilot-panel,
.control-panel {
    padding: 1.5rem;
    border-radius: 0;
}

.autopilot-panel {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(99, 102, 241, 0.05) 100%);
    border-right: 1px solid var(--border-light);
}

[data-theme="dark"] .autopilot-panel {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.1) 0%, rgba(129, 140, 248, 0.1) 100%);
}

.control-panel {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.05) 0%, rgba(20, 184, 166, 0.05) 100%);
}

[data-theme="dark"] .control-panel {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.1) 0%, rgba(45, 212, 191, 0.1) 100%);
}

.panel-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    color: var(--text-primary);
    opacity: 0.8;
}

.panel-features {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.panel-features li {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding-left: 1.25rem;
    position: relative;
    line-height: 1.5;
}

.panel-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-primary);
    font-weight: 700;
}

.panel-stat {
    font-size: 0.875rem;
    font-weight: 700;
    color: #6366f1;
    padding: 0.5rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 0.375rem;
    display: inline-block;
}

[data-theme="dark"] .panel-stat {
    color: #818cf8;
    background: rgba(129, 140, 248, 0.15);
}

.panel-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.control-count {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-primary);
    padding: 0.5rem 0.75rem;
    background: var(--color-primary-light);
    border-radius: 0.375rem;
}

.configure-btn {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border: 2px solid var(--color-primary);
    border-radius: 0.375rem;
    transition: all 0.2s ease;
}

.configure-btn:hover {
    background: var(--color-primary);
    color: white;
    transform: translateX(2px);
}

/* Control Depth Visualizer */
.control-depth-visualizer {
    margin: 3rem 0;
    padding: 2rem;
    background: var(--bg-card);
    border: 2px solid var(--border-light);
    border-radius: 1rem;
}

.visualizer-header {
    text-align: center;
    margin-bottom: 2rem;
}

.visualizer-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.visualizer-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
}

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

.automation-node {
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.automation-node:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.node-title {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.node-params {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    font-weight: 600;
}

/* Responsive Design */

/* On large screens, limit dual-panel cards to 2 per row for readability */
@media (min-width: 1200px) {
    .capabilities-grid:has(.dual-panel) {
        grid-template-columns: repeat(2, 1fr) !important;
        max-width: 1100px;
        margin-left: auto;
        margin-right: auto;
    }
}

/* On medium screens, stack the internal panels */
@media (max-width: 1199px) and (min-width: 769px) {
    .dual-panel-content {
        grid-template-columns: 1fr;
    }

    .autopilot-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }
}

@media (max-width: 768px) {
    .dual-panel-content {
        grid-template-columns: 1fr;
    }

    .autopilot-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-light);
    }

    .setup-timeline {
        flex-direction: column;
        gap: 0.5rem;
    }

    .timeline-arrow {
        transform: rotate(90deg);
    }

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

    .autopilot-control-badge {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }

    .badge-divider {
        display: none;
    }
}

@media (max-width: 480px) {
    .practice-templates {
        padding: 1.5rem;
    }

    .templates-title {
        font-size: 1.5rem;
    }

    .automation-title {
        font-size: 2rem;
    }
}
