/**
 * TAICS Video Manager CSS
 *
 * Styles for video slot management in Layout Templates tab
 *
 * @package TechnodromeAIContentAssistant
 * @since 3.3.0
 */

/* Video Section Styles */
.taics-video-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.taics-video-section:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}

.taics-video-section h3 {
    color: #495057;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    font-weight: 600;
}

.taics-video-section p {
    color: #6c757d;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Video Slots Grid */
.taics-video-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1rem;
}

/* Video Slot Cards */
.taics-video-slot-card {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    transition: all 0.3s ease;
    cursor: pointer;
}

.taics-video-slot-card:hover {
    border-color: #6c757d;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.taics-video-slot-card.taics-video-slot-primary {
    border-left: 4px solid #dc3545;
}

.taics-video-slot-card.taics-video-slot-secondary {
    border-left: 4px solid #fd7e14;
}

/* Video Slot Header */
.taics-video-slot-header {
    margin-bottom: 1rem;
}

.taics-video-slot-header h4 {
    color: #495057;
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Video Preview */
.taics-video-preview {
    width: 100%;
    height: 150px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    overflow: hidden;
    position: relative;
}

.taics-empty-video-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.taics-empty-video-preview span {
    text-align: center;
}

.taics-video-preview iframe,
.taics-video-preview .taics-video-embed {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px;
}

.taics-video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: #6c757d;
    font-size: 0.9rem;
}

.taics-video-placeholder i {
    font-size: 2rem;
    color: #6c757d;
}

/* Video Actions */
.taics-video-actions {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.taics-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
}

.taics-btn-video {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.taics-btn-video:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    transform: translateY(-1px);
}

.taics-btn-remove {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
}

.taics-btn-remove:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-1px);
}

/* Video Input Fields */
.taics-video-url-field,
.taics-video-title-field {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.taics-video-url-field label,
.taics-video-title-field label {
    display: block;
    margin-bottom: 0.5rem;
    color: #495057;
    font-weight: 500;
    font-size: 0.9rem;
}

.taics-video-url-input,
.taics-video-title-input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
}

.taics-video-url-input:focus,
.taics-video-title-input:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.taics-video-title-input {
    height: auto;
}

/* Video Embed Styles */
.taics-video-embed {
    width: 100%;
    height: 100%;
}

.taics-video-container {
    position: relative;
}

.taics-video-title {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0,0,0,0.7);
    color: white;
    text-align: center;
    font-size: 0.9rem;
    border-radius: 0 0 8px 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .taics-video-slots-grid {
        grid-template-columns: 1fr;
    }

    .taics-video-section {
        padding: 1.5rem;
    }

    .taics-video-actions {
        flex-direction: column;
    }

    .taics-btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .taics-video-section {
        padding: 1rem;
    }

    .taics-video-slot-card {
        padding: 1rem;
    }

    .taics-video-preview {
        height: 120px;
    }
}

/* Dark Mode Styles */
[data-theme="dark"] .taics-video-section {
    background: linear-gradient(135deg, #343a40 0%, #212529 100%);
    border-color: #495057;
}

[data-theme="dark"] .taics-video-section h3 {
    color: #dee2e6;
}

[data-theme="dark"] .taics-video-section p {
    color: #adb5bd;
}

[data-theme="dark"] .taics-video-slot-card {
    background: #343a40;
    border-color: #495057;
}

[data-theme="dark"] .taics-video-slot-card:hover {
    border-color: #6c757d;
}

[data-theme="dark"] .taics-video-slot-header h4 {
    color: #dee2e6;
}

[data-theme="dark"] .taics-video-preview {
    background: #212529;
    border-color: #495057;
}

[data-theme="dark"] .taics-empty-video-preview,
[data-theme="dark"] .taics-video-placeholder {
    color: #adb5bd;
}

/* Dark Mode Support using body class (WordPress Standard) */
body.taics-dark-mode .taics-video-url-field,
body.taics-dark-mode .taics-video-title-field,
[data-theme="dark"] .taics-video-url-field,
[data-theme="dark"] .taics-video-title-field {
    background: #343a40 !important;
    border-color: #495057 !important;
}

body.taics-dark-mode .taics-video-url-field label,
body.taics-dark-mode .taics-video-title-field label,
[data-theme="dark"] .taics-video-url-field label,
[data-theme="dark"] .taics-video-title-field label {
    color: #e9ecef !important;
}

body.taics-dark-mode .taics-video-url-input,
body.taics-dark-mode .taics-video-title-input,
[data-theme="dark"] .taics-video-url-input,
[data-theme="dark"] .taics-video-title-input {
    background: #495057 !important;
    border-color: #6c757d !important;
    color: #fff !important;
}

body.taics-dark-mode .taics-video-slot-card,
[data-theme="dark"] .taics-video-slot-card {
    background: #343a40 !important;
    border-color: #495057 !important;
}

body.taics-dark-mode .taics-video-slot-header h4,
[data-theme="dark"] .taics-video-slot-header h4 {
    color: #f8f9fa !important;
}

[data-theme="dark"] .taics-video-url-input:focus,
[data-theme="dark"] .taics-video-title-input:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Animations */
@keyframes videoFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.taics-video-preview iframe,
.taics-video-preview .taics-video-embed {
    animation: videoFadeIn 0.3s ease-out;
}

/* Loading State */
.taics-video-loading {
    position: relative;
}

.taics-video-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #6c757d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success/Error States */
.taics-video-success {
    border-color: #28a745 !important;
    background-color: #d4edda !important;
}

.taics-video-error {
    border-color: #dc3545 !important;
    background-color: #f8d7da !important;
}

[data-theme="dark"] .taics-video-success {
    background-color: #155724 !important;
}

[data-theme="dark"] .taics-video-error {
    background-color: #721c24 !important;
}

/* Video Context Notification - Compact above title field */
.taics-video-context-notification {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 6px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    font-size: 13px;
}

.taics-video-context-notification .taics-notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.taics-video-context-notification .taics-notification-icon {
    font-size: 18px;
}

.taics-video-context-notification .taics-notification-text {
    flex: 1;
    font-weight: 500;
}

.taics-video-context-notification .taics-notification-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

/* Dark mode for notification */
body.taics-dark-mode .taics-video-context-notification,
[data-theme="dark"] .taics-video-context-notification {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
}

/* Video context mode styling in generate tab */
.taics-topic-fixed:disabled {
    background-color: rgba(244, 244, 245, 0.7) !important;
    color: #64666a !important;
    opacity: 0.8 !important;
}

body.taics-dark-mode .taics-topic-fixed:disabled,
[data-theme="dark"] .taics-topic-fixed:disabled {
    background-color: rgba(52, 58, 64, 0.7) !important;
    color: #adb5bd !important;
}

/* Under Construction Overlay for Video Slot 2 */
.taics-under-construction-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 10px;
}

