@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap');

* {
    font-family: "Inter",sans-serif;
    font-optical-sizing: auto;
    font-weight        : 400;
    font-style         : normal;
}

body {
    font-family: sans-serif;
    background : #f4f7f9;
    padding    : 20px;
    color      : #333;
}

.controls {
    margin-bottom: 20px;
}

label {
    margin-right: 15px;
}

input[type="number"],
input[type="file"] {
    margin-right: 10px;
}

input[type="number"] {
    padding      : 6px 10px;
    border       : 1.5px solid #ccc;
    border-radius: 4px;
    font-size    : 1rem;
    transition   : border-color 0.2s, box-shadow 0.2s;
}

input[type="number"]:focus {
    border-color: #007bff;
    box-shadow  : 0 0 0 2px #cce4ff;
    outline     : none;
}

#analyzeBtn {
    padding         : 8px 16px;
    font-size       : 1rem;
    background-color: #007bff;
    color           : white;
    border          : none;
    border-radius   : 4px;
    cursor          : pointer;
}

#analyzeBtn:hover {
    background-color: #0056b3;
}

#analyzeBtn:disabled {
    background-color: #b0c4d8;
    cursor          : not-allowed;
    color           : #eee;
}

#frames {
    display              : grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap                  : 10px;
}

#frames a {
    display      : block;
    overflow     : hidden;
    border       : 2px solid #ddd;
    border-radius: 4px;
}

#frames img {
    display   : block;
    width     : 100%;
    height    : auto;
    transition: transform 0.3s;
}

#frames img:hover {
    transform: scale(1.05);
}

canvas,
video {
    display: none;
}

.drop-area {
    border       : 2px dashed #007bff;
    border-radius: 8px;
    padding      : 30px;
    text-align   : center;
    background   : #eaf1fb;
    margin-bottom: 20px;
    transition   : background 0.2s, border-color 0.2s;
}

.drop-area.dragover {
    background  : #d0e7ff;
    border-color: #0056b3;
}

.upload-label {
    color          : #007bff;
    text-decoration: underline;
    cursor         : pointer;
}

.upload-feedback {
    margin-bottom: 10px;
    color        : #d9534f;
    font-weight  : bold;
    min-height   : 1.2em;
}

.input-feedback {
    min-height   : 1.2em;
    color        : #888;
    font-size    : 0.98em;
    margin-bottom: 10px;
    font-weight  : 500;
}

.analyzing-overlay {
    position       : fixed;
    top            : 0;
    left           : 0;
    width          : 100vw;
    height         : 100vh;
    background     : rgba(255, 255, 255, 0.85);
    z-index        : 9999;
    display        : flex;
    align-items    : center;
    justify-content: center;
}

.analyzing-content {
    display       : flex;
    flex-direction: column;
    align-items   : center;
    gap           : 18px;
}

.spinner {
    width        : 48px;
    height       : 48px;
    border       : 5px solid #007bff;
    border-top   : 5px solid #eaf1fb;
    border-radius: 50%;
    animation    : spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.analyzing-content span {
    font-size     : 1.3rem;
    color         : #007bff;
    font-weight   : 600;
    letter-spacing: 1px;
}

.stop-btn {
    margin-top      : 10px;
    padding         : 8px 20px;
    font-size       : 1rem;
    background-color: #d9534f;
    color           : #fff;
    border          : none;
    border-radius   : 4px;
    cursor          : pointer;
    font-weight     : 600;
    transition      : background 0.2s;
}

.stop-btn:hover {
    background-color: #b52a1a;
}

@media (max-width: 600px) {
    .controls {
        display       : flex;
        flex-direction: column;
        align-items   : stretch;
        gap           : 12px;
    }

    .controls label {
        margin-right : 0;
        margin-bottom: 0;
        width        : 100%;
    }

    .controls input[type="number"] {
        width       : 100%;
        box-sizing  : border-box;
        margin-right: 0;
    }

    #analyzeBtn {
        width     : 100%;
        margin-top: 4px;
    }
}