/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif; /* Modern font */
    background: linear-gradient(135deg, #440b8d 0%, #c3cfe2 100%); /* Softer, modern gradient */
    background-attachment: fixed; /* keep gradient consistent during scroll */
    min-height: 100vh;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: #ffffff; /* Solid white background */
    border-radius: 20px; /* More rounded corners */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1); /* Softer, larger shadow */
    max-width: 900px; /* Adjusted max-width for better content flow */
    width: 100%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px; /* Consistent spacing */
}

.header {
    text-align: center;
    color: #2c3e50; /* Consistent dark color for header text */
    margin-bottom: 15px;
}

.header-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px; /* Space between logo and text */
    margin-bottom: 10px;
}

.header-logo {
    height: 40px; /* Adjust as needed */
    width: auto;
}

.header h1 {
    font-size: 2.8rem;
    color: #2c3e50; /* Stronger heading color */
    font-weight: 700;
}

.header p {
    font-size: 1.1rem;
    color: #666; /* Slightly lighter grey for sub-text */
}

/* Buttons */
.start-button, .send-button {
    background: #633bcf; /* Violet theme */
    color: white;
    border: none;
    padding: 14px 30px; /* Slightly larger padding */
    border-radius: 10px; /* More rounded corners */
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease; /* Add box-shadow to transition */
    box-shadow: 0 6px 15px rgba(99, 59, 207, 0.452); /* Violet shadow */
}

.start-button:hover, .send-button:hover {
    background-color: #4C2D99; /* Darker violet for hover */
    transform: translateY(-3px); /* More pronounced lift */
    box-shadow: 0 9px 20px rgba(99, 59, 207, 0.6); /* Enhanced violet shadow on hover */
}

/* Workflow Section */
.workflow-section {
    background: #ffffff; /* Clean white background */
    border-radius: 15px; /* Slightly more rounded */
    padding: 30px; /* Increased padding */
    box-shadow: 0 8px 20px rgba(0,0,0,0.08); /* Softer, more visible shadow */
    border: none; /* Remove border */
}

.workflow-section h2 {
    margin-bottom: 25px; /* More space below heading */
    color: #2c3e50; /* Darker heading color */
    font-size: 2rem; /* Larger heading */
    text-align: center;
}

.workflow-input textarea {
    width: 100%;
    min-height: 140px; /* Slightly taller */
    padding: 18px; /* More padding */
    border: 1px solid #ddd; /* Lighter border */
    border-radius: 10px; /* More rounded corners */
    resize: vertical;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 20px; /* More space below textarea */
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05); /* Softer inset shadow */
}

/* Workflow Visualization */
.workflow-visualization {
    position: relative;
    margin: 40px 0;
    padding: 20px 0;
}

.workflow-line {
    position: absolute;
    top: 25px; /* Adjusted further to perfectly center with 50px dots */
    left: 5%;
    width: 90%;
    height: 6px; /* Thicker line */
    background-color: #e0e6ed; /* Lighter, modern grey */
    z-index: 1;
    border-radius: 3px; /* Removed translateY as top is now absolute */
}

.workflow-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    flex: 1; /* Distribute space evenly */
}

.step-dot-inner {
    width: 50px; /* Larger dots */
    height: 50px;
    border-radius: 50%;
    background-color: #cccccc; /* Lighter neutral grey */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    border: 4px solid #f0f0f0; /* Lighter border */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1); /* Softer shadow */
    position: relative; /* Needed for z-index to work */
    z-index: 2; /* Ensure dots are above the line */
}

.step-dot.completed .step-dot-inner {
    background-color: #28a745; /* Slightly darker green for completed */
}

.step-dot.running .step-dot-inner {
    background-color: #ffc107; /* Brighter orange for running */
    color: #333; /* Darker text for contrast */
    animation: pulse 1.5s infinite alternate; /* Pulsing animation */
}

