/* C2PA Live Stream Player Styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px;
}

@media (min-width: 768px) {
    .container {
        padding: 20px;
    }
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

@media (min-width: 768px) {
    header {
        padding: 30px;
        margin-bottom: 30px;
    }
}

.header-logo {
    margin-bottom: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-logo img {
    max-width: 200px;
    height: auto;
    filter: brightness(0) invert(1);
}

@media (min-width: 768px) {
    .header-logo img {
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .header-logo img {
        max-width: 150px;
    }
}

header h1 {
    font-size: 1.75em;
    margin-bottom: 8px;
}

@media (min-width: 768px) {
    header h1 {
        font-size: 2.5em;
        margin-bottom: 10px;
    }
}

.subtitle {
    font-size: 0.95em;
    opacity: 0.9;
}

@media (min-width: 768px) {
    .subtitle {
        font-size: 1.1em;
    }
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

@media (min-width: 768px) {
    .main-content {
        gap: 30px;
    }
}

/* Player Section */
.player-section {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .player-section {
        padding: 25px;
    }
}

.stream-selector {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

@media (min-width: 768px) {
    .stream-selector {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }
}

.stream-selector label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.stream-select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

@media (min-width: 768px) {
    .stream-select {
        flex: 1;
        min-width: 200px;
    }
}

.custom-url-input {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

@media (min-width: 768px) {
    .custom-url-input {
        flex: 1;
        min-width: 200px;
    }
}

.video-container {
    position: relative;
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
    aspect-ratio: 16 / 9;
}

#videoPlayer {
    width: 100%;
    height: 100%;
    display: block;
}

.loading-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: white;
    z-index: 10;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

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

.player-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    padding: 12px 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.player-controls-left {
    display: flex;
    gap: 10px;
    align-items: center;
    flex: 0 0 auto;
}

.player-controls-right {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: 0 0 auto;
    margin-left: auto;
}

@media (max-width: 480px) {
    .player-controls {
        flex-direction: column;
        gap: 12px;
        padding: 10px 0;
    }
    
    .player-controls-left,
    .player-controls-right {
        width: 100%;
        justify-content: center;
    }
    
    .player-controls-left .btn {
        flex: 1;
    }
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    min-width: 80px;
}

@media (min-width: 768px) {
    .btn {
        width: auto;
    }
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}

.status-ready {
    background: #6c757d;
}

.status-connecting {
    background: #ffc107;
    animation: pulse 1.5s ease-in-out infinite;
}

.status-connected {
    background: #28a745;
}

.status-error {
    background: #dc3545;
}

.status-disconnected {
    background: #6c757d;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-text {
    font-size: 13px;
    color: #666;
    font-weight: 500;
    white-space: nowrap;
}

/* Verification Section */
.verification-section {
    background: white;
    padding: 12px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .verification-section {
        padding: 15px;
    }
}

.verification-section h2 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1.2em;
}

.verification-section h3 {
    margin-top: 15px;
    margin-bottom: 8px;
    color: #555;
    font-size: 1em;
}

.verification-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 10px;
}

.verification-header h3 {
    margin: 0;
    flex: 1;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.toggle-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: #667eea;
}

.toggle-label span {
    font-weight: 500;
}

.verification-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

