:root {
    --primary-color: #2563eb;
    --secondary-color: #1e40af;
    --success-color: #059669;
    --error-color: #dc2626;
    --background-color: #f8fafc;
    --text-color: #1f2937;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.main-header {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.header-titles {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.logo {
    max-width: 150px;
    height: auto;
}

.title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0;
    line-height: 1.2;
}

.subtitle {
    font-size: 1rem;
    color: #6b7280;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0;
}

.user-email {
    color: #4b5563;
    font-size: 0.9rem;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.btn-secondary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-sm {
    padding: 0.75rem 1.5rem;
    font-size: 0.875rem;
    max-height: 44px !important;
}

.report-btn {
    margin: 1px 10px;
}

.report-list {
    padding-left: 5px;
}

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

.right {
    align-items: end;
    flex-direction: row;
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
}
.modal[aria-hidden="true"] {
    display: none;
}
.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.4);
}
.modal-dialog {
    position: relative;
    max-width: 520px;
    margin: 10vh auto;
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    outline: none;
}
.modal-title {
    margin: 0 0 10px;
}
.modal-text {
    margin: 0 0 16px;
}
.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.upload-container {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    margin-bottom: 2rem;
}

.upload-area {
    border: 2px dashed #e5e7eb;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover, .upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #f0f9ff;
}

.upload-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.file-input {
    display: none;
}

.upload-text {
    margin-bottom: 1rem;
    color: #6b7280;
}

.selected-files {
    margin-top: 1rem;
    display: none;
}

.selected-file-item {
    padding: 0.75rem;
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.result-summary {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.result-details {
    margin-bottom: 2rem;
}

.result-details h2 {
    margin-bottom: 1rem;
}

.result-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    border-left: 4px solid transparent;
}

.result-card.success {
    border-left-color: var(--success-color);
}

.result-card.error {
    border-left-color: var(--error-color);
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.result-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.label {
    font-weight: 500;
    color: #4b5563;
}

.value {
    color: #1f2937;
    word-break: break-all;
}

.result-value {
    color: var(--text-color);
    word-break: break-all;
}

.result-value a {
    color: var(--primary-color);
    text-decoration: none;
}

.result-value a:hover {
    text-decoration: underline;
}

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

.loading-spinner {
    display: none;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.progress-bar {
    height: 6px;
    background-color: #e5e7eb;
    border-radius: 3px;
    margin: 1.5rem 0;
    overflow: hidden;
    display: none;
    position: relative;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
    position: relative;
}

.progress-bar-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0) 0%,
        rgba(255,255,255,0.3) 50%,
        rgba(255,255,255,0) 100%
    );
    animation: shimmer 1.5s infinite;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    gap: 0.5rem;
    min-width: 100px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    margin-top: 1rem;
}

.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .title {
        font-size: 2rem;
    }
    
    .upload-container {
        padding: 1.5rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
}

.pipeline-details {
    margin-top: 2rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
}

