/* Referrals Page Specific Styles */

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

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

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

.btn-refer-new {
    background: white;
    color: var(--primary);
    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;
}

.btn-refer-new:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Main Section */
.referrals-main {
    margin-top: 0;
}

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

.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: all 0.2s ease;
    border: 2px solid transparent;
}

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

.stat-card.highlight {
    background: linear-gradient(135deg, #ede9fe, #ddd6fe);
    border-color: #7c3aed;
}

.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, #6366f1, #4f46e5);
}

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

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

.stat-icon.earnings {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
}

.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);
    margin-bottom: 0.25rem;
}

.stat-subtitle {
    font-size: 0.813rem;
    color: var(--gray-500);
}

/* Search and Filter Bar */
.search-filter-bar {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2rem;
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 300px;
    position: relative;
}

.search-box i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.938rem;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-buttons {
    display: flex;
    gap: 0.5rem;
}

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

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

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

.filter-btn .count {
    background: rgba(0, 0, 0, 0.1);
    padding: 0.125rem 0.375rem;
    border-radius: 12px;
    font-size: 0.75rem;
}

.filter-btn.active .count {
    background: rgba(255, 255, 255, 0.2);
}

.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;
}

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

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

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

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

.candidate-avatar {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
}

.candidate-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.candidate-details h3 {
    font-size: 1.125rem;
    margin-bottom: 0.375rem;
    color: var(--gray-900);
}

.contact-info {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.contact-info span {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.contact-info i {
    font-size: 0.75rem;
    color: var(--gray-400);
}

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

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

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

.referral-status.pending {
    background: var(--gray-100);
    color: var(--gray-700);
}

.referral-status.applied {
    background: var(--primary-bg);
    color: var(--primary);
}

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

.referral-status.joined {
    background: var(--success-bg);
    color: var(--success);
}

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

/* Timeline */
.referral-timeline {
    padding: 1.5rem;
    background: var(--gray-50);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    position: relative;
}

.timeline-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    z-index: 1;
}

.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;
}

.timeline-step.completed .step-icon {
    border-color: var(--success);
    background: var(--success);
    color: white;
}

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

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

@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);
    }
}

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

.step-content p {
    font-size: 0.75rem;
    color: var(--gray-600);
}

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

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

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

/* Collapsed Timeline */
.referral-timeline.collapsed {
    display: block;
    padding: 1rem 1.5rem;
}

.timeline-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.timeline-summary p {
    color: var(--gray-600);
    font-size: 0.875rem;
}

.btn-expand {
    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.25rem 0.5rem;
    border-radius: 4px;
    transition: background 0.2s;
}

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

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

.earnings-info,
.status-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.earnings-info {
    color: var(--success);
    font-weight: 500;
}

.earnings-info i {
    font-size: 1.125rem;
}

.status-info {
    color: var(--gray-600);
}

.status-info.warning {
    color: var(--warning);
}

.status-info.info {
    color: var(--primary);
}

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

.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);
}

