/* ActionFlow Frontend Styles */

:root {
    --actionflow-primary: #2563eb;
    --actionflow-primary-light: #dbeafe;
    --actionflow-secondary: #0ea5e9;
    --actionflow-sidebar-bg: #1e293b;
    --actionflow-sidebar-text: #e2e8f0;
    --actionflow-sidebar-hover: #334155;
    --actionflow-card-bg: #ffffff;
    --actionflow-border: #e2e8f0;
    --actionflow-text-primary: #1e293b;
    --actionflow-text-secondary: #64748b;
    --actionflow-light-bg: #f8fafc;
    --actionflow-success: #16a34a;
    --actionflow-warning: #f59e0b;
    --actionflow-error: #dc2626;
}

.actionflow-app {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--actionflow-light-bg);
    color: var(--actionflow-text-primary);
    line-height: 1.5;
    min-height: 600px;
}

.actionflow-container {
    display: flex;
    min-height: 600px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.actionflow-sidebar {
    width: 240px;
    background-color: var(--actionflow-sidebar-bg);
    color: var(--actionflow-sidebar-text);
    display: flex;
    flex-direction: column;
}

.actionflow-sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.actionflow-logo {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.actionflow-logo span {
    color: var(--actionflow-primary);
}

.actionflow-menu {
    padding: 12px 0;
}

.actionflow-menu-label {
    padding: 12px 20px 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255,255,255,0.5);
}

.actionflow-menu-item {
    padding: 10px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid transparent;
    text-decoration: none;
    color: var(--actionflow-sidebar-text);
}

.actionflow-menu-item:hover {
    background-color: var(--actionflow-sidebar-hover);
    color: white;
}

.actionflow-menu-item.active {
    background-color: rgba(37, 99, 235, 0.2);
    border-left: 3px solid var(--actionflow-primary);
    color: white;
}

.actionflow-menu-item i {
    margin-right: 12px;
    font-size: 18px;
    color: rgba(255,255,255,0.7);
}

.actionflow-main-content {
    flex: 1;
    padding: 24px;
    background-color: var(--actionflow-light-bg);
}

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

.actionflow-page-title {
    font-size: 24px;
    font-weight: 600;
}

.actionflow-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-weight: 500;
    cursor: pointer;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

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

.actionflow-btn-outline {
    border: 1px solid var(--actionflow-border);
    background-color: white;
    color: var(--actionflow-text-secondary);
}

.actionflow-card {
    background-color: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    border: 1px solid var(--actionflow-border);
    margin-bottom: 20px;
}

.actionflow-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    font-size: 16px;
    color: var(--actionflow-text-secondary);
}

/* Modal Styles */
.actionflow-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.actionflow-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.actionflow-modal {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.actionflow-modal-overlay.active .actionflow-modal {
    transform: scale(1);
}

.actionflow-modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--actionflow-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.actionflow-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--actionflow-text-primary);
}

.actionflow-modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--actionflow-text-secondary);
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.actionflow-modal-close:hover {
    background-color: var(--actionflow-light-bg);
}

.actionflow-modal-body {
    padding: 24px;
    overflow-y: auto;
}

.actionflow-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--actionflow-border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Form Styles */
.actionflow-form-section {
    margin-bottom: 24px;
}

.actionflow-form-section-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--actionflow-text-primary);
}

.actionflow-form-group {
    margin-bottom: 16px;
}

.actionflow-form-label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--actionflow-text-primary);
    font-weight: 500;
}

.actionflow-form-required {
    color: var(--actionflow-error);
    margin-left: 3px;
}

.actionflow-form-input,
.actionflow-form-select {
    width: 100%;
    height: 50px;
    padding: 12px 16px;
    border: 1px solid var(--actionflow-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--actionflow-text-primary);
    background-color: white;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.actionflow-form-textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px 16px;
    border: 1px solid var(--actionflow-border);
    border-radius: 6px;
    font-size: 14px;
    color: var(--actionflow-text-primary);
    background-color: white;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.2s, box-shadow 0.2s;
    resize: vertical;
}

.actionflow-form-input:focus,
.actionflow-form-select:focus,
.actionflow-form-textarea:focus {
    outline: none;
    border-color: var(--actionflow-primary);
    box-shadow: 0 0 0 2px var(--actionflow-primary-light);
}

