/*
 * Cast Conductor Proprietary License v5
 * SPDX-License-Identifier: LicenseRef-CastConductor-Proprietary-v5
 * 
 * Copyright (c) 2025 CastConductor.com. All Rights Reserved.
 * 
 * This file is part of Cast Conductor ("Software"). The Software and its source
 * code constitute proprietary, confidential, and trade secret information of
 * CastConductor.com ("Company"). Any access or use is governed strictly by the
 * Cast Conductor Proprietary License v5 ("License"). By installing, copying,
 * accessing, compiling, or otherwise using the Software you agree to be bound by
 * all terms of the License. If you do not agree, you must cease use immediately.
 * 
 * Key Terms (Summary – see full License for binding terms):
 *  1. No Redistribution: You may not publish, distribute, sublicense, rent,
 *     lease, transfer, sell, or otherwise make the Software (or any derivative)
 *     available to any third party without prior written consent of Company.
 *  2. No Modification: Modification, reverse engineering, decompilation, or
 *     disassembly is prohibited except to the limited extent expressly permitted
 *     by applicable law that cannot be contractually waived.
 *  3. Confidentiality: Treat all source code and related artifacts as Company
 *     Confidential Information. Maintain at least the same degree of care as for
 *     your own confidential materials, and not less than reasonable care.
 *  4. No Patent License: No express or implied patent rights are granted. Future
 *     patents (if any) are fully reserved.
 *  5. No Trademark License: Company names, marks, and logos may not be used
 *     without prior written permission.
 *  6. Limited Internal Use: Use is limited solely to internal evaluation and
 *     operation of licensed Cast Conductor deployments. Commercial hosting or
 *     resale as a service requires a separate written agreement.
 *  7. Telemetry & License Validation: The Software may periodically transmit a
 *     hashed installation identifier, domain (or site ID), plugin/app version,
 *     and a truncated (non-reversible) fragment of the license key solely to
 *     validate activation status and enforce licensing. This minimal "phone home"
 *     check contains no personal or content data. If optional telemetry is later
 *     introduced it will be limited to aggregate operational metrics (no PII),
 *     fully documented, and optionally disableable per published instructions.
 *  8. Third-Party Components: The Software may include open source components
 *     covered by their own licenses. See THIRD-PARTY-NOTICES.md. Those licenses
 *     govern their respective components; this License governs all remaining code.
 *  9. Export Compliance: You are responsible for compliance with all applicable
 *     export control and sanctions laws.
 * 10. Warranty Disclaimer: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF
 *     ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO MERCHANTABILITY,
 *     FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT.
 * 11. Limitation of Liability: IN NO EVENT WILL COMPANY OR AUTHORS BE LIABLE FOR
 *     ANY INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE
 *     DAMAGES, OR LOST PROFITS, EVEN IF ADVISED OF THE POSSIBILITY.
 * 12. Acceptance: Use of the Software constitutes acceptance of the License.
 * 13. Enforcement: Unauthorized reproduction or distribution may result in civil
 *     and criminal penalties and will be prosecuted to the maximum extent allowed
 *     by law.
 * 
 * Authoritative EULA: EULA-v5.1.md (repository root – private) and https://castconductor.com/eula
 * Precedence: If this summary conflicts with the EULA, the EULA governs.
 * Revision: Current EULA revision v5.1 (subject to update; check EULA for current enterprise thresholds).
 * 
 * Full License text available from: licensing@castconductor.com
 * Security reports: security@castconductor.com
 * Commercial inquiries: licensing@castconductor.com
 * 
 * END OF HEADER
 */
/* Content Blocks Grid */
.content-blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.content-block-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    position: relative;
    transition: box-shadow 0.3s ease;
}

.content-block-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.content-block-card h3 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: 600;
}

.content-block-meta {
    margin-bottom: 15px;
}

.content-block-type {
    background: #2271b1;
    color: white;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    text-transform: uppercase;
    margin-right: 8px;
}

.status {
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.status.enabled {
    background: #00a32a;
    color: white;
}

.status.disabled {
    background: #dba617;
    color: white;
}

.content-block-info {
    margin-bottom: 15px;
    font-size: 13px;
    color: #666;
}

.content-block-info p {
    margin: 2px 0;
}

.content-block-actions {
    margin-top: 15px;
}

.content-block-actions button {
    margin-right: 5px;
    margin-bottom: 5px;
}

/* Content Block Type Styling */
.content-block-card.type-track-info {
    border-left: 4px solid #8b5cf6;
}

.content-block-card.type-shoutout {
    border-left: 4px solid #06b6d4;
}

.content-block-card.type-sponsor {
    border-left: 4px solid #10b981;
}

.content-block-card.type-promo {
    border-left: 4px solid #f59e0b;
}

.content-block-card.type-weather {
    border-left: 4px solid #3b82f6;
}

.content-block-card.type-location-time {
    border-left: 4px solid #8b5cf6;
}

.content-block-card.type-custom-api {
    border-left: 4px solid #ef4444;
}

.content-block-card.type-custom {
    border-left: 4px solid #6b7280;
}

/* Modal Styles */
.castconductor-modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
}

.close, .close-preview {
    font-size: 24px;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.close:hover, .close-preview:hover {
    color: #333;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #ddd;
    text-align: right;
    flex-shrink: 0;
}

.modal-footer button {
    margin-left: 10px;
}

/* Form Styles */
#content-block-form .form-table th {
    padding-left: 0;
}

#type-specific-config {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

#visual-config-preview {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.content-block-preview {
    border: 1px solid #ddd;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 4px;
    min-height: 100px;
}

/* Preview Modal Specific */
.preview-container {
    background: #000;
    color: #fff;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.preview-info h4 {
    margin: 0 0 10px 0;
    color: #495057;
}

.preview-info pre {
    background: #fff;
    border: 1px solid #dee2e6;
    padding: 10px;
    border-radius: 3px;
    font-size: 12px;
    max-height: 200px;
    overflow-y: auto;
}

/* Track Info Preview */
.castconductor-preview.castconductor-track-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.castconductor-preview .album-artwork {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    object-fit: cover;
}

.castconductor-preview .track-details {
    flex-grow: 1;
}

.castconductor-preview .artist {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.castconductor-preview .title {
    font-size: 14px;
    margin-bottom: 3px;
}

.castconductor-preview .album {
    font-size: 12px;
    opacity: 0.8;
}

/* Shoutout Preview */
.castconductor-preview.castconductor-shoutout .message {
    font-style: italic;
    margin-bottom: 10px;
    font-size: 14px;
}

.castconductor-preview.castconductor-shoutout .author {
    text-align: right;
    font-size: 12px;
    opacity: 0.8;
}

/* Loading and Empty States */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-style: italic;
}

.no-content-blocks {
    text-align: center;
    padding: 40px;
    color: #666;
}

.no-content-blocks a {
    color: #2271b1;
    text-decoration: none;
    font-weight: 500;
}

.no-content-blocks a:hover {
    text-decoration: underline;
}

/* Error States */
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 4px;
    border: 1px solid #f1aeb5;
    text-align: center;
}

/* Notice Styles */
.notice {
    margin: 15px 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content-blocks-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        max-height: 95vh;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 15px;
    }
    
    .content-block-actions button {
        display: block;
        width: 100%;
        margin-bottom: 5px;
        margin-right: 0;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.castconductor-modal .modal-content {
    animation: fadeIn 0.3s ease;
}

/* Accessibility */
.castconductor-modal:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

button:focus, input:focus, select:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.close:focus, .close-preview:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
    border-radius: 2px;
}
