/**
 * Media Tab Styling - Clean, Modern Design
 * 
 * Upload to: /proofpoints-story-modal/assets/css/media-tab.css
 * Version: 1.0.1 - Fixed card footer alignment
 */

/* Loading State */
.media-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #666;
}

.media-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.media-loading p {
    font-size: 14px;
    margin: 0;
}

/* Empty State */
.media-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: #999;
}

.media-empty svg {
    opacity: 0.3;
    margin-bottom: 20px;
}

.media-empty p {
    font-size: 16px;
    margin: 0;
}

/* Error State */
.media-error {
    padding: 40px 20px;
    text-align: center;
    color: #f44336;
}

/* Media Grid */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 24px;
    padding: 24px;
}

@media (max-width: 900px) {
    .media-grid {
        grid-template-columns: 1fr;
    }
}

/* Media Card - Clean style matching quotes tiles */
.media-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #E5E5E5;
    border-radius: 12px;
    overflow: hidden;
    transition: all 200ms ease-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    height: 100%;
}

.media-card:hover {
    background: #F5F5F7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transform: none;
}

/* Media Header - Clean, minimal, matches quote tiles */
.media-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: transparent;
    border-bottom: none;
    flex-shrink: 0;
    min-height: 52px;
    max-height: 52px;
    height: 52px;
    overflow: hidden;
}

.media-question {
    display: flex;
    align-items: center;
    gap: 0;
    flex: 1;
    font-family: "Lexend Deca", sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #1D1D1F;
    line-height: 1.4;
    overflow: hidden;
    min-width: 0;
}

/* Hide the question icon for cleaner look */
.media-question .icon-question {
    display: none;
}

/* Question text truncation */
.media-question span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.icon-question {
    display: none;
}

.media-duration {
    font-size: 12px;
    color: #666;
    background: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    font-family: 'Courier New', monospace;
}

/* Media Player */
.media-player-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    flex-shrink: 0;
}

.mux-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.mux-player iframe {
    display: block;
}

/* Media Footer - Clean, minimal, transparent for hover effect */
.media-footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 14px 20px;
    background: transparent;
    border-top: none;
    margin-top: auto;
    flex-shrink: 0;
}

/* Status Badge - Subtle, minimal */
.media-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 500;
    padding: 0;
    border-radius: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #16a34a;
    background: none;
}

.media-status svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
}

.status-completed,
.media-status.status-completed {
    background: none !important;
    color: #16a34a;
}

.status-transcribing,
.media-status.status-transcribing {
    background: none !important;
    color: #ea580c;
}

.status-pending,
.media-status.status-pending {
    background: none !important;
    color: #6b7280;
}

.status-error,
.media-status.status-error {
    background: none !important;
    color: #dc2626;
}

.status-failed,
.media-status.status-failed {
    background: none !important;
    color: #dc2626;
}

/* Media Actions */
.media-actions {
    display: flex;
    gap: 8px;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
}

.btn-icon:hover {
    background: #2196F3;
    border-color: #2196F3;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
}

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

.btn-icon svg {
    width: 16px;
    height: 16px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .media-grid {
        padding: 16px;
        gap: 16px;
    }
    
    .media-card {
        border-radius: 8px;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .media-card {
        background: #2a2a2a;
        border-color: #444;
    }
    
    .media-header,
    .media-footer {
        background: #1f1f1f;
        border-color: #444;
    }
    
    .media-question {
        color: #e0e0e0;
    }
    
    .btn-icon {
        background: #333;
        border-color: #555;
        color: #ccc;
    }
    
    .btn-icon:hover {
        background: #2196F3;
        border-color: #2196F3;
        color: #fff;
    }
}