/*
 * 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
 */

/* ========================================
   CastConductor Brand Design System
   Matching castconductor.com website
   ======================================== */

:root {
    /* Brand Colors */
    --cc-bg-dark: #111;
    --cc-bg-gradient-start: rgb(30, 30, 30);
    --cc-bg-gradient-end: rgb(93, 45, 122);
    --cc-text-primary: #fff;
    --cc-text-secondary: #ccc;
    --cc-text-muted: #999;
    --cc-accent-pink: #e879f9;
    --cc-accent-purple: #a855f7;
    --cc-success: #22c55e;
    --cc-error: #ef4444;
    --cc-warning: #ffc107;
    --cc-button-blue: #3b82f6;
    --cc-button-blue-hover: #2563eb;
    --cc-card-bg: rgba(255, 255, 255, 0.05);
    --cc-card-border: rgba(255, 255, 255, 0.1);
    --cc-input-border: rgba(255, 255, 255, 0.2);
    --cc-input-bg: rgba(0, 0, 0, 0.5);
    --cc-glow-pink: 0 0 30px rgba(232, 121, 249, 0.4);
    --cc-glow-success: 0 0 10px rgba(34, 197, 94, 0.3);
    --cc-radius-lg: 16px;
    --cc-radius-md: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--cc-text-primary);
    background-color: var(--cc-bg-dark);
    background-image: url('albacore-noise.gif');
    background-repeat: repeat;
    background-attachment: fixed;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

/* Removed ::after overlay - noise is now applied directly to body background */

.container {
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(135deg, rgb(30, 30, 30) 0%, rgb(60, 30, 80) 100%);
    border: 1px solid var(--cc-card-border);
    border-radius: var(--cc-radius-lg);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

header {
    background: linear-gradient(135deg, var(--cc-bg-gradient-start) 0%, var(--cc-bg-gradient-end) 100%);
    color: var(--cc-text-primary);
    padding: 40px;
    text-align: center;
    border-bottom: 1px solid var(--cc-card-border);
}

header h1 {
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 900;
    margin-bottom: 10px;
    line-height: 1.1;
}

header p {
    font-size: clamp(1rem, 1.5vw, 1.25rem);
    color: var(--cc-text-secondary);
}

.steps {
    padding: 40px;
    background: transparent;
}

.step {
    margin-bottom: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid var(--cc-card-border);
}

.step:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.step h2 {
    color: var(--cc-text-primary);
    margin-bottom: 20px;
    font-size: 1.5em;
    font-weight: 700;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--cc-text-primary);
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid var(--cc-input-border);
    border-radius: var(--cc-radius-md);
    font-size: 16px;
    background: var(--cc-input-bg);
    color: var(--cc-text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.form-group input::placeholder {
    color: #888;
}

.form-group input:focus {
    outline: none;
    border-color: var(--cc-accent-pink);
    box-shadow: 0 0 15px rgba(232, 121, 249, 0.4);
}

.form-group input.valid {
    border-color: var(--cc-success);
    box-shadow: var(--cc-glow-success);
}

.form-group input.invalid {
    border-color: var(--cc-error);
    box-shadow: none;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: var(--cc-text-muted);
    font-size: 14px;
}

/* Optional field label styling */
.optional-label {
    font-weight: 400;
    font-size: 12px;
    color: var(--cc-text-muted);
    margin-left: 4px;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: var(--cc-radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn.primary {
    background: var(--cc-button-blue);
    color: var(--cc-text-primary);
}

.btn.primary:hover {
    background: var(--cc-button-blue-hover);
    transform: scale(1.02);
}

.btn.secondary {
    background: var(--cc-card-bg);
    color: var(--cc-text-secondary);
    border: 2px solid var(--cc-card-border);
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn.success {
    background: linear-gradient(135deg, var(--cc-accent-pink) 0%, var(--cc-accent-purple) 100%);
    color: #000;
    font-size: 18px;
    padding: 16px 32px;
    font-weight: 700;
}

.btn.success:hover {
    background: linear-gradient(135deg, #d946ef 0%, #9333ea 100%);
    transform: scale(1.02);
    box-shadow: var(--cc-glow-pink);
}

.btn.disabled, .btn:disabled {
    background: #4b5563;
    cursor: not-allowed;
    opacity: 0.7;
    pointer-events: none;
}

.plugin-info {
    background: rgba(232, 121, 249, 0.08);
    padding: 20px;
    border-radius: var(--cc-radius-md);
    border-left: 4px solid var(--cc-accent-pink);
    border: 2px solid rgba(232, 121, 249, 0.3);
}

.plugin-info ol {
    margin: 15px 0;
    padding-left: 20px;
    color: var(--cc-text-secondary);
}

.plugin-info li {
    margin-bottom: 8px;
}

.download-info {
    text-align: center;
    padding: 30px;
    background: rgba(232, 121, 249, 0.08);
    border: 2px solid rgba(232, 121, 249, 0.4);
    border-radius: var(--cc-radius-lg);
    box-shadow: var(--cc-glow-pink);
    color: var(--cc-text-primary);
}

.download-info p {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--cc-text-secondary);
}

.installation-guide {
    background: var(--cc-card-bg);
    border: 1px solid var(--cc-card-border);
    padding: 20px;
    border-radius: var(--cc-radius-md);
    margin-top: 20px;
    text-align: left;
    color: var(--cc-text-secondary);
}

.installation-guide h3 {
    margin-bottom: 15px;
    color: var(--cc-text-primary);
}

.installation-guide ol {
    padding-left: 20px;
}

.installation-guide li {
    margin-bottom: 8px;
    color: var(--cc-text-secondary);
}

.status {
    padding: 20px;
    margin: 20px;
    border-radius: var(--cc-radius-md);
    display: none;
}

.status.success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
    display: block;
}

.status.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
    display: block;
}

.status.loading {
    background: rgba(232, 121, 249, 0.15);
    color: var(--cc-accent-pink);
    border: 1px solid rgba(232, 121, 249, 0.4);
    display: block;
}

#plugin-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
}

#plugin-status.success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

#plugin-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

/* Loading animation */
.loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--cc-accent-pink);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s ease-in-out infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: var(--cc-radius-md);
    }
    
    header {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .steps {
        padding: 30px 20px;
    }
}