.actionflow-form-hint {
    font-size: 12px;
    color: var(--actionflow-text-secondary);
    margin-top: 4px;
}

.actionflow-form-row {
    display: flex;
    gap: 16px;
}

.actionflow-form-col {
    flex: 1;
}

.actionflow-form-error {
    color: var(--actionflow-error);
    font-size: 12px;
    margin-top: 4px;
}

.actionflow-form-success {
    color: var(--actionflow-success);
    font-size: 12px;
    margin-top: 4px;
}

/* Loading and States */
.actionflow-btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.actionflow-btn.loading::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

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

/* Keywords Specific Styles */
.actionflow-header-actions {
    display: flex;
    gap: 12px;
}

.actionflow-notice {
    background: #e7f3ff;
    border: 1px solid #b3d9ff;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.actionflow-notice p {
    margin: 0;
    color: #0066cc;
}

.actionflow-progress-section {
    margin-bottom: 30px;
}

.actionflow-progress-section h3 {
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
}

.actionflow-progress-bar {
    background: #f0f0f0;
    border-radius: 10px;
    height: 20px;
    margin: 10px 0;
    overflow: hidden;
}

.actionflow-progress-fill {
    background: linear-gradient(90deg, #4CAF50, #45a049);
    height: 100%;
    border-radius: 10px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: var(--actionflow-text-secondary);
}

/* Table Styles */
.actionflow-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.actionflow-table th,
.actionflow-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--actionflow-border);
}

.actionflow-table th {
    background-color: #f8fafc;
    font-weight: 600;
    color: var(--actionflow-text-primary);
    font-size: 14px;
}

.actionflow-table tbody tr:hover {
    background-color: #f8fafc;
}

.actionflow-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
}

.actionflow-table th.sortable:hover {
    background-color: #e2e8f0;
}

.sorting-indicator {
    margin-left: 8px;
    opacity: 0.5;
}

.actionflow-table th.sortable.asc .sorting-indicator:before {
    content: '↑';
    opacity: 1;
}

.actionflow-table th.sortable.desc .sorting-indicator:before {
    content: '↓';
    opacity: 1;
}

/* Badge Styles */
.priority-badge,
.status-badge,
.difficulty-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

.priority-badge.priority-high {
    background-color: #fee2e2;
    color: #991b1b;
}

.priority-badge.priority-medium {
    background-color: #fef3c7;
    color: #92400e;
}

.priority-badge.priority-low {
    background-color: #d1fae5;
    color: #065f46;
}

.difficulty-badge.difficulty-easy {
    background-color: #dcfce7;
    color: #166534;
}

.difficulty-badge.difficulty-medium {
    background-color: #fef3c7;
    color: #92400e;
}

.difficulty-badge.difficulty-hard {
    background-color: #fed7aa;
    color: #c2410c;
}

.difficulty-badge.difficulty-very-hard {
    background-color: #fecaca;
    color: #dc2626;
}

.status-badge.status-not_started {
    background-color: #f3f4f6;
    color: #374151;
}

.status-badge.status-researching {
    background-color: #dbeafe;
    color: #1e40af;
}

.status-badge.status-completed {
    background-color: #d1fae5;
    color: #065f46;
}

/* Button Variants */
.actionflow-btn-small {
    padding: 6px 12px;
    font-size: 12px;
}

.actionflow-btn-danger {
    background-color: #dc2626;
    color: white;
    border-color: #dc2626;
}

.actionflow-btn-danger:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
}

/* Empty State */
#empty-state {
    text-align: center;
    padding: 40px;
    color: var(--actionflow-text-secondary);
}

#empty-state h3 {
    margin-bottom: 8px;
    color: var(--actionflow-text-primary);
}

#empty-state p {
    margin-bottom: 20px;
}

/* Loading State */
#loading-state {
    text-align: center;
    padding: 40px;
    color: var(--actionflow-text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .actionflow-container {
        flex-direction: column;
    }
    
    .actionflow-sidebar {
        width: 100%;
        min-height: auto;
    }
    
    .actionflow-main-content {
        padding: 16px;
    }
    
    .actionflow-modal {
        max-width: 95%;
        margin: 20px;
    }
    
    .actionflow-form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .actionflow-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .actionflow-header-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .actionflow-table {
        font-size: 14px;
    }
    
    .actionflow-table th,
    .actionflow-table td {
        padding: 8px 12px;
    }
}