/* ===================================
   Kick Raffle System V2 - Effects Styles
   =================================== */

/* ============ Effects Container ============ */
.effects-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: var(--z-effects);
    overflow: hidden;
}

/* ============ Canvas (shared by all canvas-based effects) ============ */
.effect-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* ============ Custom Flying Images (DOM-based) ============ */
.effect-flying-formation {
    position: fixed;
    pointer-events: none;
    z-index: var(--z-effects);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.effect-flying-formation.flying { opacity: 1; }

.effect-flying-item {
    position: absolute;
    width: 60px;
    height: 60px;
    transition: transform 0.3s ease;
}

.effect-flying-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 8px var(--accent-glow));
    animation: effectFlyingBob 0.4s ease-in-out infinite;
}

@keyframes effectFlyingBob {
    0%, 100% { transform: scaleY(1); }
    50% { transform: scaleY(0.92); }
}

.effect-flying-formation-1 { animation: effectFlyPath1 9s linear infinite; }
.effect-flying-formation-2 { animation: effectFlyPath2 11s linear infinite; }
.effect-flying-formation-3 { animation: effectFlyPath3 10s linear infinite; }
.effect-flying-formation-4 { animation: effectFlyPath4 12s linear infinite; }

@keyframes effectFlyPath1 { 0% { transform: translate(-200px, 15vh); } 100% { transform: translate(calc(100vw + 200px), 25vh); } }
@keyframes effectFlyPath2 { 0% { transform: translate(calc(100vw + 200px), 45vh) scaleX(-1); } 100% { transform: translate(-200px, 55vh) scaleX(-1); } }
@keyframes effectFlyPath3 { 0% { transform: translate(-200px, 70vh) rotate(15deg); } 100% { transform: translate(calc(100vw + 200px), 60vh) rotate(15deg); } }
@keyframes effectFlyPath4 { 0% { transform: translate(calc(100vw + 200px), 20vh) scaleX(-1) rotate(-10deg); } 100% { transform: translate(-200px, 35vh) scaleX(-1) rotate(-10deg); } }

.effect-flying-formation.scattering .effect-flying-item {
    animation: effectFlyScatter 1.2s ease-out forwards;
}

@keyframes effectFlyScatter {
    0% { opacity: 1; }
    20% { transform: scale(1.2); }
    100% { transform: translate(var(--scatter-x), var(--scatter-y)) rotate(var(--scatter-rot)) scale(0.3); opacity: 0; }
}

/* ============ Effects Settings Grid ============ */
.effects-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.effect-checkbox {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 8px 10px;
    background: var(--surface-dark);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    user-select: none;
}

.effect-checkbox:hover {
    border-color: var(--accent-primary);
    background: rgba(145, 47, 64, 0.1);
}

.effect-checkbox:has(input:checked) {
    border-color: var(--accent-primary);
    background: rgba(145, 47, 64, 0.15);
    color: var(--text-primary);
}

.effect-checkbox input[type="checkbox"],
.effect-checkbox input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-default);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
    position: relative;
    transition: all var(--transition-fast);
}

.effect-checkbox input[type="radio"] {
    border-radius: 50%;
}

.effect-checkbox input[type="checkbox"]:checked,
.effect-checkbox input[type="radio"]:checked {
    background: var(--accent-gradient);
    border-color: var(--accent-primary);
}

.effect-checkbox input[type="checkbox"]:checked::after,
.effect-checkbox input[type="radio"]:checked::after {
    content: '\2713';
    position: absolute;
    top: -1px;
    left: 2px;
    font-size: 11px;
    font-weight: bold;
    color: var(--text-primary);
}

.effect-checkbox input[type="radio"]:checked::after {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-primary);
    top: 3px;
    left: 3px;
}

/* Audio source radio row */
.audio-source-radios {
    display: flex;
    gap: 6px;
}

.effect-checkbox-wide {
    grid-column: 1 / -1;
}

/* Custom images upload in effects settings */
.effect-images-section {
    margin-top: var(--space-sm);
}

.effect-image-item {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 6px 8px;
    background: var(--surface-dark);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
}

.effect-image-preview {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.2);
}

.effect-image-info {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.effect-image-name {
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.effect-image-size {
    font-size: var(--font-size-xs);
    color: var(--text-muted);
}

.effect-image-remove {
    flex-shrink: 0;
    background: rgba(255, 71, 87, 0.2);
    border: none;
    color: var(--error);
    border-radius: var(--radius-full);
    width: 24px;
    height: 24px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.effect-image-remove:hover {
    background: var(--error);
    color: white;
}

.effect-upload-area {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: var(--space-sm);
    background: var(--surface-dark);
    border: 1px dashed var(--border-default);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: var(--font-size-sm);
    color: var(--text-muted);
}

.effect-upload-area:hover {
    border-color: var(--accent-primary);
    background: rgba(145, 47, 64, 0.05);
}

.effect-upload-area input[type="file"] {
    display: none;
}

/* Custom images mode selector */
.custom-images-mode-section {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-sm);
}

.custom-images-mode-section .input-label {
    margin: 0;
    white-space: nowrap;
    font-size: var(--font-size-sm);
}

.custom-images-mode-section .select {
    flex: 1;
}
