/**
 * Modern GridView Styles
 *
 * Reusable CSS for card-like table rows with hover effects, status pills,
 * thin-line action icons, and modern typography.
 *
 * Usage:
 *   1. Include this stylesheet in your view or layout
 *   2. Wrap your GridView in <div class="modern-grid">
 *   3. Use the provided CSS classes for columns and elements
 *
 * @version 1.0.0
 * @since 2026-02-20
 */

/* ==========================================================================
   TABLE STRUCTURE
   ========================================================================== */

.modern-grid .table {
    border-collapse: separate;
    border-spacing: 0 4px;
    background: transparent;
}

.modern-grid .table thead th {
    background: #F8F9FA;
    color: #64748B;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border: none;
    padding: 10px 8px;
    white-space: nowrap;
}

.modern-grid .table tbody tr {
    background: #FFFFFF;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.modern-grid .table tbody tr:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    z-index: 10;
    position: relative;
}

.modern-grid .table td {
    padding: 0.75rem 0.5rem !important;
    vertical-align: middle;
    border-top: 1px solid #F1F5F9;
    border-bottom: 1px solid #F1F5F9;
    font-size: 0.8rem;
}

.modern-grid .table td:first-child {
    border-left: 1px solid #F1F5F9;
    border-radius: 8px 0 0 8px;
}

.modern-grid .table td:last-child {
    border-right: 1px solid #F1F5F9;
    border-radius: 0 8px 8px 0;
}

/* Remove default striped styling */
.modern-grid .table-striped > tbody > tr:nth-of-type(odd) > * {
    --bs-table-accent-bg: transparent;
}

/* Responsive table wrapper */
.modern-grid .table-responsive {
    overflow-x: auto;
}

/* ==========================================================================
   ROW STATES
   ========================================================================== */

.modern-grid .table tbody tr.row-deleted {
    background: #FEF2F2;
}

.modern-grid .table tbody tr.row-expired {
    background: #FFFBEB;
}

.modern-grid .table tbody tr.row-inactive {
    background: #F8FAFC;
    opacity: 0.7;
}

.modern-grid .table tbody tr.row-highlighted {
    background: #EFF6FF;
}

/* ==========================================================================
   TYPOGRAPHY - PRIMARY LINKS
   ========================================================================== */

.item-title-link {
    font-weight: 600;
    color: #2563EB;
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    line-height: 1.3;
}

.item-title-link:hover {
    color: #1D4ED8;
    text-decoration: underline;
}

