/* Custom styles for Auto Offer Web Application */

:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

/* Global styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f8f9fa;
    color: #212529;
}

/* Ensure all text is readable */
.text-dark {
    color: #212529 !important;
}

/* Fix any dark backgrounds */
.bg-dark {
    background-color: #f8f9fa !important;
    color: #212529 !important;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
}

.nav-link {
    font-weight: 500;
}

.nav-link.active {
    font-weight: 600;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.25rem;
}

.card-header h5 {
    color: #495057;
}

/* Status badges */
.badge {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Tables */
.table {
    background-color: white;
}

.table th {
    border-top: none;
    font-weight: 600;
    color: #495057;
    background-color: #f8f9fa;
}

.table td {
    background-color: white;
    color: #212529;
}

.table-hover tbody tr:hover {
    background-color: #f8f9fa !important;
}

.table-hover tbody tr:hover td {
    background-color: #f8f9fa !important;
}

/* Buttons */
.btn {
    font-weight: 500;
    border-radius: 0.375rem;
}

.btn-group .btn {
    border-radius: 0.375rem;
}

.btn-group .btn:not(:last-child) {
    margin-right: 0.25rem;
}

/* Forms */
.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Alert customizations */
.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Dashboard specific styles */
.stats-card {
    transition: transform 0.2s ease-in-out;
}

.stats-card:hover {
    transform: translateY(-2px);
}

/* Job status colors - improved visibility */
.status-created { background-color: #6c757d !important; color: white !important; }
.status-applied { background-color: #ffc107 !important; color: #000 !important; }
.status-in-progress { background-color: #0dcaf0 !important; color: #000 !important; }
.status-offer { background-color: #198754 !important; color: white !important; }
.status-rejected { background-color: #dc3545 !important; color: white !important; }
.status-skipped { background-color: #6f42c1 !important; color: white !important; } /* Changed from dark to purple */
.status-manual { background-color: #fd7e14 !important; color: white !important; }

/* Badge overrides for better visibility */
.badge.bg-dark {
    background-color: #6f42c1 !important; /* Purple instead of black */
    color: white !important;
}

/* Ensure all content is readable */
.table-responsive {
    background-color: white;
}

.card-body {
    background-color: white;
    color: #212529;
}

/* Fix any remaining dark text issues */
strong, .fw-bold {
    color: #212529 !important;
}

.text-muted {
    color: #6c757d !important;
}

/* Make sure links are visible */
a {
    color: #0d6efd;
}

a:hover {
    color: #0b5ed7;
    text-decoration: underline;
}

/* Fix company name links that use text-dark class */
a.text-dark {
    color: #0d6efd !important;
}

a.text-dark:hover {
    color: #0b5ed7 !important;
    text-decoration: underline;
}

/* Make company links in tables stand out */
.table a.text-decoration-none {
    color: #0d6efd !important;
}

.table a.text-decoration-none:hover {
    color: #0b5ed7 !important;
    text-decoration: underline;
}

/* Ensure strong tags inside links inherit link color */
a strong {
    color: inherit !important;
}

/* Timeline styles */
.timeline {
    position: relative;
    padding-left: 2rem;
}

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

.timeline-item {
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-marker {
    position: absolute;
    left: -1.25rem;
    top: 0.25rem;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 2px #dee2e6;
}

.timeline-content {
    background: white;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* Automation control styles */
.automation-controls {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 1rem;
    padding: 2rem;
}

.automation-controls .btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.automation-controls .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Profile management styles */
.profile-section {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 2rem;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 2rem;
    font-weight: bold;
}

/* File upload styles */
.file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 0.5rem;
    padding: 2rem;
    text-align: center;
    background: #f8f9fa;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(13, 110, 253, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(13, 110, 253, 0.1);
}

/* Progress bars */
.progress {
    height: 0.5rem;
    border-radius: 0.25rem;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        margin-right: 0;
        margin-bottom: 0.25rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

/* Force light mode for better readability */
@media (prefers-color-scheme: dark) {
    body {
        background-color: #f8f9fa !important;
        color: #212529 !important;
    }
    
    .card {
        background-color: white !important;
        color: #212529 !important;
    }
    
    .table {
        background-color: white !important;
        color: #212529 !important;
    }
}

/* Animation utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

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

.pulse {
    animation: pulse 2s infinite;
}

/* Success/Error states */
.success-state {
    color: var(--success-color);
}

.error-state {
    color: var(--danger-color);
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Footer */
footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
}

/* Print styles */
@media print {
    .navbar,
    .btn,
    footer {
        display: none !important;
    }
    
    .container {
        max-width: none !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
}

/* Text area improvements for better URL handling */
textarea.form-control {
    resize: vertical;
}

/* Textarea with alternating line backgrounds */
.textarea-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.line-backgrounds {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 1;
    border-radius: 0.375rem;
    overflow: hidden;
}

.textarea-with-stripes {
    position: relative;
    z-index: 2;
    background: transparent !important;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    line-height: 1.4;
}

.line-background {
    position: absolute;
    left: 0;
    right: 0;
    height: 1.4em;
}

.line-background:nth-child(even) {
    background-color: #f8f9fa;
}

.line-background:nth-child(odd) {
    background-color: transparent;
}

/* Specific styling for URL input textarea */
#job_urls {
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    line-height: 1.4;
}

/* Timeline Styles */
.timeline-container {
    position: relative;
}

.timeline-vertical {
    position: relative;
    padding-left: 30px;
}

.timeline-vertical::before {
    content: '';
    position: absolute;
    left: 15px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-color), var(--light-color));
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
    padding-left: 25px;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-marker {
    position: absolute;
    left: -20px;
    top: 0;
    width: 30px;
    height: 30px;
    background: white;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.timeline-content {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    position: relative;
    transition: all 0.3s ease;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 15px;
    border: 8px solid transparent;
    border-right-color: #e9ecef;
}

.timeline-content::after {
    content: '';
    position: absolute;
    left: -7px;
    top: 16px;
    border: 7px solid transparent;
    border-right-color: #f8f9fa;
}

.timeline-title {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-time {
    font-size: 0.875rem;
    color: #6c757d;
}

.timeline-metadata .badge {
    margin-bottom: 5px;
    margin-right: 5px;
}

/* Event type specific colors */
.timeline-item[data-event-type="analysis"] .timeline-marker {
    border-color: var(--info-color);
}

.timeline-item[data-event-type="resume"] .timeline-marker {
    border-color: var(--success-color);
}

.timeline-item[data-event-type="evaluation"] .timeline-marker {
    border-color: var(--warning-color);
}

.timeline-item[data-event-type="submission"] .timeline-marker {
    border-color: var(--danger-color);
}

.timeline-item[data-event-type="creation"] .timeline-marker {
    border-color: var(--primary-color);
}

.timeline-item[data-event-type="skip"] .timeline-marker {
    border-color: #6c757d;
}

/* Hover effects */
.timeline-item:hover .timeline-content {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateX(5px);
}

.timeline-item:hover .timeline-marker {
    transform: scale(1.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .timeline-vertical {
        padding-left: 20px;
    }
    
    .timeline-vertical::before {
        left: 10px;
    }
    
    .timeline-marker {
        left: -15px;
        width: 25px;
        height: 25px;
    }
    
    .timeline-content {
        padding: 12px;
    }
    
    .timeline-content::before {
        left: -6px;
        border-width: 6px;
    }
    
    .timeline-content::after {
        left: -5px;
        border-width: 5px;
    }
}