/* ============================================
   TEAM STATUS PAGE COMPONENT STYLES
   Pixel-perfect design matching Figma
   ============================================ */

/* ===== PAGE LAYOUT ===== */
.team-status-page {
    background: var(--bg-primary);
    min-height: 100vh;
    padding: var(--spacing-lg);
}

.team-status-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===== PAGE HEADER ===== */
.team-status-header {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: var(--spacing-lg) var(--spacing-xl);
    margin-bottom: var(--spacing-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-status-header-content h1 {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs) 0;
    line-height: var(--line-height-tight);
}

.team-status-header-content p {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: 0;
    line-height: var(--line-height-normal);
}

.team-status-header-actions {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.team-status-header-actions .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: 8px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    transition: var(--transition-all);
}

.team-status-header-actions .btn-outline-light {
    background: transparent;
    border: 1px solid var(--border-medium);
    color: var(--text-secondary);
}

.team-status-header-actions .btn-outline-light:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
}

.live-indicator {
    width: 8px;
    height: 8px;
    background: var(--accent-green);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ===== SUMMARY STATISTICS CARDS ===== */
.team-status-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding: 0 var(--spacing-3xl);
}

.stat-card {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    transition: var(--transition-all);
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-medium);
    transform: translateY(-2px);
}

.stat-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    flex-shrink: 0;
}

.stat-card-icon.purple {
    background: rgba(139, 92, 246, 0.15);
    color: var(--accent-purple);
}

.stat-card-icon.green {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.stat-card-icon.orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.stat-card-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-blue);
}

.stat-card-content {
    flex: 1;
}

.stat-card-value {
    font-size: var(--font-size-2xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-primary);
    line-height: var(--line-height-tight);
    margin: 0 0 var(--spacing-xs) 0;
}

.stat-card-label {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    margin: 0;
    line-height: var(--line-height-normal);
}

/* ===== FILTERS & SEARCH SECTION ===== */
.team-status-filters {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 0;
    margin-bottom: var(--spacing-lg);
    overflow: hidden;
}

/* Filters Header */
.filters-header {
    padding: var(--spacing-lg) var(--spacing-xl);
    border-bottom: 1px solid var(--border-subtle);
}

.filters-title {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.filters-title i {
    color: var(--text-muted);
    font-size: var(--font-size-base);
}

.filters-title h3 {
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

/* Top Row - Main Filters */
.filters-row-top {
    padding: var(--spacing-lg) var(--spacing-xl);
    display: grid;
    grid-template-columns: 1fr 1fr 1.5fr 1fr;
    gap: var(--spacing-md);
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.filter-label {
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    color: var(--text-muted);
    margin: 0;
}

/* Search Input with Icon */
.search-input-wrapper,
.date-input-wrapper,
.time-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 14px;
    z-index: 1;
    pointer-events: none;
}

.search-input,
.date-input,
.time-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 10px 14px 10px 38px;
    font-size: var(--font-size-sm);
    height: 42px;
    width: 100%;
    transition: var(--transition-all);
}

/* Hide default calendar icon on date input */
.date-input::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 10px;
    cursor: pointer;
}

/* Hide default time picker icon */
.time-input::-webkit-calendar-picker-indicator {
    opacity: 0;
    position: absolute;
    right: 10px;
    cursor: pointer;
}

.search-input:focus,
.date-input:focus,
.time-input:focus {
    background: var(--bg-secondary);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.search-input::placeholder,
.date-input::placeholder,
.time-input::placeholder {
    color: var(--text-muted);
}

/* Select2 with Icon */
.search-input-wrapper .select2-container {
    width: 100% !important;
}

.search-input-wrapper .select2-container--default .select2-selection--multiple {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    min-height: 42px;
    padding: 4px 8px 4px 34px;
}

/* Time Range */
.time-range-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.time-separator {
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    margin: 0 4px;
}

.time-input-wrapper {
    flex: 1;
}

.time-input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Status Buttons */
.status-buttons-wrapper {
    display: flex;
    gap: var(--spacing-xs);
    align-items: center;
}

.status-btn {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-secondary);
    padding: 10px 20px;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    height: 42px;
    cursor: pointer;
    transition: var(--transition-all);
    white-space: nowrap;
}

.status-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-medium);
}

.status-btn.active {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: white;
}

.status-icon-btn {
    background: transparent;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    color: var(--text-muted);
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-all);
}

.status-icon-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-medium);
    color: var(--text-secondary);
}

/* Actions Row */
.filters-actions-row {
    padding: var(--spacing-md) var(--spacing-xl);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filters-actions-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-lg);
}

.btn-reset {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    transition: var(--transition-all);
    padding: 0;
}

.btn-reset:hover {
    color: var(--text-primary);
}

.btn-reset i {
    font-size: 12px;
}