/* Load More Section */
.load-more-section {
    text-align: center;
    margin-top: 2rem;
}

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

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

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.modal-header h2 {
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

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

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.938rem;
    transition: all 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.form-info i {
    font-size: 1.25rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

.btn-secondary {
    padding: 0.75rem 1.5rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    color: var(--gray-700);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--gray-200);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

/* Redesigned Refer Modal Styles */
.refer-modal-redesign {
    max-width: 520px;
    padding: 0;
    overflow: hidden;
}

.refer-modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 2rem 1rem 2rem;
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.refer-header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.refer-icon-wrapper {
    background: rgba(255, 255, 255, 0.2);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.refer-icon-wrapper i {
    font-size: 1.5rem;
    color: white;
}

.refer-header-text h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.25rem 0;
    color: white;
}

.refer-header-text p {
    margin: 0;
    opacity: 0.9;
    font-size: 0.875rem;
}

.refer-modal-header .close-modal {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.refer-modal-header .close-modal:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.refer-earning-banner {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    overflow: hidden;
}

.refer-earning-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20px;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.earning-icon {
    background: rgba(255, 255, 255, 0.2);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.earning-icon i {
    font-size: 1.25rem;
    color: white;
}

.earning-text {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.earning-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    line-height: 1;
}

.earning-description {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

.refer-modal-redesign .modal-body {
    padding: 2rem;
    background: white;
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-of-type {
    margin-bottom: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--gray-100);
}

.section-title i {
    color: var(--primary);
    font-size: 1rem;
}

.refer-modal-redesign .form-group {
    margin-bottom: 1.25rem;
}

.refer-modal-redesign .form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.input-wrapper,
.select-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--gray-400);
    font-size: 0.875rem;
    z-index: 2;
}

.refer-modal-redesign .form-group input,
.refer-modal-redesign .form-group select {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    background: var(--gray-50);
}

.refer-modal-redesign .form-group input:focus,
.refer-modal-redesign .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.refer-modal-redesign .form-group input::placeholder {
    color: var(--gray-400);
}

.select-wrapper {
    position: relative;
}

.select-arrow {
    position: absolute;
    right: 1rem;
    color: var(--gray-400);
    font-size: 0.75rem;
    pointer-events: none;
    z-index: 2;
}

.refer-modal-redesign .form-group select {
    appearance: none;
    background-image: none;
    cursor: pointer;
}

.refer-modal-redesign .modal-footer {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-100);
}

.btn-cancel {
    flex: 1;
    padding: 0.875rem 1.5rem;
    background: white;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    color: var(--gray-700);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.btn-cancel:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
    transform: translateY(-1px);
}

.btn-refer-submit {
    flex: 2;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-refer-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.btn-refer-submit:active {
    transform: translateY(0);
}

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
}

/* New Layout Styles */
.referrals-layout {
    display: grid !important;
    grid-template-columns: 1fr 350px !important;
    gap: 2rem;
    align-items: start;
    min-height: 100vh;
}

.referrals-content {
    width: 100%;
}

/* Leaderboard Sidebar */
.leaderboard-sidebar {
    width: 100%;
    position: sticky;
    top: 2rem;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background: transparent;
}

.sidebar-section {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-100);
}

.sidebar-section h3 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-section h3 i {
    color: var(--primary);
}

.leaderboard-header p {
    font-size: 0.813rem;
    color: var(--gray-600);
    margin-bottom: 1.5rem;
}

/* Winners Section */
.winners-section {
    margin-bottom: 1.5rem;
}

.winner-item.gold {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
}

.winner-avatar {
    width: 60px;
    height: 60px;
    margin: 0 auto 0.75rem;
    position: relative;
}

.winner-avatar.small {
    width: 40px;
    height: 40px;
    margin: 0 auto 0.5rem;
}

.winner-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.crown {
    position: absolute;
    top: -8px;
    right: -8px;
    color: #ffd700;
    font-size: 1rem;
    background: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.winner-rank {
    position: absolute;
    top: -5px;
    left: -5px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.winner-item.gold .winner-rank {
    background: #ffd700;
    color: #333;
}

.winner-item.silver .winner-rank {
    background: #c0c0c0;
    color: #333;
}

.winner-item.bronze .winner-rank {
    background: #cd7f32;
    color: white;
}

.winner-item h4,
.winner-item h5 {
    font-size: 0.938rem;
    margin-bottom: 0.25rem;
    color: var(--gray-900);
}

.winner-item h5 {
    font-size: 0.813rem;
}

.winner-item .earnings,
.winner-item p {
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--primary);
}

.runner-ups {
    display: flex;
    justify-content: space-around;
    gap: 1rem;
}

.runner-ups .winner-item {
    text-align: center;
    flex: 1;
}

/* Ranking List */
.ranking-list {
    margin-bottom: 1.5rem;
}

.ranking-list h4 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--gray-200);
}

