﻿

.animation-ui {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: clamp(30rem, 60vw, 50rem);
    min-width: 25rem;
    max-width: 95vw;
    display: flex;
    flex-direction: row;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(0.625rem);
    -webkit-backdrop-filter: blur(0.625rem);
    border-radius: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.4);
    align-items: center;
    box-sizing: border-box;
    font-size: clamp(14px, 2vw, 18px);
}

    .animation-ui button {
        font-size: clamp(0.875rem, 2.2vw, 1.125rem);
        font-weight: 600;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        border-radius: 0.5rem;
        height: clamp(2.5rem, 6vh, 3.5rem);
        min-width: clamp(2.5rem, 6vh, 3.5rem);
        width: clamp(2.5rem, 6vh, 3.5rem);
        padding: 0;
        cursor: pointer;
        transition: all 0.3s ease;
        box-shadow: 0 0.25rem 1rem rgba(102, 126, 234, 0.3);
        white-space: nowrap;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }

        /* Icon styling for FontAwesome icons */
        .animation-ui button i {
            font-size: clamp(0.75rem, 1.8vw, 1rem);
        }

        .animation-ui button:hover {
            transform: translateY(-0.125rem);
            box-shadow: 0 0.375rem 1.25rem rgba(102, 126, 234, 0.4);
            background: linear-gradient(135deg, #7c94ec 0%, #8a5db5 100%);
        }

        .animation-ui button:active {
            transform: translateY(0);
            box-shadow: 0 0.125rem 0.625rem rgba(102, 126, 234, 0.3);
        }

    .animation-ui > input {
        flex: 1;
        height: clamp(2.5rem, 6vh, 3.5rem);
        font-size: clamp(1rem, 2.5vw, 1.25rem);
        padding: 0 clamp(1rem, 3vw, 1.5rem);
        border: 2px solid rgba(255, 255, 255, 0.15);
        border-radius: 0.5rem;
        background: rgba(255, 255, 255, 0.1);
        color: white;
        outline: none;
        transition: all 0.3s ease;
        box-sizing: border-box;
        min-width: clamp(12rem, 30vw, 18rem);
        margin: 0 0.5rem;
    }

        .animation-ui > input:focus {
            border-color: #667eea;
            background: rgba(255, 255, 255, 0.15);
            box-shadow: 0 0 1rem rgba(102, 126, 234, 0.3);
        }

        .animation-ui > input::placeholder {
            color: rgba(255, 255, 255, 0.6);
        }

    /* Button groups for better organization */
    .animation-ui .control-group {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    .animation-ui .playback-controls {
        flex-shrink: 0;
    }

    .animation-ui .camera-controls {
        flex-shrink: 0;
    }

    .animation-ui .speed-controls {
        flex-shrink: 0;
        border-left: 1px solid rgba(255, 255, 255, 0.2);
        padding-left: 1rem;
        margin-left: 0.5rem;
        position: relative;
    }

    .animation-ui button[data-action="speed-selector"] {
        background: linear-gradient(135deg, #17a2b8 0%, #6c757d 100%);
        width: auto;
        min-width: clamp(4rem, 10vw, 5rem);
        height: clamp(2.5rem, 6vh, 3.5rem);
        padding: 0 0.75rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
        font-size: clamp(0.75rem, 2vw, 0.875rem);
    }

        .animation-ui button[data-action="speed-selector"]:hover {
            background: linear-gradient(135deg, #20c997 0%, #6c757d 100%);
            box-shadow: 0 0.375rem 1.25rem rgba(23, 162, 184, 0.4);
        }

        .animation-ui button[data-action="speed-selector"].active {
            background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
            box-shadow: 0 0.375rem 1.25rem rgba(255, 193, 7, 0.4);
        }

        .animation-ui button[data-action="speed-selector"] .speed-text {
            font-weight: 600;
            font-size: clamp(0.75rem, 1.8vw, 0.875rem);
        }

        .animation-ui button[data-action="speed-selector"] i {
            font-size: clamp(0.625rem, 1.5vw, 0.75rem);
            transition: transform 0.3s ease;
        }

        .animation-ui button[data-action="speed-selector"].active i {
            transform: rotate(180deg);
        }

.speed-popup {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.4);
    margin-bottom: 0.5rem;
    z-index: 1001;
    overflow: hidden;
}

.speed-option {
    padding: 0.75rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: clamp(0.75rem, 2vw, 0.875rem);
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

    .speed-option:last-child {
        border-bottom: none;
    }

    .speed-option:hover {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    .speed-option.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        font-weight: 600;
    }

        .speed-option.active:hover {
            background: linear-gradient(135deg, #7c94ec 0%, #8a5db5 100%);
        }

/* Specific button styling for different types */
.animation-ui button[data-action="play"],
.animation-ui button[data-action="pause"] {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

    .animation-ui button[data-action="play"]:hover,
    .animation-ui button[data-action="pause"]:hover {
        background: linear-gradient(135deg, #34ce57 0%, #2dd4aa 100%);
        box-shadow: 0 0.375rem 1.25rem rgba(40, 167, 69, 0.4);
    }

.animation-ui button[data-action="camera-jet"] {
    background: linear-gradient(135deg, #fd7e14 0%, #e83e8c 100%);
}

    .animation-ui button[data-action="camera-jet"]:hover {
        background: linear-gradient(135deg, #fd9843 0%, #ea5999 100%);
        box-shadow: 0 0.375rem 1.25rem rgba(253, 126, 20, 0.4);
    }

.animation-ui button[data-action="camera-carrier"] {
    background: linear-gradient(135deg, #6f42c1 0%, #007bff 100%);
}

    .animation-ui button[data-action="camera-carrier"]:hover {
        background: linear-gradient(135deg, #8659d4 0%, #3395ff 100%);
        box-shadow: 0 0.375rem 1.25rem rgba(111, 66, 193, 0.4);
    }

.close-button {
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}

    .close-button:hover {
        color: #f00;
    }

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    .animation-ui {
        flex-direction: column;
        width: clamp(20rem, 90vw, 28rem);
        min-width: 18rem;
        gap: 1rem;
        padding: 1.5rem;
        font-size: clamp(12px, 3vw, 16px);
    }

        .animation-ui .control-group {
            width: 100%;
            justify-content: center;
        }

        .animation-ui .speed-controls {
            border-left: none;
            border-top: 1px solid rgba(255, 255, 255, 0.2);
            padding-left: 0;
            padding-top: 0.75rem;
            margin-left: 0;
            margin-top: 0.5rem;
            flex-wrap: wrap;
        }

        .animation-ui button[data-action="speed-selector"] {
            width: 100%;
            min-width: unset;
            height: clamp(3rem, 8vw, 4rem);
            font-size: clamp(0.875rem, 3vw, 1rem);
        }

    .speed-popup {
        position: fixed;
        bottom: auto;
        top: 50%;
        left: 50%;
        right: auto;
        transform: translate(-50%, -50%);
        width: 200px;
        max-height: 300px;
        overflow-y: auto;
    }

    .animation-ui button {
        width: clamp(3rem, 8vw, 4rem);
        height: clamp(3rem, 8vw, 4rem);
        min-width: clamp(3rem, 8vw, 4rem);
        font-size: clamp(0.875rem, 3vw, 1.125rem);
    }

        .animation-ui button i {
            font-size: clamp(0.875rem, 2.5vw, 1.125rem);
        }

    .animation-ui > input {
        height: clamp(3rem, 8vw, 4rem);
        font-size: clamp(0.875rem, 3vw, 1.125rem);
        min-width: unset;
        margin: 0;
        width: 100%;
    }


}

@media (max-width: 480px) {
    .animation-ui {
        width: clamp(16rem, 95vw, 24rem);
        min-width: 15rem;
        padding: 1rem;
        gap: 0.75rem;
    }

        .animation-ui button {
            height: 3rem;
            width: 3rem;
            min-width: 3rem;
            font-size: 0.875rem;
        }

            .animation-ui button i {
                font-size: 1rem;
            }

        .animation-ui > input {
            height: 3rem;
            font-size: 0.875rem;
            padding: 0 1rem;
        }
}

/* Firefox-specific fixes for better scaling */
@-moz-document url-prefix() {
    .animation-ui {
        font-size: clamp(16px, 2.5vw, 20px);
    }

        .animation-ui button {
            font-size: clamp(1rem, 2.8vw, 1.375rem);
            height: clamp(3rem, 7vh, 4rem);
            width: clamp(3rem, 7vh, 4rem);
            min-width: clamp(3rem, 7vh, 4rem);
        }

            .animation-ui button i {
                font-size: clamp(0.875rem, 2.2vw, 1.25rem);
            }

        .animation-ui > input {
            font-size: clamp(1.125rem, 3vw, 1.5rem);
            height: clamp(3rem, 7vh, 4rem);
        }

        .animation-ui button[data-action="speed-selector"] {
            height: clamp(3rem, 7vh, 4rem);
            font-size: clamp(0.875rem, 2.5vw, 1rem);
            min-width: clamp(5rem, 12vw, 6rem);
        }
}
