/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0077b5 0%, #004182 100%);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    text-align: center;
}

.login-card h1 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    color: #0077b5;
}

.login-card .subtitle {
    color: #666;
    margin-bottom: 30px;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #444;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: #0077b5;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    width: 100%;
    background: #0077b5;
    color: white;
}

.btn-primary:hover {
    background: #005885;
}

.btn-secondary {
    background: #e1e5eb;
    color: #333;
}

.btn-secondary:hover {
    background: #d1d5db;
}

.btn-success {
    background: #10b981;
    color: white;
}

.btn-success:hover {
    background: #059669;
}

/* Main App Layout */
.app-container {
    min-height: 100vh;
}

.header {
    background: white;
    padding: 16px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.4rem;
    color: #0077b5;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.user-info {
    color: #666;
    font-size: 0.9rem;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Search Section */
.search-section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.search-section h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: #333;
}

.search-form {
    display: flex;
    gap: 12px;
}

.search-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 1rem;
}

.search-form input:focus {
    outline: none;
    border-color: #0077b5;
}

/* Jobs & Results */
.section {
    background: white;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 24px;
}

.section h2 {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Table */
.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e1e5eb;
}

th {
    background: #f8fafc;
    font-weight: 600;
    color: #444;
}

tr:hover {
    background: #f8fafc;
}

/* Status badges */
.status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

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

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

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

/* Profile cards */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.profile-card {
    background: #f8fafc;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e1e5eb;
}

.profile-card h3 {
    font-size: 1rem;
    margin-bottom: 8px;
    color: #333;
}

.profile-card .job-title {
    color: #444;
    font-weight: 500;
    margin-bottom: 4px;
}

.profile-card .company {
    color: #0077b5;
    font-weight: 500;
    margin-bottom: 4px;
}

.profile-card .location {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.profile-card .email {
    font-family: monospace;
    background: #e1e5eb;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.email-status {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.75rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 500;
}

.email-status-safe {
    background: #d1fae5;
    color: #065f46;
}

.email-status-invalid {
    background: #fee2e2;
    color: #991b1b;
}

.email-status-risky {
    background: #fef3c7;
    color: #92400e;
}

.email-status-unknown {
    background: #e5e7eb;
    color: #4b5563;
}

.email-status-not_verified {
    display: none;
}

.profile-card .linkedin-link {
    display: inline-block;
    margin-top: 12px;
    color: #0077b5;
    text-decoration: none;
    font-size: 0.9rem;
}

.profile-card .linkedin-link:hover {
    text-decoration: underline;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e1e5eb;
    border-top-color: #0077b5;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Empty state */
.empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-state p {
    margin-bottom: 16px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 2px solid #e1e5eb;
    padding-bottom: 8px;
}

.tab {
    padding: 8px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.95rem;
    color: #666;
    border-radius: 6px;
    transition: all 0.2s;
}

.tab:hover {
    background: #f1f5f9;
}

.tab.active {
    background: #0077b5;
    color: white;
}

/* Proxy Management Page */
.proxy-stats {
    margin-bottom: 24px;
}

.stats-grid {
    display: flex;
    gap: 24px;
    align-items: center;
}

.stat-card {
    background: #f8fafc;
    padding: 20px 24px;
    border-radius: 8px;
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #0077b5;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 48px;
    height: 24px;
    appearance: none;
    background: #e1e5eb;
    border-radius: 24px;
    position: relative;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-label input[type="checkbox"]:checked {
    background: #0077b5;
}

.toggle-label input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.toggle-label input[type="checkbox"]:checked::before {
    transform: translateX(24px);
}

.toggle-text {
    font-weight: 500;
    color: #444;
}

/* Upload Area */
.upload-area {
    border: 2px dashed #e1e5eb;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: #0077b5;
    background: #f0f9ff;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
}

.upload-area p {
    color: #666;
    margin-bottom: 8px;
}

.upload-hint {
    margin-top: 12px;
}

.upload-formats {
    font-size: 0.85rem;
    color: #999;
}

.upload-status {
    margin-top: 16px;
}

.upload-status .success {
    color: #065f46;
    background: #d1fae5;
    padding: 12px 16px;
    border-radius: 8px;
}

.upload-status .error {
    color: #991b1b;
    background: #fee2e2;
    padding: 12px 16px;
    border-radius: 8px;
}

.upload-status .loading {
    color: #1e40af;
}

/* Add Proxy Form */
.add-proxy-form {
    display: flex;
    gap: 12px;
}

.add-proxy-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e5eb;
    border-radius: 8px;
    font-size: 1rem;
}

.add-proxy-form input:focus {
    outline: none;
    border-color: #0077b5;
}

/* Proxy List */
.proxy-list {
    max-height: 400px;
    overflow-y: auto;
}

.proxy-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #e1e5eb;
}

.proxy-index {
    font-weight: 600;
    color: #666;
    min-width: 40px;
}

.proxy-url {
    flex: 1;
    font-family: monospace;
    font-size: 0.9rem;
    color: #333;
    word-break: break-all;
}

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

.btn-danger:hover {
    background: #dc2626;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
}

/* Responsive */
@media (max-width: 768px) {
    .search-form {
        flex-direction: column;
    }

    .header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .profiles-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        flex-direction: column;
    }

    .add-proxy-form {
        flex-direction: column;
    }
}