.rank-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-100);
}

.rank-item:last-child {
    border-bottom: none;
}

.rank-item.current-user {
    background: var(--primary-bg);
    padding: 0.75rem;
    border-radius: 8px;
    border-bottom: none;
    margin-bottom: 0.75rem;
}

.rank-number {
    width: 24px;
    height: 24px;
    background: var(--gray-100);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.813rem;
    font-weight: 700;
    color: var(--gray-700);
    flex-shrink: 0;
}

.rank-item.current-user .rank-number {
    background: var(--primary);
    color: white;
}

.rank-details {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rank-details .name {
    font-size: 0.875rem;
    color: var(--gray-900);
    font-weight: 500;
}

.rank-details .amount {
    font-size: 0.813rem;
    color: var(--primary);
    font-weight: 600;
}

/* CTA Button */
.leaderboard-cta {
    text-align: center;
}

.btn-climb-ranks {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
    transition: all 0.2s;
    width: 100%;
}

.btn-climb-ranks:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Quick Stats Grid */
.quick-stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.quick-stat {
    text-align: center;
    padding: 1rem;
    background: var(--gray-50);
    border-radius: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--gray-600);
}

/* Achievements */
.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.achievement {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.achievement.earned {
    background: var(--success-bg);
    color: var(--success);
}

.achievement.earned i {
    color: var(--success);
}

.achievement.locked {
    background: var(--gray-100);
    color: var(--gray-500);
}

.achievement.locked i {
    color: var(--gray-400);
}

.achievement:hover.earned {
    transform: translateX(4px);
    background: var(--success);
    color: white;
}

.achievement:hover.earned i {
    color: white;
}

/* Remove old leaderboard section styles that are now in sidebar */
.leaderboard-section {
    display: none;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .referrals-layout {
        grid-template-columns: 1fr 300px;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .referrals-layout {
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .leaderboard-sidebar {
        position: static;
        max-height: none;
        overflow-y: visible;
        order: -1; /* Show leaderboard at top on mobile */
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .search-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .filter-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .referral-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .candidate-info {
        flex-direction: column;
        text-align: center;
    }
    
    .contact-info {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .referral-timeline {
        flex-direction: column;
        padding: 1rem;
    }
    
    .timeline-connector {
        width: 3px;
        height: 60px;
        left: 24px;
        top: 48px;
    }
    
    .referral-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .referral-actions {
        justify-content: stretch;
    }
    
    .btn-action {
        flex: 1;
        justify-content: center;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    /* Sidebar adjustments for mobile */
    .sidebar-section {
        padding: 1rem;
    }
    
    .winners-section {
        margin-bottom: 1rem;
    }
    
    .runner-ups {
        gap: 0.5rem;
    }
    
    .quick-stats-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.5rem;
    }
    
    .quick-stat {
        padding: 0.75rem 0.5rem;
    }
    
    .stat-value {
        font-size: 1.25rem;
    }
    
    .stat-label {
        font-size: 0.688rem;
    }
}

/* Leaderboard Section */
.leaderboard-section {
    margin-top: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 2rem;
}

.leaderboard-header h2 {
    font-size: 2rem;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.leaderboard-header h2 i {
    color: #ffd700;
}

.leaderboard-header p {
    color: var(--gray-600);
}

/* Podium Section */
.leaderboard-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 2rem;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.podium-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: 12px;
    position: relative;
    transition: transform 0.3s ease;
}

.podium-item:hover {
    transform: translateY(-5px);
}

.podium-item.first {
    padding: 2rem 1.5rem;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    transform: scale(1.1);
}

.podium-item.second {
    background: linear-gradient(135deg, #c0c0c0 0%, #d7d7d7 100%);
}

.podium-item.third {
    background: linear-gradient(135deg, #cd7f32 0%, #e4a05f 100%);
}

.crown {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    color: #ff9500;
    font-size: 1.5rem;
}

.podium-rank {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}

.podium-avatar {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
}

.podium-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.podium-item h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: white;
}

.podium-item .referral-count {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.25rem;
}

.podium-item .earnings {
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
}

/* Leaderboard Table */
.leaderboard-list {
    max-width: 800px;
    margin: 0 auto;
}

.leaderboard-list h3 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    color: var(--gray-900);
}

.leaderboard-table {
    background: var(--gray-50);
    border-radius: 12px;
    overflow: hidden;
}

.leaderboard-row {
    display: grid;
    grid-template-columns: 60px 1fr 100px 100px 120px;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    transition: background 0.2s;
}

.leaderboard-row:last-child {
    border-bottom: none;
}

.leaderboard-row:hover:not(.header) {
    background: white;
}

.leaderboard-row.header {
    background: var(--gray-100);
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.875rem;
}

.leaderboard-row .rank {
    font-weight: 700;
    color: var(--gray-900);
    text-align: center;
}

.leaderboard-row .user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.leaderboard-row .user img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.leaderboard-row .user span {
    font-weight: 500;
    color: var(--gray-900);
}

.leaderboard-row .stats {
    text-align: center;
    color: var(--gray-700);
}

.leaderboard-row .amount {
    text-align: right;
    font-weight: 600;
    color: var(--primary);
}

/* Candidate Details Modal Styles */
.candidate-details-modal .modal-content {
    max-width: 700px;
}

.candidate-details-content {
    padding: 0;
}

.candidate-overview {
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1.5rem;
}

.candidate-header {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.candidate-avatar-large {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}

.candidate-avatar-large img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--gray-200);
}

.candidate-info h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--gray-900);
}

.contact-details p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.938rem;
    color: var(--gray-600);
}

.contact-details i {
    width: 16px;
    color: var(--gray-400);
}

.overall-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 0.75rem;
}