.showing-count {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

/* Select2 Dark Theme - Global */
.select2-container--default .select2-selection--multiple {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    min-height: 42px;
    padding: 4px 8px;
}

.select2-container--default .select2-selection--multiple:focus,
.select2-container--default.select2-container--focus .select2-selection--multiple {
    background: var(--bg-secondary);
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: var(--bg-secondary);
    border: 1px solid var(--border-medium);
    border-radius: 6px;
    color: var(--text-primary);
    padding: 6px 10px;
    margin: 3px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    display: flex;
    align-items: center;
    gap: 6px;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: var(--text-muted);
    margin-right: 0;
    font-weight: normal;
    order: -1;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    color: var(--text-danger);
}

.select2-search__field {
    color: var(--text-primary) !important;
}

.select2-search__field::placeholder {
    color: var(--text-muted) !important;
}

/* Select2 Dropdown */
.select2-container--default .select2-results__option {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 8px 12px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: var(--accent-blue);
    color: white;
}

.select2-dropdown {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
}

.select2-search--dropdown .select2-search__field {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 6px;
    padding: 8px;
}

/* Responsive */
@media (max-width: 1200px) {
    .filters-row-top {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .filters-row-top {
        grid-template-columns: 1fr;
    }

    .time-range-wrapper {
        flex-direction: column;
    }

    .time-separator {
        transform: rotate(90deg);
    }
}

/* ===== TABLE SECTION ===== */
.team-status-table-container {
    background: var(--bg-card);
    backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: var(--spacing-lg);
    overflow: hidden;
}

.team-status-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.team-status-table thead th {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-semibold);
    text-transform: uppercase;
    letter-spacing: var(--letter-spacing-wide);
    padding: var(--spacing-md) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 10;
}

.team-status-table thead th:first-child {
    border-top-left-radius: 8px;
}

.team-status-table thead th:last-child {
    border-top-right-radius: 8px;
}

.team-status-table tbody tr {
    transition: var(--transition-all);
}

.team-status-table tbody tr:hover {
    background: var(--bg-tertiary);
}

.team-status-table tbody td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    vertical-align: middle;
}

.team-status-table tbody tr:last-child td {
    border-bottom: none;
}

/* Team Member Cell */
.team-member-cell {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.team-member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid var(--border-subtle);
}

.team-member-info {
    flex: 1;
    min-width: 0;
}

.team-member-name {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin: 0 0 2px 0;
    font-size: var(--font-size-sm);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.team-member-role {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.team-member-projects {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin: 4px 0 0 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.team-member-commits {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-left: var(--spacing-xs);
}

.team-member-commits a {
    color: var(--accent-blue);
    text-decoration: none;
    margin-left: 4px;
}

.team-member-commits a:hover {
    text-decoration: underline;
}

/* Working Date Cell */
.working-date {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

/* Check In/Out Cell */
.check-time-badges {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.time-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--font-size-xs);
    background: var(--bg-tertiary);
    color: var(--text-muted);
    width: fit-content;
}

/* Logged Hours Cell */
.logged-hours-cell {
    min-width: 120px;
}

.logged-hours-value {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: 4px;
}

.logged-hours-value span {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.logged-hours-time {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-bottom: 4px;
}

.leave-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: var(--font-size-xs);
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
    margin-top: 4px;
}

/* Progress Bar */
.progress-bar-container {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 4px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.progress-bar-fill.high {
    background: var(--gradient-green);
}

.progress-bar-fill.medium {
    background: var(--gradient-blue);
}

.progress-bar-fill.low {
    background: var(--gradient-orange);
}

.progress-bar-fill.very-low {
    background: var(--gradient-red);
}

/* Tasks Cell */
.tasks-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
}

/* Productivity Cell */
.productivity-cell {
    min-width: 100px;
}

.productivity-value {
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: 4px;
}

.productivity-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
}

.productivity-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease;
}

.productivity-bar-fill.high {
    background: var(--gradient-green);
}

.productivity-bar-fill.medium {
    background: var(--gradient-blue);
}

.productivity-bar-fill.low {
    background: var(--gradient-orange);
}

.productivity-bar-fill.very-low {
    background: var(--gradient-red);
}

/* Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: var(--font-size-xs);
    font-weight: var(--font-weight-medium);
    text-transform: capitalize;
}

.status-badge.approved {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
}

.status-badge.pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
}

.status-badge.rejected {
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
}

.status-badge i {
    font-size: 10px;
}

.status-approver {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: 4px;
    display: block;
}

/* Actions Cell */
.actions-cell {
    text-align: center;
}

.btn-detail {
    padding: 6px 16px;
    border-radius: 6px;
    background: var(--accent-blue);
    color: white;
    border: none;
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: var(--transition-all);
}

.btn-detail:hover {
    background: var(--accent-blue-dark);
    transform: translateY(-1px);
}

.btn-detail:disabled {
    background: var(--bg-tertiary);
    color: var(--text-disabled);
    cursor: not-allowed;
    transform: none;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1200px) {
    .team-status-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .team-status-page {
        padding: var(--spacing-md);
    }

    .team-status-header {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--spacing-md);
    }

    .team-status-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .team-status-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .team-status-table-container {
        overflow-x: auto;
    }

    .team-status-table {
        min-width: 900px;
    }
}

@media (max-width: 480px) {
    .team-status-stats {
        grid-template-columns: 1fr;
    }

    .stat-card {
        padding: var(--spacing-md);
    }
}

/* ===== UTILITY CLASSES ===== */
.rounded-lg {
    border-radius: 16px;
}

.rounded-md {
    border-radius: 8px;
}

.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}