/* AutoApply Styles */

.web-ui-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 80px);
}

.web-ui-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    border-radius: 12px;
    color: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.web-ui-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.web-ui-header p {
    font-size: 1.1rem;
    opacity: 0.95;
}

.web-ui-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

/* Left Panel */
.left-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.credentials-section,
.job-search-section,
.saved-jobs-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
}

.saved-jobs-section {
    max-height: 600px;
    display: flex;
    flex-direction: column;
}

.saved-jobs-section h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.saved-jobs-container {
    flex: 1;
    overflow-y: auto;
    margin-top: 1rem;
}

.saved-jobs-loading {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.saved-jobs-loading i {
    margin-right: 0.5rem;
    color: #14b8a6;
}

.saved-jobs-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.saved-job-card {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.saved-job-card:hover {
    border-color: #14b8a6;
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.15);
    transform: translateY(-2px);
}

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

.job-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #0f172a;
    margin: 0;
    flex: 1;
    line-height: 1.4;
}

.job-card-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    white-space: nowrap;
    margin-left: 1rem;
}

.job-card-status.status-bookmarked {
    background: #dbeafe;
    color: #1e40af;
}

.job-card-status.status-applying {
    background: #fef3c7;
    color: #92400e;
}

.job-card-status.status-applied {
    background: #d1fae5;
    color: #065f46;
}

.job-card-status.status-interviewing {
    background: #e0e7ff;
    color: #3730a3;
}

.job-card-status.status-negotiating {
    background: #fce7f3;
    color: #831843;
}

.job-card-status.status-accepted {
    background: #dcfce7;
    color: #14532d;
}

.job-card-body {
    margin-bottom: 1rem;
}

.job-card-body p {
    margin: 0.5rem 0;
    color: #475569;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.job-card-body i {
    color: #14b8a6;
    width: 16px;
}

.job-card-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-use-job {
    flex: 1;
    padding: 0.75rem 1rem;
    background: #14b8a6;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-use-job:hover {
    background: #0d9488;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(20, 184, 166, 0.3);
}

.btn-view-job {
    padding: 0.75rem 1rem;
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-view-job:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #0f172a;
}

.saved-jobs-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: #64748b;
}

.saved-jobs-empty i {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: 1rem;
}

.saved-jobs-empty p {
    margin: 1rem 0;
    font-size: 1.1rem;
}

.btn-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.75rem 1.5rem;
    background: #14b8a6;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-link:hover {
    background: #0d9488;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(20, 184, 166, 0.3);
}

.credentials-section h2,
.job-search-section h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-description {
    color: #64748b;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.credentials-form,
.job-search-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    color: #334155;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.form-group input:focus {
    outline: none;
    border-color: #14b8a6;
    background: white;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.1);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex: 1;
}

.btn-primary {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3);
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover:not(:disabled) {
    background: #e2e8f0;
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-primary:disabled,
.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.credentials-status {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.credentials-status.success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
    display: block;
}

.credentials-status.error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
    display: block;
}

/* Right Panel - Output Frame */
.right-panel {
    display: flex;
    flex-direction: column;
}

.output-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 250px);
    min-height: 600px;
}

.output-header {
    padding: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    border-radius: 12px 12px 0 0;
}

.output-header h2 {
    font-size: 1.5rem;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.output-controls {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    border: none;
    background: #f1f5f9;
    border-radius: 6px;
    cursor: pointer;
    color: #475569;
    transition: all 0.2s ease;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.output-frame {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    background: #0f172a;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.output-welcome {
    text-align: center;
    padding: 3rem 2rem;
    color: #94a3b8;
}

.output-welcome i {
    font-size: 4rem;
    color: #14b8a6;
    margin-bottom: 1rem;
}

.output-welcome h3 {
    color: #e2e8f0;
    margin-bottom: 1rem;
}

.welcome-steps {
    list-style: none;
    padding: 0;
    margin-top: 2rem;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.welcome-steps li {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(20, 184, 166, 0.1);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.welcome-steps li i {
    color: #14b8a6;
    font-size: 1rem;
}

/* Output Log Styles */
.output-log {
    margin-bottom: 0.5rem;
    padding: 0.75rem;
    border-radius: 6px;
    border-left: 3px solid;
    background: rgba(255, 255, 255, 0.05);
}

.output-log.info {
    border-left-color: #3b82f6;
    color: #93c5fd;
}

.output-log.success {
    border-left-color: #10b981;
    color: #6ee7b7;
}

.output-log.error {
    border-left-color: #ef4444;
    color: #fca5a5;
}

.output-log.warning {
    border-left-color: #f59e0b;
    color: #fcd34d;
}

.output-log-step {
    font-weight: 600;
    color: #14b8a6;
    margin-right: 0.5rem;
}

.output-log-time {
    color: #64748b;
    font-size: 0.85rem;
    margin-right: 0.5rem;
}

.output-status {
    padding: 1rem 1.5rem;
    border-top: 2px solid #e5e7eb;
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: 0 0 12px 12px;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #94a3b8;
    animation: pulse 2s infinite;
}

.status-indicator.active {
    background: #10b981;
}

.status-indicator.processing {
    background: #f59e0b;
}

.status-indicator.error {
    background: #ef4444;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

#statusText {
    color: #475569;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .web-ui-content {
        grid-template-columns: 1fr;
    }
    
    .output-section {
        height: 500px;
        min-height: 500px;
    }
}

@media (max-width: 768px) {
    .web-ui-container {
        padding: 1rem;
    }
    
    .web-ui-header h1 {
        font-size: 2rem;
    }
    
    .credentials-section,
    .job-search-section {
        padding: 1.5rem;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .output-section {
        height: 400px;
        min-height: 400px;
    }
}

/* Scrollbar Styling */
.output-frame::-webkit-scrollbar {
    width: 8px;
}

.output-frame::-webkit-scrollbar-track {
    background: #1e293b;
}

.output-frame::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.output-frame::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* WebUI Container Styles */
.webui-container {
    width: 100%;
    height: calc(100vh - 80px);
    margin-top: 20px;
    position: relative;
    padding: 0 2rem;
}

.webui-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f9f9f9;
    border-radius: 10px;
}

.webui-loading h2 {
    color: #20b2aa;
    margin: 10px 0;
}

.webui-loading p {
    color: #666;
    margin: 5px 0;
}

.webui-loading code {
    background: #f0f0f0;
    padding: 10px;
    border-radius: 5px;
    display: block;
    margin: 10px 0;
    font-family: 'Courier New', monospace;
}

#webuiFrame {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Show old UI */
#oldAutoApplyUI {
    display: block !important;
}

@media (max-width: 768px) {
    .webui-container {
        padding: 0 1rem;
        height: calc(100vh - 60px);
    }
}