/* License Validation Styles */
.license-info {
    background: rgba(232, 121, 249, 0.08);
    padding: 20px;
    border-radius: var(--cc-radius-md);
    border: 2px solid rgba(232, 121, 249, 0.3);
}

#license-status {
    margin-top: 15px;
    padding: 10px;
    border-radius: 6px;
}

#license-status.success {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.4);
}

#license-status.error {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.usage-counter {
    margin-top: 15px;
    font-size: 14px;
    color: var(--cc-text-muted);
}

.usage-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.usage-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--cc-accent-pink), var(--cc-accent-purple));
    border-radius: 4px;
    transition: width 0.3s ease;
}

#usage-info {
    margin-top: 15px;
    padding: 15px;
    background: rgba(232, 121, 249, 0.08);
    border-radius: var(--cc-radius-md);
    border: 1px solid rgba(232, 121, 249, 0.3);
    color: var(--cc-text-secondary);
}

/* Artwork Upload Styles */
.artwork-intro {
    color: var(--cc-text-muted);
    margin-bottom: 10px;
}

.artwork-tip-ideogram {
    background: rgba(232, 121, 249, 0.08);
    padding: 12px 16px;
    border-radius: var(--cc-radius-md);
    border: 2px solid rgba(232, 121, 249, 0.3);
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--cc-text-secondary);
}

.artwork-tip-ideogram a {
    color: var(--cc-accent-pink);
    font-weight: 600;
}

.artwork-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.artwork-item {
    background: var(--cc-card-bg);
    padding: 15px;
    border-radius: var(--cc-radius-md);
    border: 2px dashed var(--cc-card-border);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.artwork-item:hover {
    border-color: var(--cc-accent-pink);
    box-shadow: 0 0 15px rgba(232, 121, 249, 0.2);
}

.artwork-item label {
    display: block;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--cc-text-primary);
}

.artwork-preview {
    width: 100%;
    height: 100px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    overflow: hidden;
    position: relative;
}

.artwork-preview.wide {
    height: 100px;  /* Same height as icons for consistency */
}

.artwork-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;  /* Preserve aspect ratio within viewport */
    background: rgba(0, 0, 0, 0.3);
}

.artwork-preview .placeholder {
    color: var(--cc-text-muted);
    font-size: 12px;
    text-align: center;
}

.artwork-item input[type="file"] {
    width: 100%;
    padding: 8px;
    font-size: 12px;
    border: 1px solid var(--cc-card-border);
    border-radius: 4px;
    cursor: pointer;
    background: var(--cc-input-bg);
    color: var(--cc-text-secondary);
}

.artwork-item small {
    display: block;
    margin-top: 8px;
    color: var(--cc-text-muted);
    font-size: 11px;
    line-height: 1.4;
}

.artwork-tips {
    background: rgba(255, 193, 7, 0.1);
    padding: 15px 20px;
    border-radius: var(--cc-radius-md);
    border: 2px solid rgba(255, 193, 7, 0.4);
}

.artwork-tips h4 {
    margin: 0 0 10px 0;
    color: #ffc107;
}

.artwork-tips ul {
    margin: 0;
    padding-left: 20px;
}

.artwork-tips li {
    margin-bottom: 5px;
    color: var(--cc-text-secondary);
    font-size: 13px;
}

/* Generate Step Styles */
.generate-info {
    text-align: center;
    padding: 30px;
    background: var(--cc-card-bg);
    border: 1px solid var(--cc-card-border);
    border-radius: var(--cc-radius-lg);
}

.generate-info p {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--cc-text-secondary);
}

/* Certification Note */
.certification-note {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 14px;
    color: var(--cc-text-secondary);
}

.certification-note a {
    color: var(--cc-accent-pink);
    text-decoration: underline;
}

/* Roku Disclaimer */
.roku-disclaimer {
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid rgba(255, 193, 7, 0.4);
    border-radius: var(--cc-radius-md);
    padding: 15px;
    margin: 20px 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--cc-text-secondary);
}

.roku-disclaimer strong {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #ffc107;
}

.roku-disclaimer p {
    margin: 0;
    color: var(--cc-text-secondary);
}

/* Installation Guide Improvements */
.installation-guide code {
    background: rgba(232, 121, 249, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    color: var(--cc-accent-pink);
}

.installation-guide a {
    color: var(--cc-accent-pink);
    text-decoration: underline;
}

/* Disabled State */
.step.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* Rate Limit Warning */
.rate-limit-warning {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    padding: 15px;
    border-radius: var(--cc-radius-md);
    border: 1px solid rgba(239, 68, 68, 0.4);
    margin-top: 15px;
}

.rate-limit-warning strong {
    display: block;
    margin-bottom: 5px;
    color: #f87171;
}
