/* Mobile First CSS */
/* Start with mobile styles, then scale up for larger screens */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
}

html {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

body {
    background-image: url('../static/fundo.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

.main-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    gap: 0.5rem;
    overflow: hidden;
    position: relative;
    user-select: none;
    touch-action: none;
}

.frame-info {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-width: 95%;
    max-height: 50vh;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
}

.season-episode {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
}

/* Frame timestamp container - Mobile First */
.frame-timestamp {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    width: 100%;
}

/* Frame and timestamp input containers */
.frame,
.timestamp {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

/* Input styling */
.frame input,
.timestamp input,
.season-episode select {
    width: 100%;
    padding: 10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    min-height: 44px;
    touch-action: manipulation;
    text-align: center;
}

.frame input:focus,
.timestamp input:focus,
.season-episode select:focus {
    outline: none;
    border-color: #007bff;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.season-episode select {
    cursor: pointer;
}

/* Labels for inputs */
.frame::before,
.timestamp::before {
    content: attr(data-label);
    font-size: 14px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.frame::before {
    content: "Frame";
}

.timestamp::before {
    content: "Timestamp";
}

/* Placeholder styling */
.frame input::placeholder,
.timestamp input::placeholder {
    color: #999;
    font-style: italic;
}

/* Prevent text selection */
.frame input,
.timestamp input,
.season-episode select {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Viewport for logo/image - Mobile First */
.viewport {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 10px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    max-height: 50vh;
    min-width: 100%;
    min-height: 188px;
}

.viewport img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

/* Error banner layered above the image */
#err-msg-view {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    max-width: 360px;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #c53030;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 12px;
    border-radius: 10px;
    z-index: 2;
    display: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Centered loading spinner */
.spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.35);
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 2;
    display: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Frame navigation controls - Mobile First */
.frame-navigation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    width: 100%;
    max-width: 400px;
}

/* Navigation button styles */
.prev-frame,
.random-frame,
.download-frame,
.next-frame {
    -webkit-appearance: none;
    appearance: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid #ddd;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    min-height: 44px;
    min-width: 44px;
    touch-action: manipulation;
    padding: 0;
}


.prev-frame:hover,
.random-frame:hover,
.download-frame:hover,
.next-frame:hover {
    background: rgba(255, 255, 255, 1);
    /* Border color does not change on hover */
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.2);
}


/* Base state with transition */
.prev-frame,
.random-frame,
.download-frame,
.next-frame {
    transition: all 0.2s ease;
}

/* Button static */
.prev-frame img,
.random-frame img,
.download-frame img,
.next-frame img {
    width: 24px;
    height: 24px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

/* Rotate previous button image */
.prev-frame img {
    transform: rotate(180deg);
}

/* Generic button style for timestamp pill */
.btn {
    padding: 10px 16px;
    font-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #333;
    height: 44px;
    min-width: 120px;
}

#timestamp-btn {
    pointer-events: none;
    user-select: none;
    font-variant-numeric: tabular-nums;
}

