/* Thurtea-Ai - Components CSS */
/* UI Components: Buttons, Cards, Modals, Forms, Progress Bars, Stage Cards */

/* Context Panel */
.context-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.context-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-badge {
    background: var(--success-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Progress Bar */
.progress-container {
    margin-bottom: 40px;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.progress-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: var(--transition);
}

.progress-label.active {
    color: var(--primary-color);
}

.progress-track {
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.5s ease;
}

/* Stage Cards */
.stages-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.stage-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    border: 2px solid transparent;
    transition: var(--transition);
    opacity: 0.7;
}

.stage-card.active {
    opacity: 1;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.stage-card.complete {
    opacity: 0.9;
    border-color: var(--success-color);
}

.stage-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
}

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

.stage-title i {
    margin-right: 10px;
    color: var(--primary-color);
}

.stage-status {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.stage-status.in-progress {
    background: var(--info-color);
    color: white;
}

.stage-status.pending {
    background: var(--text-secondary);
    color: white;
}

.stage-status.complete {
    background: var(--success-color);
    color: white;
}

.stage-content {
    padding: 30px;
}

/* Input Section */
.input-section {
    display: grid;
    gap: 25px;
}

.requirement-tree {
    margin-bottom: 20px;
}

.requirement-node {
    background: #f8f9fa;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    transition: var(--transition);
}

.requirement-node.active {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.input-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.input-header label {
    font-weight: 600;
    color: var(--text-primary);
}

.tooltip-icon {
    position: relative;
    cursor: help;
}

.tooltip-text {
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--text-primary);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 1000;
    max-width: 250px;
    white-space: normal;
    text-align: center;
}

.tooltip-icon:hover .tooltip-text {
    opacity: 1;
    visibility: visible;
}

#crudeIdea {
    width: 100%;
    padding: 15px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    resize: vertical;
    transition: var(--transition);
    font-family: inherit;
}

#crudeIdea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Template Selector */
.template-selector {
    margin: 20px 0;
}

.template-selector label {
    display: block;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.template-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.template-btn {
    background: white;
    color: #333333;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px 20px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.template-btn:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
    transform: translateY(-2px);
}

.template-btn i {
    color: var(--primary-color);
}

/* File Input */
.file-input-container {
    margin: 20px 0;
}

#contextFiles {
    width: 100%;
    padding: 15px;
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    background: #f8f9fa;
    cursor: pointer;
    transition: var(--transition);
}

#contextFiles:hover {
    border-color: var(--primary-color);
    background: rgba(102, 126, 234, 0.05);
}

.file-preview {
    margin-top: 15px;
}

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

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    color: #333333;
    padding: 12px 15px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-name {
    font-weight: 500;
}

