/**
 * Cell Formatters Styles
 * Used by templates/listing/_formatter.html.twig
 */

/* Badge Formatters */
.badge {
    font-weight: 600;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Boolean Badge Formatter */
.badge i {
    font-size: 0.875rem;
}

/* Status Formatter */
.badge.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Currency Formatter */
.currency-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
}

/* Email/Phone Formatters */
a.email-link,
a.phone-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

a.email-link:hover,
a.phone-link:hover {
    color: #0d6efd;
    text-decoration: underline;
}

/* Truncate Formatter */
.truncated-text {
    display: inline-block;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}

.truncated-text[title] {
    cursor: help;
}

/* JSON Formatter */
code.json-formatter {
    display: block;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    max-height: 150px;
    overflow-y: auto;
    white-space: pre;
}

/* List Formatter */
.list-formatter .badge {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Image Formatter */
.formatter-thumbnail {
    border-radius: 0.25rem;
    object-fit: cover;
}

.formatter-thumbnail.placeholder {
    opacity: 0.5;
}

/* Color Formatter */
.color-formatter {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.color-swatch {
    display: inline-block;
    width: 20px;
    height: 20px;
    border-radius: 0.25rem;
    border: 1px solid #dee2e6;
    vertical-align: middle;
}

.color-value {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
}

/* Progress Formatter */
.progress-formatter {
    min-width: 100px;
    height: 20px;
}

.progress-formatter .progress-bar {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 20px;
}

/* Attendance Progress Formatter */
.attendance-progress-formatter {
    min-width: 100px;
    height: 20px;
}

.attendance-progress-formatter .progress-bar {
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 20px;
}

.attendance-progress-text {
    display: block;
    width: 100%;
    text-align: center;
    color: white;
    text-shadow: 0 1px 1px rgba(0,0,0,0.3);
}

/* Rating Formatter */
.rating-formatter {
    display: inline-flex;
    align-items: center;
    gap: 0.125rem;
}

.rating-formatter .bi-star-fill,
.rating-formatter .bi-star-half {
    color: #ffc107;
}

.rating-formatter .bi-star {
    color: #dee2e6;
}

.rating-formatter .rating-number {
    margin-left: 0.5rem;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Date/DateTime Formatters */
.date-formatter,
.datetime-formatter {
    white-space: nowrap;
}

/* Percentage Formatter */
.percentage-formatter {
    font-weight: 600;
}

/* Number Formatter */
.number-formatter {
    font-family: 'Courier New', monospace;
    text-align: right;
}

/* Link Formatter */
.link-formatter {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .truncated-text {
        max-width: 150px;
    }
    
    code.json-formatter {
        font-size: 0.7rem;
        max-height: 100px;
    }
    
    .progress-formatter {
        min-width: 60px;
    }
}

/* Dark mode support (if your app has dark mode) */
@media (prefers-color-scheme: dark) {
    code.json-formatter {
        background-color: #212529;
        color: #f8f9fa;
    }
    
    .color-swatch {
        border-color: #495057;
    }
    
    a.email-link:hover,
    a.phone-link:hover {
        color: #6ea8fe;
    }
}

/* Animation for value changes (useful with Turbo) */
.formatter-value-changed {
    animation: highlightChange 0.5s ease-in-out;
}

@keyframes highlightChange {
    0% {
        background-color: #fff3cd;
    }
    100% {
        background-color: transparent;
    }
}

/* Compact Calendar Badge Formatter */
.compact-calendar-badge {
    display: inline-flex;
    align-items: center;
    background: var(--bg-color);
    color: var(--text-color);
    border-radius: 20px;
    padding: 6px 12px;
    box-shadow: 
        0 3px 6px rgba(0, 0, 0, 0.25),
        0 2px 4px rgba(0, 0, 0, 0.15);
    border: 3px solid white;
    transition: all 0.15s ease;
    max-width: 200px;
    position: relative;
    overflow: hidden;
}

.compact-calendar-badge::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.3);
}

.compact-calendar-badge:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 4px 8px rgba(0, 0, 0, 0.3),
        0 3px 6px rgba(0, 0, 0, 0.2);
}

.calendar-badge-content {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.calendar-icon {
    font-size: 0.75rem;
    opacity: 0.8;
    flex-shrink: 0;
}

.appointment-name {
    font-weight: 600;
    font-size: 0.8125rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
    flex: 1;
}

.duration-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.6875rem;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .compact-calendar-badge {
        border-color: rgba(255, 255, 255, 0.9);
        box-shadow: 
            0 2px 4px rgba(0, 0, 0, 0.3),
            0 1px 2px rgba(0, 0, 0, 0.2);
    }
    
    .compact-calendar-badge:hover {
        box-shadow: 
            0 3px 6px rgba(0, 0, 0, 0.4),
            0 2px 4px rgba(0, 0, 0, 0.3);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .compact-calendar-badge {
        max-width: 150px;
        padding: 4px 8px;
    }
    
    .appointment-name {
        font-size: 0.75rem;
    }
    
    .duration-badge {
        font-size: 0.625rem;
        padding: 1px 4px;
    }
}