@media (max-width: 768px) {
    .verification-summary {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

.summary-item {
    padding: 8px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #667eea;
}

.summary-label {
    display: block;
    font-size: 10px;
    color: #666;
    margin-bottom: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.summary-value {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.summary-value.verified {
    color: #28a745;
}

.summary-value.failed {
    color: #dc3545;
}

.summary-value.pending {
    color: #ffc107;
}

.verification-log {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 8px;
    background: #fafafa;
}

@media (min-width: 768px) {
    .verification-log {
        max-height: 250px;
        padding: 10px;
    }
}

.empty-message {
    text-align: center;
    color: #999;
    padding: 20px;
    font-style: italic;
    font-size: 12px;
}

.log-entry {
    padding: 8px 10px;
    margin-bottom: 6px;
    border-radius: 4px;
    border-left: 3px solid #ddd;
    background: white;
    transition: all 0.2s ease;
}

.log-entry:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.log-verified {
    border-left-color: #28a745;
    background: #f0fff4;
}

.log-failed,
.log-error {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.log-pending {
    border-left-color: #ffc107;
    background: #fffbf0;
}

.log-info {
    border-left-color: #17a2b8;
    background: #f0f9ff;
}

.log-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}

.log-icon {
    font-weight: bold;
    font-size: 14px;
}

.log-verified .log-icon {
    color: #28a745;
}

.log-failed .log-icon,
.log-error .log-icon {
    color: #dc3545;
}

.log-pending .log-icon {
    color: #ffc107;
}

.log-info .log-icon {
    color: #17a2b8;
}

.log-segment {
    flex: 1;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-time {
    font-size: 9px;
    color: #999;
}

.log-message {
    font-size: 11px;
    color: #666;
    margin-top: 3px;
}

.log-details {
    margin-top: 6px;
    padding: 6px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 10px;
    overflow-x: auto;
}

.log-details pre {
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-family: 'Courier New', monospace;
    color: #555;
}

/* Verify VoD Stream Section */
.verify-vod-section {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
    .verify-vod-section {
        padding: 25px;
    }
}

.verify-vod-section h2 {
    margin-bottom: 8px;
    color: #333;
    font-size: 1.2em;
}

.verify-vod-section .section-description {
    font-size: 13px;
    color: #666;
    margin-bottom: 15px;
}

.verify-vod-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .verify-vod-controls {
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
    }
}

.verify-vod-controls label {
    font-weight: 600;
    color: #555;
    font-size: 14px;
}

.verify-vod-controls .verify-url-input {
    flex: 1;
    min-width: 0;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.verify-status-message {
    margin-bottom: 12px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f8f9fa;
    border-left: 4px solid #6c757d;
}

.verify-status-message.status-info {
    border-left-color: #17a2b8;
}

.verify-status-message.status-success {
    border-left-color: #28a745;
    background: #f0fff4;
}

.verify-status-message.status-error {
    border-left-color: #dc3545;
    background: #fff5f5;
}

.verify-status-message .verify-status {
    font-weight: 600;
    margin-right: 8px;
}

.verify-status-message .verify-status.status-info,
.verify-status-message .verify-status.status-info + .verify-message {
    color: #0c5460;
}

.verify-status-message .verify-status.status-success,
.verify-status-message .verify-status.status-success + .verify-message {
    color: #155724;
}

.verify-status-message .verify-status.status-error,
.verify-status-message .verify-status.status-error + .verify-message {
    color: #721c24;
}

.verify-status-message .verify-message {
    color: #333;
}

.verify-result-container {
    margin-top: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fafafa;
}

.verify-validation-summary {
    padding: 12px 15px;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

.verify-validation-summary.valid {
    background: linear-gradient(135deg, #e7f1ff 0%, #d4edda 100%);
    border-left: 4px solid #28a745;
}

.verify-validation-summary.invalid {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left: 4px solid #dc3545;
}

.verify-validation-summary .validation-status {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.verify-validation-summary .validation-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.verify-validation-summary .validation-icon.success {
    background: #28a745;
    color: white;
}

.verify-validation-summary .validation-icon.error {
    background: #dc3545;
    color: white;
}

.verify-validation-summary .validation-details {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.verify-result-section {
    border-top: 1px solid #e0e0e0;
}

.verify-result-section .collapsible-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    font-size: 14px;
    text-align: left;
    transition: background 0.2s ease;
}

.verify-result-section .collapsible-header:hover {
    background: #e5e5e5;
}

.verify-result-section .collapsible-header h4 {
    margin: 0;
    font-size: 1em;
    color: #333;
}

.verify-result-section .collapsible-icon {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s ease;
}

.verify-result-section .collapsible-icon.collapsed {
    transform: rotate(-90deg);
}

.verify-result-section .collapsible-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.2s ease;
}

.verify-result-section .collapsible-content.expanded {
    max-height: 70vh;
    overflow: auto;
}

.verify-result-section .full-response-inner {
    padding: 12px 15px;
    background: #1e1e1e;
    margin: 0;
}

.verify-result-section .json-display {
    margin: 0;
    padding: 0;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #d4d4d4;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.verify-result-section .copy-response-btn {
    margin: 10px 15px;
    width: auto;
    min-width: 80px;
}

/* Scrollbar styling */
.verification-log::-webkit-scrollbar {
    width: 8px;
}

.verification-log::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.verification-log::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.verification-log::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Floating Monitor Button */
.floating-monitor-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #667eea;
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1000;
}

.floating-monitor-btn:hover {
    background: #5568d3;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.floating-monitor-btn:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .floating-monitor-btn {
        width: 48px;
        height: 48px;
        bottom: 15px;
        right: 15px;
    }
}

/* Monitor Panel */
.monitor-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    pointer-events: none;
}

.monitor-panel[style*="display: block"] {
    pointer-events: all;
}

.monitor-panel-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.monitor-panel[style*="display: block"] .monitor-panel-backdrop {
    opacity: 1;
}

.monitor-panel-content {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 90%;
    max-width: 600px;
    background: white;
    box-shadow: -4px 0 12px rgba(0, 0, 0, 0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 768px) {
    .monitor-panel-content {
        width: 100%;
        max-width: 100%;
    }
}

.monitor-panel[style*="display: block"] .monitor-panel-content {
    transform: translateX(0);
}

.monitor-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f8f9fa;
}

.monitor-panel-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: #333;
}

.monitor-panel-actions {
    display: flex;
    gap: 10px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #666;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: #e0e0e0;
    color: #333;
}

.monitor-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.monitor-loading,
.monitor-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    text-align: center;
    color: #666;
}

.monitor-error {
    color: #dc3545;
}

.monitor-content {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.monitor-section {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 20px;
}

.monitor-section:last-child {
    border-bottom: none;
}

.monitor-section h3 {
    margin: 0 0 15px 0;
    font-size: 1.2em;
    color: #333;
}

.monitor-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.metric-card {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.metric-label {
    font-size: 12px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.metric-value {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.metric-value-large {
    font-size: 28px;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.metric-details {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: #667eea;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-fill.warning {
    background: #ffc107;
}

.progress-fill.danger {
    background: #dc3545;
}

.services-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.service-card {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

.service-card.status-stopped {
    border-left-color: #dc3545;
}

.service-card.status-exited {
    border-left-color: #6c757d;
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.service-name {
    font-weight: 600;
    color: #333;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.service-status {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    background: #28a745;
    color: white;
    text-transform: uppercase;
    font-weight: 600;
}

.service-status.status-stopped,
.service-status.status-exited {
    background: #dc3545;
}

.service-info {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    font-size: 12px;
    color: #666;
}

.service-info-item {
    display: flex;
    justify-content: space-between;
}

.logs-viewer {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.6;
}

.log-entry-line {
    margin-bottom: 4px;
    word-wrap: break-word;
}

.log-entry-line.error {
    color: #f48771;
}

.log-entry-line.warning {
    color: #dcdcaa;
}

.log-entry-line.info {
    color: #9cdcfe;
}

.log-timestamp {
    color: #808080;
    margin-right: 8px;
}

.log-service {
    color: #4ec9b0;
    margin-right: 8px;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    header {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    .subtitle {
        font-size: 0.85em;
    }
    
    .player-section,
    .verification-section {
        padding: 12px;
    }
    
    .summary-value {
        font-size: 20px;
    }
    
    .verification-log {
        max-height: 300px;
        padding: 10px;
    }
    
    .log-segment {
        font-size: 11px;
    }
    
    .log-message {
        font-size: 12px;
    }
    
    .monitor-panel-body {
        padding: 15px;
    }
    
    .monitor-metrics {
        grid-template-columns: 1fr;
    }
}