.overall-status.joined {
    background: var(--success-bg);
    color: var(--success);
}

.overall-status.applied {
    background: var(--warning-bg);
    color: var(--warning);
}

.overall-status.pending {
    background: var(--gray-100);
    color: var(--gray-700);
}

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

.overall-status.not-selected {
    background: #fee2e2;
    color: var(--danger);
}

/* Applications Section */
.applications-section h4 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--gray-900);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.application-item {
    background: var(--gray-50);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--gray-200);
}

.application-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

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

.job-info .company {
    font-size: 0.875rem;
    color: var(--gray-600);
    margin-bottom: 0.25rem;
}

.applied-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.application-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 16px;
    font-size: 0.813rem;
    font-weight: 500;
}

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

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

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

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

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

.application-status.withdrawn {
    background: var(--gray-100);
    color: var(--gray-600);
}

.application-details {
    font-size: 0.813rem;
    color: var(--gray-700);
}

.current-stage,
.status-details {
    margin-bottom: 0.5rem;
}

.no-applications {
    text-align: center;
    padding: 3rem;
    color: var(--gray-500);
}

.no-applications i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--gray-400);
}

.no-applications h4 {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.no-applications p {
    font-size: 0.875rem;
}

/* Simplified Refer Modal */
.refer-modal-simple {
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--gray-200);
    background: white;
}

.refer-modal-simple .modal-header {
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid var(--gray-200);
    text-align: center;
    position: relative;
}

.refer-modal-simple .modal-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-900);
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.refer-modal-simple .modal-header h2 i {
    color: var(--primary);
}

.refer-modal-simple .modal-header p {
    color: var(--gray-600);
    font-size: 0.875rem;
    margin: 0;
}

.refer-modal-simple .close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--gray-100);
    border: none;
    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;
}

.refer-modal-simple .close-modal:hover {
    background: var(--gray-200);
    color: var(--gray-800);
}

.refer-modal-simple .modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}