@keyframes pulse {
    from { transform: scale(1); box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
    to { transform: scale(1.1); box-shadow: 0 6px 16px rgba(0,0,0,0.2); }
}

.step-dot.current .step-dot-inner {
    background-color: #007bff; /* Bootstrap primary blue */
    transform: scale(1.15); /* Slightly larger for current */
}

.step-dot.failed .step-dot-inner {
    background-color: #dc3545; /* Bootstrap danger red */
}

.step-label {
    font-size: 0.9rem; /* Slightly larger font */
    text-align: center;
    width: 110px; /* Slightly wider labels */
    margin-top: 8px; /* More space above label */
    color: #444; /* Darker text for better readability */
    font-weight: 500;
}

/* Step Details */
.step-details {
    background: #ffffff;
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
    border: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.step-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f2f5; /* Lighter border */
}

.step-info h3 {
    color: #2c3e50;
    font-size: 1.8rem;
}

.step-status-indicator {
    padding: 10px 18px;
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.status-pending {
    background-color: #e9ecef; /* Lighter grey */
    color: #6c757d;
}

.status-running {
    background-color: #fffbe6; /* Softer yellow */
    color: #a07f00;
}

.status-completed {
    background-color: #d4edda; /* Standard green */
    color: #155724;
}

.status-failed {
    background-color: #f8d7da; /* Standard red */
    color: #721c24;
}

.step-content {
    display: flex;
    gap: 30px; /* More space between input/output */
}

.step-input, .step-output {
    flex: 1;
}

.step-input h4, .step-output h4 {
    color: #444;
    margin-bottom: 12px;
    font-size: 1.2rem;
}

.step-input-content, .step-output-content {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    font-size: 1rem;
    max-height: 280px; /* Taller */
    overflow-y: auto;
    white-space: pre-wrap;
    border: 1px solid #e0e6ed; /* Lighter border */
    line-height: 1.7;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.step-output-content {
    background: #eafaf1; /* Softer green */
}

/* Workflow Logs */
.workflow-logs {
    background: #ffffff;
    border-radius: 15px;
    padding: 25px;
    margin-top: 30px;
    max-height: 300px; /* Taller logs section */
    overflow-y: auto;
    border: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.workflow-logs h4 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.6rem;
}

.logs-content {
    font-family: 'Roboto Mono', monospace; /* Monospace font for logs */
    font-size: 0.9rem; /* Slightly larger log font */
    white-space: pre-wrap;
    color: #555;
}

.log-entry {
    margin-bottom: 10px;
    padding: 10px;
    border-radius: 8px;
    background: #f8f9fa;
    border-left: 5px solid #e0e6ed; /* Softer border */
}

/* Final Proposal and similar sections */
.final-proposal,
.job-description-display,
.qa-output-display {
    margin-top: 30px;
    padding: 35px;
    background: #ffffff;
    border-radius: 15px;
    border: none;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.final-proposal h3,
.job-description-display h3,
.qa-output-display h3 {
    color: #2c3e50;
    font-size: 2rem;
    margin-bottom: 25px;
    text-align: center;
}

.proposal-content {
    white-space: pre-wrap;
    line-height: 1.8; /* Increased line height for readability */
    margin-bottom: 25px;
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #e0e6ed;
    font-size: 1.05rem;
    color: #333;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}

.error-message {
    background: #ffe6e6; /* Softer red */
    color: #cc0000; /* Darker red text */
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid #ffcccc;
    font-weight: 500;
}

/* Historical Navigation */
.historical-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding: 20px;
    background: #ffffff;
    border-radius: 15px;
    border: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.historical-navigation button {
    flex: 1;
    margin: 0 8px;
    padding: 12px 20px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    background: #633bcf;
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(99, 59, 207, 0.2);
}

.historical-navigation button:disabled {
    background-color: #e0e0e0;
    color: #999;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Sidebar Styles */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.sidebar {
    position: fixed;
    top: 0;
    right: -350px; /* Hidden by default */
    width: 300px;
    height: 100%;
    background-color: #ffffff; /* Clean white background */
    box-shadow: -8px 0 20px rgba(0, 0, 0, 0.15); /* Softer, more pronounced shadow */
    z-index: 1000;
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px; /* More padding */
    background-color: #f8f9fa; /* Lighter header background */
    border-bottom: 1px solid #e0e6ed; /* Softer border */
}

.sidebar-header h2 {
    margin: 0;
    font-size: 1.6rem; /* Slightly larger heading */
    color: #2c3e50;
}

.logout-sidebar {
    background: #dc3545; /* Bootstrap danger red */
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.2);
}

.logout-sidebar:hover {
    background-color: #c82333;
}

.close-sidebar {
    background: none;
    border: none;
    font-size: 2.2rem; /* Larger close button */
    cursor: pointer;
    color: #6c757d;
    transition: color 0.2s;
}

.close-sidebar:hover {
    color: #343a40;
}

.history-list {
    flex-grow: 1;
    padding: 25px; /* More padding */
    overflow-y: auto;
}

.history-item {
    background: #f8f9fa; /* Lighter background for items */
    border: 1px solid #e0e6ed; /* Softer border */
    border-radius: 10px; /* More rounded corners */
    padding: 18px; /* More padding */
    margin-bottom: 12px; /* More space between items */
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05); /* Softer shadow */
}

.history-item:hover {
    transform: translateY(-3px); /* More pronounced lift */
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1); /* Enhanced shadow on hover */
}

.history-item h5 {
    margin-top: 0;
    margin-bottom: 10px; /* More space below heading */
    color: #34495e;
    font-size: 1.15rem;
}

.history-item p {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 8px;
}

.history-item span {
    font-size: 0.85rem;
    color: #999;
}

/* Hamburger Menu */
.hamburger-menu {
    background: none;
    border: none;
    font-size: 2.2rem; /* Slightly larger */
    cursor: pointer;
    color: #2c3e50; /* Darker color for visibility */
    position: absolute;
    right: 25px; /* Position it to the right */
    top: 25px; /* Position it to the top */
    transform: none; /* Remove vertical centering transform */
    z-index: 1001; /* Ensure it's above other content */
    padding: 8px; /* More padding */
    border-radius: 8px; /* More rounded */
    transition: background-color 0.2s;
}

.hamburger-menu:hover {
    background-color: rgba(0, 0, 0, 0.08); /* Slightly darker hover */
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    body {
        padding: 15px;
    }

    .container {
        padding: 20px;
    }
    
    .header {
        padding-right: 60px; /* Make space for hamburger menu */
        padding-left: 60px; /* Balance padding on left */
    }

    .header h1 {
        font-size: 2.2rem;
    }

    .workflow-steps {
        flex-wrap: wrap; /* Allow steps to wrap on smaller screens */
        justify-content: center;
        gap: 15px;
    }

    .step-dot {
        flex: none; /* Remove flex-grow */
        width: 30%; /* Adjust width for smaller screens */
    }

    .step-label {
        width: auto;
        font-size: 0.75rem;
    }

    .step-content {
        flex-direction: column; /* Stack input/output vertically */
        gap: 20px;
    }

    .step-input-content, .step-output-content {
        max-height: 180px;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }

    .start-button, .send-button {
        font-size: 1rem;
        padding: 10px 20px;
    }

    .step-dot-inner {
        width: 40px;
        height: 40px;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .workflow-section h2, .final-proposal h3, .workflow-logs h4 {
        font-size: 1.5rem;
    }
}

/* Auth Section */
.auth-section {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.auth-section input[type="password"] {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    width: 200px;
}

/* Content Display Sections */
.job-description-content,
.proposal-content,
.qa-output-content {
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-top: 15px;
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    white-space: pre-wrap; /* Preserve formatting */
    word-wrap: break-word;
}



.job-description-content p,
.proposal-content p,
.qa-output-content p {
    margin-bottom: 15px;
}

.job-description-content ul,
.proposal-content ul,
.qa-output-content ul {
    margin-bottom: 15px;
    padding-left: 30px;
}

.job-description-content ol,
.proposal-content ol,
.qa-output-content ol {
    margin-bottom: 15px;
    padding-left: 30px;
}

.job-description-content li,
.proposal-content li,
.qa-output-content li {
    margin-bottom: 8px;
}

.job-description-content h4,
.proposal-content h4,
.qa-output-content h4 {
    color: #3498db;
    margin: 20px 0 10px 0;
    font-size: 1.2rem;
}

.job-description-content strong,
.proposal-content strong,
.qa-output-content strong {
    color: #2c3e50;
}

.auth-section button {
    background: #633bcf; /* Violet theme */
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.3s ease;
    box-shadow: 0 4px 10px rgba(99, 59, 207, 0.2);
}

.auth-section button:hover {
    background-color: #4C2D99; /* Darker violet for hover */
    box-shadow: 0 6px 15px rgba(99, 59, 207, 0.4);
}

.auth-section #user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header #user-info {
    margin-left: auto; /* Pushes it to the right */
    padding-right: 10px;
}

.sidebar-header #user-info span {
    font-weight: 600;
    color: #2c3e50;
}

/* Tabs for Final Proposal / Job Description / QA */
.content-tabs {
    margin-top: 30px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border: none;
}

.content-tabs .tab-headers {
    display: flex;
    gap: 24px;
    padding: 0 20px;
    border-bottom: 2px solid #e5e7eb; /* stronger baseline */
}

.content-tabs .tab-button {
    background: transparent;
    color: #6b7280; /* muted */
    border: none;
    padding: 14px 6px; /* taller click area */
    border-radius: 0;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s ease, border-color 0.2s ease;
    border-bottom: 3px solid transparent; /* indicator */
}

.content-tabs .tab-button:hover {
    color: #374151; /* darker on hover */
}

.content-tabs .tab-button.active {
    color: #633bcf;
    border-bottom-color: #633bcf;
}

.content-tabs .tab-panels {
    padding: 20px;
}

.content-tabs .tab-panel {
    display: none;
}

.content-tabs .tab-panel.active {
    display: block;
}