.taics-under-construction .taics-video-preview,
.taics-under-construction .taics-video-actions,
.taics-under-construction .taics-video-url-field,
.taics-under-construction .taics-video-title-field {
    opacity: 0.5;
    pointer-events: none;
}

.taics-under-construction-overlay .taics-uc-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.taics-under-construction-overlay .taics-uc-icon {
    font-size: 32px;
}

.taics-under-construction-overlay .taics-uc-text {
    font-size: 14px;
    font-weight: 700;
    color: #212529;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Dark mode for under construction overlay */
body.taics-dark-mode .taics-under-construction-overlay,
[data-theme="dark"] .taics-under-construction-overlay {
    background: rgba(33, 37, 41, 0.9);
}

body.taics-dark-mode .taics-under-construction .taics-video-preview,
body.taics-dark-mode .taics-under-construction .taics-video-actions,
[data-theme="dark"] .taics-under-construction .taics-video-preview,
[data-theme="dark"] .taics-under-construction .taics-video-actions {
    opacity: 0.3;
}

body.taics-dark-mode .taics-under-construction-overlay .taics-uc-text,
[data-theme="dark"] .taics-under-construction-overlay .taics-uc-text {
    color: #fff;
}
/* =============================================================================
   v4.1.0 - Channel Monitor Panel (Slot 2, Mode 5)
   ============================================================================= */

.taics-monitor-panel {
    margin-top: 14px;
    padding: 14px;
    background: #f0f4ff;
    border: 1px solid #c3d1f5;
    border-radius: 10px;
}

/* --- Settings row (frequency + max posts) --- */
.taics-monitor-settings-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.taics-monitor-label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
}

.taics-monitor-select {
    font-size: 12px;
    padding: 5px 8px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: #fff;
    color: #212529;
    cursor: pointer;
}

/* --- Start button --- */
.taics-monitor-btn-start {
    display: block;
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.taics-monitor-btn-start:hover { opacity: 0.9; }
.taics-monitor-btn-start:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- Status badge --- */
.taics-monitor-status-badge {
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: #155724;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 6px 10px;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}

/* --- Status grid --- */
.taics-monitor-status-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.taics-monitor-stat {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 7px 10px;
}

.taics-monitor-stat-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 2px;
}

.taics-monitor-stat-value {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #212529;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* --- Stop button --- */
.taics-monitor-btn-stop {
    display: block;
    width: 100%;
    padding: 9px;
    background: linear-gradient(135deg, #dc3545 0%, #e55a67 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}
.taics-monitor-btn-stop:hover { opacity: 0.9; }
.taics-monitor-btn-stop:disabled { opacity: 0.6; cursor: not-allowed; }

/* --- Slot 2 active glow when monitoring --- */
.taics-monitor-active-slot {
    box-shadow: 0 0 0 2px #28a745, 0 4px 16px rgba(40, 167, 69, 0.2);
}

/* --- Dark mode --- */
body.taics-dark-mode .taics-monitor-panel,
[data-theme="dark"] .taics-monitor-panel {
    background: #1e2d1f;
    border-color: #2d5a30;
}

body.taics-dark-mode .taics-monitor-label,
[data-theme="dark"] .taics-monitor-label {
    color: #adb5bd;
}

body.taics-dark-mode .taics-monitor-select,
[data-theme="dark"] .taics-monitor-select {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.taics-dark-mode .taics-monitor-stat,
[data-theme="dark"] .taics-monitor-stat {
    background: #2d3748;
    border-color: #4a5568;
}

body.taics-dark-mode .taics-monitor-stat-value,
[data-theme="dark"] .taics-monitor-stat-value {
    color: #e2e8f0;
}

body.taics-dark-mode .taics-monitor-status-badge,
[data-theme="dark"] .taics-monitor-status-badge {
    background: #1a3d2b;
    border-color: #2d6a4f;
    color: #52b788;
}

/* =============================================================================
   v4.1.1 - Video slots inside combined media row (compact overrides)
   ============================================================================= */

/* Smaller preview height to match photo cards in the 5-column row */
.taics-combined-media-row .taics-video-preview {
    height: 80px;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(129, 140, 248, 0.3);
}

/* White text for empty state on dark indigo background */
.taics-combined-media-row .taics-empty-video-preview {
    color: rgba(199, 210, 254, 0.8);
    font-size: 0.8rem;
}
