/* ChronoCanvas — Global Styles */

/* CSS Custom Properties for theming */
:root {
    --color-primary-500: #0ea5e9;
    --color-primary-600: #0284c7;
    --color-secondary-500: #d946ef;
    --color-secondary-600: #c026d3;
}

/* Selection styling */
::selection {
    background: rgba(14, 165, 233, 0.3);
    color: white;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(30, 41, 59, 0.5);
}

::-webkit-scrollbar-thumb {
    background: rgba(71, 85, 105, 0.8);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(100, 116, 139, 0.8);
}

/* Form element focus states */
input:focus, select:focus {
    outline: none;
}

/* Platform button active state */
.platform-btn.active {
    background: rgba(14, 165, 233, 0.2);
    border-color: rgba(14, 165, 233, 0.5);
    color: #38bdf8;
}

/* Theme button active state */
.theme-btn.active {
    border-color: var(--color-primary-500);
}

.theme-btn.active .absolute {
    opacity: 1 !important;
}

/* Accent button active state */
.accent-btn.active {
    ring-color: var(--color-primary-500) !important;
    transform: scale(1.1);
}

/* Canvas rendering */
canvas {
    image-rendering: -moz-crisp-edges;
    image-rendering: -webkit-crisp-edges;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Animation utilities */
@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fade-in 0.5s ease-out;
}

/* Glass morphism enhancement */
.glass {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Gradient text animation */
.gradient-text {
    background-size: 200% 200%;
    animation: gradient-shift 3s ease infinite;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Render page specific — no UI */
.render-body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: #000;
}

.render-canvas {
    display: block;
    width: 100vw;
    height: 100vh;
    object-fit: contain;
}

/* Loading state for render page */
.render-loading {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
    color: #94a3b8;
    font-family: system-ui, -apple-system, sans-serif;
    font-size: 14px;
    z-index: 100;
}

.render-loading.hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* Ensure canvas is crisp on all displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    canvas {
        image-rendering: auto;
    }
}

/* Mobile optimizations */
@media (max-width: 640px) {
    .platform-btn,
    .theme-btn {
        padding: 0.75rem 0.5rem;
        font-size: 0.75rem;
    }
    
    .platform-btn i,
    .theme-btn i {
        width: 1rem;
        height: 1rem;
    }
}

/* Print styles — hide UI */
@media print {
    header, main, .toast {
        display: none !important;
    }
    
    body {
        background: white !important;
    }
}