/**
 * form-styles.css - Form-specific styling for Agent Wizard
 * Fixed to use consistent dark mode colors matching the main page
 */

/* ====================
   FORM SECTIONS
   ==================== */

.form-section {
    display: none;
    background: rgba(30, 41, 59, 0.8);
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    overflow: hidden;
}

.form-section.active {
    display: block;
    border-color: #3b82f6;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.2);
}

.section-title {
    background: rgba(15, 23, 42, 0.6);
    padding: 20px 30px;
    margin: 0;
    font-size: 1.3rem;
    color: #e2e8f0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.section-description {
    padding: 15px 30px 0;
    color: #94a3b8;
    margin: 0;
}

/* ====================
   FORM CONTENT
   ==================== */

.form-content {
    padding: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 8px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 8px;
    font-size: 0.9rem;
    background: rgba(30, 41, 59, 0.5);
    color: #f1f5f9;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: rgba(30, 41, 59, 0.8);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #6b7280;
}

.form-group input[readonly] {
    background: rgba(30, 41, 59, 0.3);
    color: #94a3b8;
    cursor: not-allowed;
}

.form-help {
    font-size: 0.8rem;
    color: #6b7280;
    margin-top: 5px;
    line-height: 1.4;
}

/* ====================
   DISCOVERY QUESTIONS - FIXED COLORS
   ==================== */

.discovery-question {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.discovery-question h3 {
    color: #f1f5f9;
    margin-bottom: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}

.question-text {
    color: #cbd5e1;
    font-style: italic;
    margin-bottom: 15px;
    line-height: 1.5;
    font-size: 0.95rem;
}

.discovery-question textarea {
    width: 100%;
    min-height: 100px;
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 6px;
    color: #f1f5f9;
    padding: 12px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}

.discovery-question textarea:focus {
    border-color: #3b82f6;
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ====================
   FORM NAVIGATION
   ==================== */

.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding: 20px 30px;
    border-top: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(15, 23, 42, 0.4);
}

.nav-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.3);
}

.btn-secondary:hover {
    background: rgba(148, 163, 184, 0.3);
    color: #cbd5e1;
    border-color: rgba(148, 163, 184, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: 1px solid #f59e0b;
    font-weight: 600;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: 1px solid #10b981;
    font-weight: 600;
}

.btn-success:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.btn-disabled {
    background: rgba(148, 163, 184, 0.2);
    color: #64748b;
    cursor: not-allowed;
}

.btn-disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ====================
   GENERATION STATUS AND ARTIFACTS - FIXED COLORS
   ==================== */

.generation-status {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.status-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border: 2px solid #3b82f6;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.status-text {
    color: #93c5fd;
    font-weight: 500;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.artifact-summary {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.artifact-summary h3 {
    color: #6ee7b7;
    margin-bottom: 15px;
    font-size: 1rem;
}

.artifact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.artifact-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 6px;
}

.artifact-icon {
    font-size: 1.2rem;
}

.artifact-name {
    flex: 1;
    color: #d1fae5;
    font-weight: 500;
}

.artifact-status {
    color: #6ee7b7;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.loading-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-style: italic;
}

/* ====================
   GENERATED CONFIG SECTIONS - FIXED COLORS
   ==================== */

.generated-config-sections {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.config-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.config-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.config-section h3 {
    color: #60a5fa;
    margin-bottom: 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.config-item {
    background: rgba(30, 41, 59, 0.4);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.config-item:last-child {
    margin-bottom: 0;
}

.config-item label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: #cbd5e1;
    margin-bottom: 6px;
}

.config-item input,
.config-item select,
.config-item textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    border-radius: 4px;
    font-size: 0.85rem;
    background: rgba(30, 41, 59, 0.5);
    color: #f1f5f9;
    box-sizing: border-box;
}

.config-item input:focus,
.config-item select:focus,
.config-item textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

/* ====================
   DYNAMIC FORM ITEMS
   ==================== */

.goal-item, 
.performance-target-item, 
.stakeholder-item, 
.actor-item {
    background: rgba(30, 41, 59, 0.4);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

.goal-header, 
.target-header, 
.stakeholder-header, 
.actor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.goal-header h4, 
.target-header h4, 
.stakeholder-header h4, 
.actor-header h4 {
    margin: 0;
    color: #f1f5f9;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ====================
   FORM VALIDATION
   ==================== */

.form-group input:required:invalid,
.form-group textarea:required:invalid,
.form-group select:required:invalid {
    border-color: rgba(239, 68, 68, 0.5);
}

.form-group input:required:valid,
.form-group textarea:required:valid,
.form-group select:required:valid {
    border-color: rgba(34, 197, 94, 0.5);
}

.validation-error {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 5px;
}

.validation-success {
    color: #22c55e;
    font-size: 0.8rem;
    margin-top: 5px;
}

/* ====================
   TOOLTIPS
   ==================== */

[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 1000;
    border: 1px solid rgba(148, 163, 184, 0.3);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 118%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(15, 23, 42, 0.95);
    z-index: 1000;
}

/* ====================
   RESPONSIVE DESIGN
   ==================== */

@media (max-width: 968px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .form-content {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 20px;
    }

    .discovery-question {
        padding: 15px;
    }

    .form-navigation {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }

    .nav-btn {
        width: 100%;
        justify-content: center;
    }

    .section-title {
        padding: 15px 20px;
        font-size: 1.2rem;
    }

    .section-description {
        padding: 10px 20px 0;
    }
}

@media (max-width: 480px) {
    .form-content {
        padding: 15px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .section-title {
        font-size: 1.1rem;
        padding: 12px 15px;
    }

    .form-navigation {
        padding: 12px 15px;
    }

    .nav-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
        /* Phase Status Styles */
    .phase-status-container {
        background: rgba(59, 130, 246, 0.1);
        border: 1px solid rgba(59, 130, 246, 0.3);
        border-radius: 8px;
        padding: 1rem;
        margin: 1rem 0;
    }

    .phase-sync-controls {
        display: flex;
        align-items: center;
        gap: 1rem;
        margin-bottom: 1rem;
    }

    .sync-button {
        background: rgba(59, 130, 246, 0.2);
        border: 1px solid #3b82f6;
        color: #60a5fa;
        padding: 0.5rem 1rem;
        border-radius: 4px;
        cursor: pointer;
        font-size: 0.875rem;
    }

    .sync-button:hover {
        background: rgba(59, 130, 246, 0.3);
    }

    .sync-button:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

    .sync-status {
        font-size: 0.75rem;
        color: #94a3b8;
    }

    .phase-status-badge {
        display: inline-block;
        padding: 0.25rem 0.75rem;
        border-radius: 4px;
        font-size: 0.875rem;
        font-weight: 600;
        margin-bottom: 1rem;
        background: rgba(59, 130, 246, 0.2);
        color: #60a5fa;
    }

    .phase-actions {
        margin-top: 1rem;
    }

    .btn {
        background: #3b82f6;
        color: white;
        border: none;
        padding: 0.5rem 1rem;
        border-radius: 4px;
        cursor: pointer;
    }

    .btn:hover {
        background: #2563eb;
    }
}