.file-size {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.file-remove {
    background: var(--error-color);
    color: white;
    border: none;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.file-remove:hover {
    background: #e53e3e;
}

/* LLM Config Panel */
.llm-config-panel {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
}

.llm-config-panel h4 {
    margin-bottom: 15px;
}

.confidence-meter {
    background: rgba(255, 255, 255, 0.2);
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    transition: width 0.5s ease;
}

.confidence-score {
    font-size: 0.875rem;
    opacity: 0.9;
}

/* Buttons */
.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 200px;
    justify-content: center;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

.btn.loading {
    position: relative;
    overflow: hidden;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

.btn-secondary {
    background: var(--text-secondary);
}

.btn-success {
    background: var(--success-color);
}

.btn-warning {
    background: var(--warning-color);
}

.btn-info {
    background: var(--info-color);
}

.btn-large {
    padding: 20px 40px;
    font-size: 1.1rem;
}

.btn.success {
    background-color: var(--success-color);
    border-color: var(--success-color);
}

.btn.error {
    background-color: var(--error-color);
    border-color: var(--error-color);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color);
    color: var(--primary-color);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

/* Output Sections */
.output-section {
    margin-top: 30px;
    background: #f8f9fa;
    color: #333333;
    border-radius: var(--border-radius);
    padding: 25px;
    border: 1px solid var(--border-color);
}

.requirements-display {
    line-height: 1.8;
}

.requirement-text {
    background: white;
    color: #333333;
    padding: 20px;
    border-radius: var(--border-radius);
    margin: 15px 0;
    border-left: 4px solid var(--primary-color);
    white-space: pre-line;
}

.component-list {
    list-style: none;
    margin: 15px 0;
}

.component-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.component-list i {
    color: var(--success-color);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 25px;
}

.metric-card {
    background: white;
    color: #333333;
    padding: 20px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.metric-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Code Display */
.code-editor {
    background: #1a202c;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin: 20px 0;
}

.code-editor-header {
    background: #2d3748;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.code-editor-title {
    font-weight: 600;
}

.code-editor-actions {
    display: flex;
    gap: 10px;
}

.code-editor-actions button {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.code-editor-actions button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.code-editor-content {
    display: flex;
    max-height: 400px;
    overflow: auto;
}

.line-numbers {
    background: #2d3748;
    color: #718096;
    padding: 20px 15px;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: right;
    user-select: none;
    min-width: 60px;
}

.code-content {
    flex: 1;
    padding: 20px;
}

.code-content pre {
    margin: 0;
    color: #e2e8f0;
    font-family: 'JetBrains Mono', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Validation */
.validation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.validation-card {
    background: white;
    color: #000000;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.validation-header {
    padding: 15px 20px;
    background: #f8f9fa;
    color: #000000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.validation-type {
    font-weight: 600;
    color: #000000;
}

.validation-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.validation-status.pass {
    background: var(--success-color);
    color: white;
}

.validation-status.warning {
    background: var(--warning-color);
    color: white;
}

.validation-status.fail {
    background: var(--error-color);
    color: white;
}

.validation-detail {
    padding: 20px;
    line-height: 1.6;
    color: #000000;
}

/* Human Intervention */
.human-intervention {
    background: linear-gradient(135deg, #ffeaa7, #fab1a0);
    border-radius: var(--border-radius);
    padding: 25px;
    margin: 20px 0;
    color: #2d3748;
}

.intervention-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.intervention-header h4 {
    margin: 0;
}

.intervention-status {
    background: rgba(255, 255, 255, 0.8);
    padding: 6px 15px;
    border-radius: 15px;
    font-size: 0.875rem;
    font-weight: 500;
}

.intervention-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.intervention-option {
    background: white;
    color: #333333;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 10px;
    border: 2px solid transparent;
}

.intervention-option:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Control Panel */
.control-panel {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 40px 0;
    flex-wrap: wrap;
}

/* Status Log */
.status-log {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    margin-top: 40px;
    overflow: hidden;
}

.status-log h3 {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 20px;
    margin: 0;
}

.log-content {
    max-height: 300px;
    overflow-y: auto;
    padding: 20px;
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-family: monospace;
}

.log-entry.info {
    color: var(--info-color);
}

.log-entry.success {
    color: var(--success-color);
}

.log-entry.warning {
    color: var(--warning-color);
}

.log-entry.error {
    color: var(--error-color);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    color: #333333;
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid var(--border-color);
    background: #f8f9fa;
}

.modal-header h3 {
    margin: 0;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: var(--transition);
}

.close:hover {
    color: var(--error-color);
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    margin-top: 20px;
}

/* Completion Celebration */
.completion-celebration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(10px);
}

.celebration-content {
    background: white;
    color: #333333;
    padding: 40px;
    border-radius: var(--border-radius);
    text-align: center;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: celebrationPop 0.5s ease-out;
}

@keyframes celebrationPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.celebration-content h2 {
    color: var(--success-color);
    margin-bottom: 15px;
}

.celebration-content p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out;
}

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

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* API Configuration Modal Styles */
.provider-status-bar {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 12px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 15px;
}

.provider-status-bar i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

.provider-label {
    font-weight: 500;
    color: var(--text-secondary);
}

.provider-display {
    margin-left: auto;
}

.provider-display .provider-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.provider-display strong {
    color: var(--text-primary);
}

.status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
}

.status.connected {
    background-color: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
}

.status.disconnected {
    background-color: rgba(160, 174, 192, 0.1);
    color: var(--text-secondary);
}

.provider-config {
    margin-bottom: 20px;
}

.provider-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    margin-bottom: 15px;
    transition: var(--transition);
}

.provider-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.api-key-config {
    margin-bottom: 20px;
}

.api-key-input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.api-key-input {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition);
}

.api-key-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.api-key-input:disabled {
    background: var(--bg-color);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.btn-toggle-key {
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.btn-toggle-key:hover {
    background: var(--bg-color);
    color: var(--text-primary);
}

.api-key-help {
    color: var(--text-secondary);
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.provider-status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.provider-status-item {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: var(--transition);
}

.provider-status-item:hover {
    box-shadow: var(--shadow-md);
}

.provider-name {
    font-weight: 600;
    color: var(--text-primary);
}

.provider-models {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.status-badge.connected {
    background-color: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
}

.status-badge.disconnected {
    background-color: rgba(160, 174, 192, 0.1);
    color: var(--text-secondary);
}

.status-badge.error {
    background-color: rgba(245, 101, 101, 0.1);
    color: var(--error-color);
}

.advanced-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.setting-item {
    display: flex;
    align-items: center;
    gap: 15px;
}

.setting-item label {
    min-width: 150px;
    font-weight: 500;
    color: var(--text-primary);
}

.slider {
    flex: 1;
    max-width: 200px;
}

.number-input {
    width: 100px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--card-bg);
    color: var(--text-primary);
}

.quick-setup {
    background: var(--bg-color);
    border-radius: var(--border-radius);
    padding: 20px;
}

/* Documentation Section */
.documentation {
    margin: 50px 0;
    padding: 40px 20px;
    background: rgba(45, 55, 72, 0.6);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.documentation h2 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 600;
}

.documentation h2 i {
    color: var(--primary-color);
    margin-right: 10px;
}

.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.doc-card {
    background: rgba(45, 55, 72, 0.8);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    padding: 30px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: var(--transition);
    backdrop-filter: blur(10px);
}

.doc-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
    background: rgba(45, 55, 72, 0.9);
}

.doc-card h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.doc-card h3 i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.doc-content {
    color: var(--text-secondary);
    line-height: 1.6;
}

.doc-content p {
    margin-bottom: 15px;
}

.doc-content ol, .doc-content ul {
    margin: 15px 0;
    padding-left: 20px;
}

.doc-content li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.doc-content code {
    background: rgba(102, 126, 234, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--primary-color);
}

.doc-content strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Mobile Navigation */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

.mobile-nav-items {
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
}

.mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px;
    text-decoration: none;
    color: var(--text-secondary);
    transition: var(--transition);
    border-radius: var(--border-radius);
    min-width: 60px;
}

.mobile-nav-item:hover {
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
}

.mobile-nav-item i {
    font-size: 1.2rem;
}

.mobile-nav-item span {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Help Overlay */
.help-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.help-overlay.show {
    display: flex;
}

.help-content {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.help-content h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
    text-align: center;
}

#helpContent {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* About Thurtea-Ai Section */
.about-section {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-color) 100%);
    border-top: 1px solid var(--border-color);
}

.about-section h2 {
    text-align: center;
    margin-bottom: 40px;
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 700;
}

.about-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.about-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.about-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.2);
}