/* Aliases for specific entity types */
.job-title-link { font-weight: 600; color: #2563EB; text-decoration: none; font-size: 0.95rem; display: block; line-height: 1.3; }
.job-title-link:hover { color: #1D4ED8; text-decoration: underline; }

.candidate-name-link { font-weight: 600; color: #2563EB; text-decoration: none; font-size: 0.95rem; display: block; line-height: 1.3; }
.candidate-name-link:hover { color: #1D4ED8; text-decoration: underline; }

.application-title-link { font-weight: 600; color: #2563EB; text-decoration: none; font-size: 0.95rem; display: block; line-height: 1.3; }
.application-title-link:hover { color: #1D4ED8; text-decoration: underline; }

/* ==========================================================================
   TYPOGRAPHY - SECONDARY TEXT
   ========================================================================== */

.item-subtext {
    font-size: 0.7rem;
    color: #94A3B8;
    margin-top: 2px;
    display: block;
}

.item-secondary {
    font-size: 0.75rem;
    color: #64748B;
    margin-top: 1px;
}

/* Aliases for specific entity types */
.job-subtext { font-size: 0.7rem; color: #94A3B8; margin-top: 2px; display: block; }
.job-company { font-size: 0.75rem; color: #64748B; margin-top: 1px; }

.candidate-subtext { font-size: 0.7rem; color: #94A3B8; margin-top: 2px; display: block; }
.candidate-email { font-size: 0.75rem; color: #64748B; margin-top: 1px; }

/* ==========================================================================
   STATUS PILLS - BASE
   ========================================================================== */

.status-pill {
    border-radius: 50px;
    padding: 4px 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* ==========================================================================
   STATUS PILLS - GENERIC COLORS
   ========================================================================== */

.status-new {
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
}

.status-active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-pending {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

.status-hold {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

.status-closed {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
}

.status-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
}

.status-selected {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.status-success {
    background: rgba(16, 185, 129, 0.15);
    color: #047857;
}

.status-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

.status-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
}

.status-info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
}

.status-secondary {
    background: rgba(100, 116, 139, 0.1);
    color: #475569;
}

.status-dark {
    background: rgba(30, 41, 59, 0.1);
    color: #1E293B;
}

/* ==========================================================================
   STATUS PILLS - JOB SPECIFIC
   ========================================================================== */

.status-draft {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

.status-open {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-hiring {
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
}

.status-shortlisted {
    background: rgba(139, 92, 246, 0.1);
    color: #7C3AED;
}

/* ==========================================================================
   STATUS PILLS - RESUME SPECIFIC
   ========================================================================== */

.status-l1 {
    background: rgba(99, 102, 241, 0.1);
    color: #6366F1;
}

.status-l2 {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.status-hr {
    background: rgba(245, 158, 11, 0.1);
    color: #D97706;
}

.status-offer {
    background: rgba(30, 41, 59, 0.1);
    color: #1E293B;
}

/* ==========================================================================
   STATUS PILLS - APPLICATION SPECIFIC
   ========================================================================== */

.status-offered {
    background: rgba(139, 92, 246, 0.1);
    color: #7C3AED;
}

.status-joined {
    background: rgba(30, 41, 59, 0.1);
    color: #1E293B;
}

/* ==========================================================================
   STAGE PILLS
   ========================================================================== */

.stage-pill {
    border-radius: 50px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
    letter-spacing: 0.3px;
    background: #E2E8F0;
    color: #475569;
}

.stage-l1 {
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
}

.stage-l2 {
    background: rgba(99, 102, 241, 0.1);
    color: #6366F1;
}

.stage-hr {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

/* ==========================================================================
   SKILL/TAG BADGES
   ========================================================================== */

.skill-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 500;
    background: #1E293B;
    color: white;
    margin-right: 4px;
    margin-bottom: 2px;
}

.skill-badge-light {
    background: #E2E8F0;
    color: #475569;
}

.skill-badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: #2563EB;
}

/* ==========================================================================
   DATE DISPLAY
   ========================================================================== */

.date-primary {
    font-size: 0.8rem;
    color: #1E293B;
    font-weight: 500;
    display: block;
    line-height: 1.3;
}

.date-relative {
    font-size: 0.7rem;
    color: #94A3B8;
    display: block;
    line-height: 1.2;
    margin-top: 2px;
}

/* ==========================================================================
   EXPERIENCE DISPLAY
   ========================================================================== */

.exp-display {
    font-size: 0.85rem;
    color: #1E293B;
    font-weight: 500;
}

.exp-fresher {
    font-size: 0.75rem;
    color: #94A3B8;
    font-style: italic;
}

/* ==========================================================================
   LOCATION DISPLAY
   ========================================================================== */

.location-primary {
    font-size: 0.85rem;
    color: #1E293B;
    font-weight: 500;
}

.location-secondary {
    font-size: 0.7rem;
    color: #94A3B8;
}

/* ==========================================================================
   AVATAR STACK (for showing multiple items)
   ========================================================================== */

.avatar-stack {
    display: flex;
    align-items: center;
}

.avatar-item {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    margin-left: -8px;
    border: 2px solid #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.avatar-item:first-child {
    margin-left: 0;
}

.avatar-item.more {
    background: #E2E8F0;
    color: #64748B;
    font-size: 0.6rem;
}

.no-items-text {
    font-size: 0.75rem;
    color: #94A3B8;
    font-style: italic;
}

/* Legacy aliases */
.resume-avatars { display: flex; align-items: center; }
.resume-avatar { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 600; color: #fff; margin-left: -8px; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.resume-avatar:first-child { margin-left: 0; }
.resume-avatar.more { background: #E2E8F0; color: #64748B; font-size: 0.6rem; }
.no-resumes { font-size: 0.75rem; color: #94A3B8; font-style: italic; }

/* ==========================================================================
   ACTION ICONS - THIN LINE STYLE
   ========================================================================== */

.action-icons {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}

.action-icon {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #64748B;
    background: transparent;
    border: none;
    transition: all 0.15s ease;
    text-decoration: none;
}

.action-icon:hover {
    background: #F1F5F9;
    color: #334155;
}

/* Semantic action colors */
.action-icon.view:hover { color: #2563EB; background: rgba(37, 99, 235, 0.1); }
.action-icon.edit:hover { color: #D97706; background: rgba(217, 119, 6, 0.1); }
.action-icon.clone:hover { color: #7C3AED; background: rgba(124, 58, 237, 0.1); }
.action-icon.link:hover { color: #059669; background: rgba(5, 150, 105, 0.1); }
.action-icon.download:hover { color: #059669; background: rgba(5, 150, 105, 0.1); }
.action-icon.add:hover { color: #7C3AED; background: rgba(124, 58, 237, 0.1); }
.action-icon.delete:hover { color: #DC2626; background: rgba(220, 38, 38, 0.1); }
.action-icon.archive:hover { color: #64748B; background: rgba(100, 116, 139, 0.1); }
.action-icon.send:hover { color: #2563EB; background: rgba(37, 99, 235, 0.1); }

/* Sticky action column */
.modern-grid .action-column {
    position: sticky;
    right: 0;
    background: white;
    border-left: 1px solid #F1F5F9;
    z-index: 5;
    min-width: 140px;
}

.modern-grid .table tbody tr:hover .action-column {
    background: #FAFBFC;
}

/* ==========================================================================
   CARD HEADER
   ========================================================================== */

.modern-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #E2E8F0;
    background: #FAFBFC;
}

.modern-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1E293B;
}

.modern-title i {
    color: #64748B;
}

.modern-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Entity-specific header aliases */
.jobs-header, .resumes-header, .applications-header { display: flex; align-items: center; justify-content: space-between; padding: 1.25rem 1.5rem; border-bottom: 1px solid #E2E8F0; background: #FAFBFC; }
.jobs-title, .resumes-title, .applications-title { display: flex; align-items: center; gap: 0.75rem; font-size: 1.25rem; font-weight: 600; color: #1E293B; }
.jobs-title i, .resumes-title i, .applications-title i { color: #64748B; }
.jobs-actions, .resumes-actions, .applications-actions { display: flex; align-items: center; gap: 0.75rem; }

/* ==========================================================================
   HEADER BUTTONS
   ========================================================================== */

.btn-create {
    background: #2563EB;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
}

.btn-create:hover {
    background: #1D4ED8;
    color: white;
    transform: translateY(-1px);
}

.btn-export {
    background: white;
    color: #64748B;
    border: 1px solid #E2E8F0;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.15s ease;
}

.btn-export:hover {
    background: #F8F9FA;
    color: #334155;
    border-color: #CBD5E1;
}

/* Entity-specific button aliases */
.btn-create-job, .btn-create-resume, .btn-create-application { background: #2563EB; color: white; border: none; padding: 0.5rem 1rem; border-radius: 8px; font-weight: 500; font-size: 0.875rem; display: inline-flex; align-items: center; gap: 0.5rem; transition: all 0.15s ease; }
.btn-create-job:hover, .btn-create-resume:hover, .btn-create-application:hover { background: #1D4ED8; color: white; transform: translateY(-1px); }

/* Small inline action button */
.btn-add-stage {
    background: #2563EB;
    color: white;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
}

.btn-add-stage:hover {
    background: #1D4ED8;
    color: white;
    transform: translateY(-1px);
}

/* ==========================================================================
   STATUS FILTER TABS
   ========================================================================== */

.status-tabs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #E2E8F0;
    background: white;
    flex-wrap: wrap;
}

.status-tab {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #64748B;
    background: transparent;
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.15s ease;
}

.status-tab:hover {
    background: #F1F5F9;
    color: #334155;
}

.status-tab.active {
    background: #1E293B;
    color: white;
}

.status-tab .count {
    margin-left: 0.5rem;
    padding: 2px 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 50px;
    font-size: 0.7rem;
}

.filter-divider {
    width: 1px;
    height: 24px;
    background: #E2E8F0;
    margin: 0 0.5rem;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.modern-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}

.modern-pagination .pagination {
    gap: 4px;
    margin: 0;
}

.modern-pagination .page-link {
    border: none;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    color: #64748B;
    font-size: 0.85rem;
}

.modern-pagination .page-link:hover {
    background: #F1F5F9;
    color: #1E293B;
}

.modern-pagination .page-item.active .page-link {
    background: #2563EB;
    color: white;
}

.modern-pagination .summary {
    color: #64748B;
    font-size: 0.85rem;
}

/* ==========================================================================
   COMPACT FILTER INPUTS
   ========================================================================== */

.modern-grid .filters input,
.modern-grid .filters select {
    height: 32px;
    font-size: 0.8rem;
    border-radius: 6px;
    border: 1px solid #E2E8F0;
    padding: 4px 8px;
}

.modern-grid .filters input:focus,
.modern-grid .filters select:focus {
    border-color: #2563EB;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.text-truncate-30 {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.text-muted-small {
    font-size: 0.75rem;
    color: #94A3B8;
}

.clickable-row {
    cursor: pointer;
}
