/* Applications Page Specific Styles */

/* Header Section */
.applications-header {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    padding: 2rem 0;
    color: white;
}

/* Active Navigation Link */
.nav-link.active,
.nav-links .nav-link.active {
    background: var(--primary-bg) !important;
    color: var(--primary) !important;
    border: none !important;
}

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

.applications-header h1 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.applications-header p {
    font-size: 1.125rem;
    opacity: 0.9;
}

/* Stats Section */
.applications-stats {
    background: var(--gray-50);
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: white;
}

.stat-icon.total {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

.stat-icon.active {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.stat-icon.shortlisted {
    background: linear-gradient(135deg, #10b981, #059669);
}

.stat-icon.rejected {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.stat-content h3 {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
}

/* Main Content Layout */
.applications-main {
    min-height: 60vh;
    margin-top: 0;
}

.applications-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    align-items: start;
}

/* Filters Sidebar */
.filters-sidebar {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 5rem;
}

.filter-section h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-group:last-of-type {
    margin-bottom: 0.75rem;
}

.filter-group h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    padding: 0.375rem 0;
    cursor: pointer;
    transition: color 0.2s;
}

.filter-checkbox:hover {
    color: var(--primary);
}

.filter-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.filter-checkbox span {
    font-size: 0.813rem;
    color: var(--gray-700);
}

.filter-checkbox .count {
    margin-left: auto;
    color: var(--gray-500);
    font-size: 0.75rem;
}

.btn-clear-filters {
    width: 100%;
    padding: 0.625rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    color: var(--gray-700);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    transition: all 0.2s;
    font-size: 0.813rem;
    margin-top: 0.5rem;
}

.btn-clear-filters:hover {
    background: var(--gray-200);
    border-color: var(--gray-400);
}

/* Sort Bar */
.sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.sort-info {
    color: var(--gray-600);
    font-size: 0.938rem;
}

.sort-info strong {
    color: var(--gray-900);
}

.sort-select {
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    background: white;
    color: var(--gray-700);
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
}

/* Application Cards */
.application-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.application-card:hover {
    box-shadow: var(--shadow-md);
}

.application-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.company-info {
    display: flex;
    gap: 1rem;
}

.company-logo {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.company-logo img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.job-info h3 {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.company-name {
    font-size: 0.938rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
}

.job-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.813rem;
    color: var(--gray-500);
}

.job-meta span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* Application Status */
.application-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.application-status.applied {
    background: var(--gray-100);
    color: var(--gray-700);
}

.application-status.under-review {
    background: var(--warning-bg);
    color: var(--warning);
}

.application-status.shortlisted {
    background: var(--success-bg);
    color: var(--success);
}

.application-status.interview {
    background: var(--primary-bg);
    color: var(--primary);
}

.application-status.offer {
    background: linear-gradient(135deg, #ddd6fe, #c4b5fd);
    color: #7c3aed;
}

.application-status.rejected {
    background: #fee2e2;
    color: var(--danger);
}

/* Timeline - Horizontal Layout */
.application-timeline {
    padding: 1.5rem !important;
    background: var(--gray-50) !important;
    display: none !important; /* Hidden by default */
    justify-content: space-between !important;
    align-items: center !important;
    gap: 1rem !important;
    position: relative !important;
    border-radius: 12px !important;
    border: 1px solid var(--gray-100) !important;
    margin-top: 1rem !important;
    flex-wrap: wrap !important;
    flex-direction: row !important;
}

/* When timeline is shown */
.application-timeline.show {
    display: flex !important;
}

.application-timeline .timeline-step {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    position: relative !important;
    z-index: 1 !important;
    min-width: 80px !important;
    max-width: 120px !important;
    order: 1 !important;
    margin-bottom: 0 !important;
    padding-left: 0 !important;
}

.application-timeline .step-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: white;
    border: 3px solid var(--gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: var(--gray-400);
    margin-bottom: 0.5rem;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.application-timeline .timeline-step.completed .step-icon {
    border-color: var(--success);
    background: var(--success);
    color: white;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.application-timeline .timeline-step.active .step-icon {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    animation: pulse 2s infinite;
}

.application-timeline .timeline-step.pending .step-icon {
    border-color: #f59e0b;
    background: #fef3c7;
    color: #f59e0b;
}

.application-timeline .timeline-step.rejected .step-icon {
    border-color: var(--danger);
    background: var(--danger);
    color: white;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.application-timeline .step-content {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.application-timeline .step-content h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.application-timeline .step-content p {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin: 0;
    line-height: 1;
}

.application-timeline .timeline-connector {
    position: absolute;
    top: 48px;
    left: 24px;
    right: 24px;
    height: 3px;
    background: var(--gray-300);
    z-index: 0;
    order: 1;
}

.application-timeline .timeline-connector.completed {
    background: var(--success);
}

.application-timeline .timeline-step:last-child .timeline-connector {
    display: none;
}

.application-timeline .status-message {
    width: 100%;
    margin-top: 1rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    font-style: italic;
    color: var(--gray-700);
    line-height: 1.5;
    text-align: center;
    order: 10;
}

.application-timeline .timeline-action {
    width: 100%;
    margin-top: 1rem;
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
    justify-content: center;
    order: 11;
}

.application-timeline .offer-details {
    width: 100%;
    margin-top: 1rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, #fef3c7 0%, #fbbf24 100%);
    border-radius: 10px;
    border: 2px solid #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
    text-align: center;
    order: 10;
}

.offer-details p {
    margin-bottom: 0.5rem;
    color: #92400e;
    font-weight: 500;
    font-size: 0.875rem;
}

.offer-details p:last-child {
    margin-bottom: 0;
}

.offer-details strong {
    color: #78350f;
    font-weight: 700;
}

/* Application Footer */
.application-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--gray-100);
}

.btn-view-details {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.btn-view-details:hover {
    background: var(--primary-bg);
}

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

/* Action Buttons */
.btn-action {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 6px;
    font-size: 0.813rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    transition: all 0.2s;
    color: var(--gray-700);
}

.btn-action:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-action.primary {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.btn-action.primary:hover {
    background: var(--primary-dark);
}

.btn-action.secondary {
    background: var(--gray-100);
}

.btn-action.success {
    background: var(--success);
    color: white;
    border-color: var(--success);
}

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

.btn-action.danger {
    background: var(--danger);
    color: white;
    border-color: var(--danger);
}

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

.btn-action.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 6px;
    color: var(--gray-700);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s;
}

.page-btn:hover:not(.disabled) {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

.page-number {
    width: 36px;
    height: 36px;
    border: 1px solid var(--gray-300);
    background: white;
    border-radius: 6px;
    color: var(--gray-700);
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.page-number:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.page-number.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.page-dots {
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    color: var(--gray-500);
}

/* Active Navigation Link */
.nav-link.active {
    background: var(--primary-bg);
    color: var(--primary);
}

/* Job Details Modal - Clean Design */
.job-details-modal .modal-content,
.offer-details-modal .modal-content {
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--gray-200);
    background: white;
    overflow: hidden;
}

.job-details-modal .modal-content::-webkit-scrollbar {
    width: 8px;
}

.job-details-modal .modal-content::-webkit-scrollbar-track {
    background: var(--gray-50);
}

.job-details-modal .modal-content::-webkit-scrollbar-thumb {
    background: var(--gray-300);
    border-radius: 4px;
}

.job-details-modal .modal-content::-webkit-scrollbar-thumb:hover {
    background: var(--gray-400);
}

.job-details-content,
.offer-details-content {
    padding: 0;
    overflow-y: auto;
    max-height: 90vh;
}

.job-header,
.offer-header {
    padding: 2rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.job-header h3,
.offer-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.job-company,
.offer-company {
    font-size: 1rem;
    color: var(--gray-600);
    font-weight: 500;
    margin-bottom: 1rem;
}

.job-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    background: white;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    font-weight: 500;
}

.meta-item i {
    color: var(--primary);
    font-size: 0.875rem;
    width: 14px;
    flex-shrink: 0;
}

.job-section,
.offer-section {
    padding: 2rem;
    border-bottom: 1px solid var(--gray-100);
}

.job-section:last-child,
.offer-section:last-child {
    border-bottom: none;
}

.job-section h4,
.offer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.job-section h4 i,
.offer-section h4 i {
    color: var(--primary);
    font-size: 1rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.job-section p {
    line-height: 1.6;
    color: var(--gray-700);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.job-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.job-section li {
    padding: 0.75rem 0;
    color: var(--gray-700);
    font-size: 0.875rem;
    line-height: 1.5;
    border-bottom: 1px solid var(--gray-100);
    position: relative;
    padding-left: 1.5rem;
}

.job-section li:last-child {
    border-bottom: none;
}

.job-section li:before {
    content: '•';
    color: var(--primary);
    position: absolute;
    left: 0;
    top: 0.75rem;
    font-weight: bold;
    font-size: 1rem;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: white;
    border: 1px solid var(--gray-300);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--gray-600);
    transition: all 0.2s ease;
    z-index: 10;
}

.close-modal:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-800);
}

/* Offer Details Styles */
.offer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.offer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
}

.offer-item label {
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.offer-item span {
    color: var(--gray-900);
    font-weight: 600;
    font-size: 0.875rem;
}

.offer-item .amount {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--primary);
}

.benefits-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
    color: var(--gray-700);
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--gray-200);
}

.benefit-item i {
    color: var(--success);
    font-size: 1rem;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.offer-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    padding: 2rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.btn-offer-action {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    min-width: 120px;
    justify-content: center;
}

.btn-offer-action.accept {
    background: var(--success);
    color: white;
}

.btn-offer-action.accept:hover {
    background: #059669;
    transform: translateY(-1px);
}

.btn-offer-action.decline {
    background: var(--danger);
    color: white;
}

.btn-offer-action.decline:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

.btn-offer-action.download {
    background: var(--primary);
    color: white;
}

.btn-offer-action.download:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .applications-content {
        grid-template-columns: 1fr;
    }
    
    .filters-sidebar {
        position: static;
        margin-bottom: 2rem;
    }
    
    .application-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .application-status {
        align-self: flex-start;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .application-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .application-actions {
        justify-content: stretch;
    }
    
    .btn-action {
        flex: 1;
        justify-content: center;
    }
}