.about-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--primary-color);
}

.about-icon {
    font-size: 3rem;
    color: var(--primary-color);
    background: rgba(102, 126, 234, 0.1);
    padding: 20px;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-header h3 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
}

.about-text {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 1.1rem;
}

.about-text p {
    margin-bottom: 20px;
}

.founder-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 30px 0;
    padding: 30px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.founder-details h4,
.mission-statement h4 {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.founder-details p {
    margin-bottom: 8px;
    color: var(--text-primary);
}

.founding-year {
    font-style: italic;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.mission-statement p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.copyright-notice {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.copyright-notice p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
}

/* Analytics Insights Display */
.analytics-insights {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: var(--border-radius);
    padding: 20px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
}

.analytics-insights h4 {
    color: var(--primary-color);
    margin: 0 0 15px 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analytics-insights .insight-item {
    margin: 8px 0;
    padding: 5px 0;
    color: var(--text-primary);
}

.analytics-insights .privacy-notice {
    text-align: right;
    margin-top: 15px;
    opacity: 0.7;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.analytics-insights .privacy-notice i {
    color: var(--success-color);
    margin-right: 5px;
}

/* Analytics Dashboard Cards */
.analytics-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.analytics-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 15px;
    text-align: center;
    transition: var(--transition);
}

.analytics-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.analytics-card .metric-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.analytics-card .metric-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.analytics-card .metric-icon {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* Analytics Settings in Config Modal */
.analytics-settings {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: rgba(255, 255, 255, 0.05);
}

.analytics-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
}

.toggle-switch {
    position: relative;
    width: 50px;
    height: 25px;
    background: var(--border-color);
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
}

.toggle-switch.active {
    background: var(--primary-color);
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 21px;
    height: 21px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle-switch.active::after {
    transform: translateX(25px);
}

/* Component Responsive Design */
@media (max-width: 768px) {
    .context-panel {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .control-panel {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .stage-content {
        padding: 20px;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .validation-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .intervention-options {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .stages-container {
        padding-bottom: 80px; /* Space for mobile nav */
    }
    
    .stage-card {
        margin-bottom: 20px;
    }
    
    .documentation {
        margin: 30px 0;
        padding: 30px 15px;
    }
    
    .doc-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .doc-card {
        padding: 20px;
    }
    
    .mobile-nav {
        display: block;
    }
    
    .provider-status-grid {
        grid-template-columns: 1fr;
    }
    
    .api-key-input-group {
        flex-direction: column;
    }
    
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .setting-item label {
        min-width: unset;
    }
    
    .setup-buttons {
        flex-direction: column;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .about-section {
        padding: 40px 0;
    }
    
    .about-section h2 {
        font-size: 2rem;
        margin-bottom: 30px;
    }
    
    .about-card {
        padding: 25px;
        margin: 0 10px;
    }
    
    .about-header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .about-header h3 {
        font-size: 1.5rem;
    }
    
    .about-icon {
        font-size: 2.5rem;
        width: 70px;
        height: 70px;
        padding: 15px;
    }
    
    .founder-info {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px;
    }
    
    .founder-details h4,
    .mission-statement h4 {
        font-size: 1.1rem;
    }
    
    .about-text {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .mobile-nav-item {
        padding: 8px;
        min-width: 50px;
    }
    
    .mobile-nav-item i {
        font-size: 1rem;
    }
    
    .mobile-nav-item span {
        font-size: 0.7rem;
    }
    
    .about-card {
        padding: 20px;
    }
    
    .founder-info {
        padding: 15px;
    }
    
    .about-section h2 {
        font-size: 1.8rem;
    }
}

/* ===============================
   ENHANCED NOTIFICATION SYSTEM
   ===============================*/

.error-notification,
.success-notification,
.warning-notification,
.info-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-bg);
    border-radius: 8px;
    padding: 16px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-width: 400px;
    min-width: 300px;
    animation: slideIn 0.3s ease-out;
    backdrop-filter: blur(10px);
}

.error-notification {
    border: 2px solid #e53e3e;
    background: rgba(229, 62, 62, 0.1);
}

.success-notification {
    border: 2px solid #38a169;
    background: rgba(56, 161, 105, 0.1);
}

.warning-notification {
    border: 2px solid #ed8936;
    background: rgba(237, 137, 54, 0.1);
}

.info-notification {
    border: 2px solid #4299e1;
    background: rgba(66, 153, 225, 0.1);
}

.error-content,
.success-content,
.warning-content,
.info-content {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
}

.error-content i {
    color: #e53e3e;
    font-size: 1.2rem;
}

.success-content i {
    color: #38a169;
    font-size: 1.2rem;
}

.warning-content i {
    color: #ed8936;
    font-size: 1.2rem;
}

.info-content i {
    color: #4299e1;
    font-size: 1.2rem;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    margin-left: auto;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

/* ===============================
   ENHANCED LOADING STATES
   ===============================*/

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.loading-overlay.visible {
    opacity: 1;
}

.loading-overlay.fade-out {
    opacity: 0;
}

.loading-content {
    background: var(--card-bg);
    padding: 32px;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    min-width: 200px;
}

.loading-content p {
    margin: 0;
    color: var(--text-primary);
    font-weight: 500;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.button-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

.inline-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    padding: 20px;
}

.inline-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-state {
    opacity: 0.7;
    pointer-events: none;
}

/* Skeleton Loading */
.skeleton-container {
    padding: 20px 0;
}

.skeleton-line {
    height: 16px;
    background: linear-gradient(90deg, var(--border-color) 25%, rgba(255, 255, 255, 0.1) 50%, var(--border-color) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 12px;
}

.skeleton-line:last-child {
    margin-bottom: 0;
    width: 60% !important;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

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

.form-field {
    position: relative;
    margin-bottom: 20px;
}

.form-field.error input,
.form-field.error textarea,
.form-field.error select {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1) !important;
    background-color: rgba(229, 62, 62, 0.05);
}

.form-field.success input,
.form-field.success textarea,
.form-field.success select {
    border-color: #38a169 !important;
    box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1) !important;
    background-color: rgba(56, 161, 105, 0.05);
}

.field-error {
    color: #e53e3e;
    font-size: 0.875rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: slideInDown 0.3s ease-out;
}

.field-success {
    color: #38a169;
    font-size: 0.875rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: slideInDown 0.3s ease-out;
}

.field-error i,
.field-success i {
    font-size: 0.875rem;
}

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

/* Enhanced Input Focus States */
input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
    transition: all 0.2s ease;
}

/* Enhanced Button Loading States */
.btn.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.btn.loading .button-spinner {
    margin-right: 8px;
}

/* Enhanced Progress Indicators */
.progress-fill {
    transition: width 0.5s ease;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    animation: progress-shine 2s infinite;
}

@keyframes progress-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 8px;
    text-align: center;
}

/* Enhanced Tooltips */
[title]:hover::after,
.tooltip:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    z-index: 1000;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    animation: tooltipFadeIn 0.2s ease-out;
}

@keyframes tooltipFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Enhanced Mobile Responsiveness */
@media (max-width: 768px) {
    .error-notification,
    .success-notification,
    .warning-notification,
    .info-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        min-width: auto;
    }
    
    .loading-content {
        padding: 24px;
        margin: 20px;
    }
    
    .form-field {
        margin-bottom: 16px;
    }
    
    .field-error,
    .field-success {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .error-notification,
    .success-notification,
    .warning-notification,
    .info-notification {
        top: 5px;
        right: 5px;
        left: 5px;
        padding: 12px;
    }
    
    .loading-content {
        padding: 20px;
        margin: 10px;
    }
    
    .spinner {
        width: 32px;
        height: 32px;
        border-width: 3px;
    }
}

/* Enhanced Focus Management */
.focus-trap {
    position: relative;
}

.focus-trap:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
    .spinner,
    .button-spinner,
    .inline-spinner,
    .skeleton-line,
    .progress-fill::after {
        animation: none;
    }
    
    .error-notification,
    .success-notification,
    .warning-notification,
    .info-notification,
    .loading-overlay {
        animation: none;
        transition: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .error-notification {
        border-color: #ff0000;
        background: rgba(255, 0, 0, 0.2);
    }
    
    .success-notification {
        border-color: #00ff00;
        background: rgba(0, 255, 0, 0.2);
    }
    
    .field-error {
        color: #ff0000;
    }
    
    .field-success {
        color: #00ff00;
    }
}

/* ===============================
   WORKFLOW & SETTINGS SECTIONS
   ===============================*/

.workflow-section,
.settings-section {
    margin: 50px 0;
    padding: 40px 20px;
    background: rgba(45, 55, 72, 0.6);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h2 {
    color: var(--text-primary);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.section-header h2 i {
    color: var(--primary-color);
    margin-right: 10px;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* Workflow Section */
.workflow-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.workflow-status,
.workflow-history {
    background: rgba(45, 55, 72, 0.8);
    border-radius: var(--border-radius);
    padding: 25px;
    border: 1px solid rgba(102, 126, 234, 0.2);
}

.workflow-status h3,
.workflow-history h3 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.workflow-progress-display {
    margin-bottom: 20px;
}

.progress-info {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 6px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.current-stage {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1rem;
}

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

.workflow-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.workflow-actions .btn {
    width: 100%;
    justify-content: flex-start;
}

.project-list {
    max-height: 200px;
    overflow-y: auto;
}

.no-projects {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Settings Section */
.settings-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}

.settings-group {
    background: rgba(45, 55, 72, 0.8);
    border-radius: var(--border-radius);
    padding: 25px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: var(--transition);
}

.settings-group:hover {
    border-color: var(--primary-color);
    background: rgba(45, 55, 72, 0.9);
}

.settings-group h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-group .btn {
    width: 100%;
    margin-bottom: 10px;
}

.settings-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Project List Items */
.project-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    margin-bottom: 8px;
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 6px;
    transition: var(--transition);
}

.project-item:hover {
    background: rgba(102, 126, 234, 0.15);
    border-color: var(--primary-color);
}

.project-info h4 {
    color: var(--text-primary);
    margin: 0 0 4px 0;
    font-size: 1rem;
}

.project-info p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.875rem;
}

.project-actions .btn {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.875rem;
    min-height: auto;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .workflow-section,
    .settings-section {
        margin: 30px 0;
        padding: 30px 15px;
    }
    
    .section-header h2 {
        font-size: 1.5rem;
    }
    
    .workflow-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .settings-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .workflow-actions {
        gap: 8px;
    }
    
    .progress-info {
        flex-direction: column;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .workflow-status,
    .workflow-history,
    .settings-group {
        padding: 20px 15px;
    }
    
    .section-header h2 {
        font-size: 1.3rem;
    }
    
    .section-header p {
        font-size: 1rem;
    }
}