.summary-card {
    display: flex;
    justify-content: space-between;
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.summary-item {
    text-align: center;
}

.summary-item .label {
    display: block;
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 0.5rem;
}

.summary-item .value {
    font-size: 1.5rem;
    font-weight: bold;
    color: #212529;
}

.pipeline-card {
    background-color: white;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pipeline-card.success {
    border-left: 4px solid #28a745;
}

.pipeline-card.error {
    border-left: 4px solid #dc3545;
}

.pipeline-item {
    margin: 0.5rem 0;
}

.pipeline-item .label {
    font-weight: 600;
    color: #495057;
    margin-right: 0.5rem;
}

.pipeline-item .value {
    color: #212529;
}

/* Flash messages */
.flash-messages {
    margin: 1rem 0;
}

.flash-message {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.flash-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.flash-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.flash-message.info {
    background-color: #cce5ff;
    border: 1px solid #b8daff;
    color: #004085;
}

.status-inprogress, .status-pending {
    color: #0d6efd;
    font-weight: 600;
}

.status-success {
    color: #198754;
    font-weight: 600;
}

.status-failed, .status-error {
    color: #dc3545;
    font-weight: 600;
}

.command-output, .command-error, .command-line {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    font-family: monospace;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0.5rem 0;
    max-height: 200px;
    overflow-y: auto;
}

.command-error {
    background: #fff5f5;
    color: #dc3545;
}

.command-line {
    background: #2d3748;
    color: #fff;
    padding: 1rem;
    user-select: all;
    cursor: pointer;
}

.check-status {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.check-status h4 {
    margin: 0 0 1rem 0;
    color: #2d3748;
}

.help-text {
    margin-top: 0.5rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.login-container {
    max-width: 400px;
    margin: 2rem auto;
    padding: 2rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 1rem;
    width: 100%;
    flex-wrap: wrap;
    display: flex;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

#new-project-name {
    text-transform: uppercase;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-info {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

.client-selector {
    margin-bottom: 20px;
    width: 100%;
}

.client-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

.client-selector select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
}

.client-selector select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* Insights Styles */
.insights-container {
    max-width: 800px;
    margin: 0 auto;
}

.insight-form {
    background: white;
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

.insight-form .form-group {
    margin-bottom: 2rem;
}

.insight-form label {
    display: block;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.insight-form input[type="text"],
.insight-form input[type="url"],
.insight-form input[type="date"],
.insight-form select,
.insight-form textarea {
    width: 100%;
    padding: 0.875rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: #f9fafb;
}

.insight-form input[type="text"]:focus,
.insight-form input[type="url"]:focus,
.insight-form input[type="date"]:focus,
.insight-form select:focus,
.insight-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.insight-form textarea {
    min-height: 150px;
    resize: vertical;
}

.insight-form .link-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.insight-form .add-link-btn {
    align-self: flex-start;
    background: none;
    border: 2px dashed #e5e7eb;
    padding: 0.75rem 1.5rem;
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.insight-form .add-link-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f0f9ff;
}

.insight-form .form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
}

.insight-form .btn {
    min-width: 150px;
}

.header-nav {
    display: flex;
    gap: 1rem;
}

.nav-link {
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    justify-content: center;
    align-items: center;
    text-align: center;
    display: flex;
}

.nav-link:hover {
    background: #f3f4f6;
    color: var(--text-color);
}

.nav-link.active {
    background: #f3f4f6;
    color: var(--primary-color);
    font-weight: 600;
}

/* Insights List Styles */
.insights-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.insights-header h2 {
    margin: 0;
    color: var(--text-color);
    font-size: 1.5rem;
}

.insights-list {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

.insight-card {
    background: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    border: 1px solid #e5e7eb;
}

.insight-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

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

.insight-actions {
    display: flex;
    gap: 0.5rem;
}

.insight-meta {
    display: flex;
    gap: 1rem;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.insight-meta .date,
.insight-meta .client {
    display: inline-flex;
    align-items: center;
}

.insight-meta .date::before {
    content: '📅';
    margin-right: 0.25rem;
}

.insight-meta .client::before {
    content: '🏢';
    margin-right: 0.25rem;
}

.insight-content {
    color: #374151;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.insight-links {
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
    margin-top: 1rem;
}

.insight-links h4 {
    color: var(--text-color);
    font-size: 0.875rem;
    margin: 0 0 0.5rem 0;
}

.insight-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.insight-links li {
    margin-bottom: 0.5rem;
}

.insight-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
}

.insight-links a::before {
    content: '🔗';
    margin-right: 0.5rem;
}

.insight-links a:hover {
    text-decoration: underline;
}

.no-insights {
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 0.75rem;
    color: #6b7280;
}

.btn-danger {
    background-color: #dc2626;
    color: white;
    border-width: 1px;
    border-color: #dc3d3d;
}

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

.text-warning {
    color: #f59e0b;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* Execution Status Styles */
.execution-output,
.execution-error {
    margin-top: 20px;
    padding: 20px;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.execution-error {
    background-color: #fff5f5;
}

#execution-status {
    font-weight: 600;
}

#execution-status.RUNNING {
    color: #3498db;
}

#execution-status.SUCCEEDED {
    color: #2ecc71;
}

#execution-status.FAILED,
#execution-status.TIMED_OUT,
#execution-status.ABORTED {
    color: #e74c3c;
}

.command-output,
.command-error {
    margin: 10px 0;
    padding: 15px;
    border-radius: 4px;
    background-color: #f1f3f5;
    font-family: monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.command-error {
    background-color: #ffe5e5;
    color: #c0392b;
}

/* Execution History Timeline */
.execution-history {
    margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #e5e7eb;
}

.timeline-event {
    position: relative;
    margin-left: 20px;
    padding: 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.timeline-event::before {
    content: '';
    position: absolute;
    left: -25px;
    top: 50%;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #3498db;
    transform: translateY(-50%);
}

.event-time {
    font-size: 0.875rem;
    color: #6b7280;
    margin-bottom: 0.5rem;
}

.event-type {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.event-state {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #f3f4f6;
    border-radius: 9999px;
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.event-error {
    background: #fee2e2;
    padding: 0.75rem;
    border-radius: 4px;
    color: #991b1b;
    margin-top: 0.5rem;
}

.event-output {
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.event-output pre {
    margin: 0;
    font-size: 0.875rem;
    white-space: pre-wrap;
}

/* Status Colors */
.status-running {
    color: #3498db !important;
}

.status-succeeded {
    color: #2ecc71 !important;
}

.status-failed,
.status-timed_out,
.status-aborted {
    color: #e74c3c !important;
}

/* Input/Output Sections */
.execution-input,
.execution-output,
.execution-error {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.execution-input h3,
.execution-output h3,
.execution-error h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: #1f2937;
    font-size: 1.125rem;
}

.config-section {
    /* margin-top: 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 8px; */
    /* box-shadow: 0 2px 4px rgba(0,0,0,0.1); */
    width: 100%;
    display: flex;
    flex-direction: column;
}

.config-title {
    margin-top: 0px;
    margin-bottom: 1rem;
    color: #1f2937;
}

.config-files-list {
    display: flex;
    flex-direction: column;
}

.config-list-item {
    margin: 10px 0px;
    display: flex;
    flex-direction: column;
}

.config-list-item-content {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
}

.sep-line {
    width: 100%;
    height: 1px;
    background-color: #e5e7eb;
    margin: 10px 0px;
}

.config-textarea {
    min-height: 150px;
    resize: vertical;
    overflow: scroll;
    width: 90%;
    font-size: large;
    line-height: 20px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
}

.config-nav-actions {
    margin: 10px 0px;
}

.tabs {
    display: flex;
    flex-direction: row;
    justify-content: start;
    flex-wrap: wrap;
    margin: 10px 0px;
}

.tab-btn {
    background: #ffffff;
    color: #374151;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    text-transform: capitalize;
    transition: all 0.2s ease;
    margin: 0px 5px;
}

.tab-btn:hover {
    background: #bcbdc1;
    color: #1f2937;
}

.tab-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.active {
    background: #bcbdc1;
    color: #1f2937;
    cursor: default;
}

.config-label-container {
    margin: 20px 0px 0px;
    display: flex;
}

.config-label {
    font-size: 1.25rem;
    margin: 20px 0px 0px;
    font-weight: bold;
}

.config-nav-actions {
    display: flex;
    flex-direction: row;
    justify-content: start;
    align-items: end;
    margin: 10px 0px;
}

.new-network-container {
    display: flex;
    margin-right: 10px;
    width: 250px;
    flex-direction: column;
}

.new-network-label {
    font-size: 1rem;
    font-weight: bold;
}

.new-network-input {
    /* width: 100%; */
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.card {
    background-color: #ffffff;              /* bg-white */
    border-radius: 0.75rem;                  /* rounded-xl */
    padding: 1.5rem;                         /* p-6 */
    box-shadow: 
        0 1px 2px rgba(0, 0, 0, 0.05),          /* shadow-sm */
        0 4px 6px rgba(0, 0, 0, 0.05);          /* shadow */
    border: 1px solid rgba(0, 0, 0, 0.05);   /* border border-gray-200 */
    transition: 
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}
