/* ===============================
   FORM CONTAINER
================================ */
#fps-form {
    max-width: 760px;
    margin: 40px auto;
    padding: 10px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e1e1e1;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ===============================
   LABELS
================================ */
#fps-form label {
    display: block;
    margin-top: 20px;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

/* ===============================
   INPUTS
================================ */
#fps-form input,
#fps-form textarea,
#fps-form select {
    width: 100%;
    padding: 12px;
    margin-top: 6px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.25s ease-in-out;
    background: #fafafa;
}

#fps-form input:focus,
#fps-form textarea:focus,
#fps-form select:focus {
    border-color: #0073aa;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.08);
}

/* Larger content box */
#fps-form textarea {
    min-height: 320px;
}

/* Character counter */
.fps-counter {
    font-size: 12px;
    text-align: right;
    margin-top: 4px;
    color: #777;
}

/* ===============================
   IMAGE GRID (THUMBNAILS)
================================ */
.fps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.fps-grid-item {
    cursor: pointer;
    position: relative;
}

.fps-grid-item img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.fps-grid-item img:hover {
    transform: scale(1.05);
}

/* ===============================
   FEATURED LABEL
================================ */
.fps-featured-label {
    text-align: center;
    font-size: 12px;
    margin-top: 4px;
    color: #28a745;
}

/* ===============================
   DELETE BUTTON ON IMAGE
================================ */
.fps-delete-image {
    position: absolute;
    top: 4px;
    right: 4px;
    cursor: pointer;
    font-size: 16px;
    color: #b02a37;
    background: rgba(255,255,255,0.8);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    line-height: 18px;
    text-align: center;
    font-weight: bold;
}

.fps-delete-image:hover {
    background: #fdecea;
    color: #b02a37;
}

/* Overlay for expanded image */
.fps-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.fps-overlay img {
    max-width: 80%;
    max-height: 80%;
    border-radius: 8px;
}

/* ===============================
   UPLOAD & SUBMIT LOADER ANIMATION
================================ */
#fps-image-loader,
#fps-submit-loader {
    display: none;
    width: 100%;
    height: 6px;
    background: #eee;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 8px;
    margin-bottom: 15px;
    position: relative;
}

#fps-image-loader div,
#fps-submit-loader div {
    height: 100%;
    width: 100%;
    background: linear-gradient(270deg, #28a745, #34d058, #28a745);
    background-size: 600% 100%;
    animation: loaderSlide 1.5s linear infinite;
    border-radius: 6px;
}

@keyframes loaderSlide {
    0% { background-position: 0% 0; }
    100% { background-position: 600% 0; }
}

/* ===============================
   SUCCESS / ERROR MESSAGES
================================ */
.fps-success {
    background: #e6f4ea;
    color: #1e7e34;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-size: 14px;
}

.fps-error {
    background: #fdecea;
    color: #b02a37;
    padding: 12px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-size: 14px;
}

/* ===============================
   SUBMIT BUTTON
================================ */
#fps-new-submit-btn {
    margin-top: 25px;
    padding: 14px;
    width: 100%;
    background: linear-gradient(135deg, #28a745, #218838);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

#fps-new-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

#fps-new-submit-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

/* Loading spinner inside button (optional) */
.fps-btn-loader {
    width: 22px;
    height: 22px;
    border: 3px solid #fff;
    border-top: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===============================
   POST IMAGE GALLERY
================================ */
.fps-gallery-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 25px;
}

.fps-gallery-wrapper img {
    width: 140px;
    border-radius: 8px;
}

/* ===============================
   DOWNLOAD LINKS INLINE
================================ */
.fps-download-container {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
}

.fps-download-container label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.fps-download-container input[type="url"] {
    flex: 1;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    background: #fafafa;
    transition: all 0.25s ease-in-out;
}

.fps-download-container input[type="url"]:focus {
    border-color: #0073aa;
    background: #fff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,115,170,0.08);
}

/* ===============================
   VERSION NUMBER
================================ */
.fps-version-number {
    font-weight: 600;
    margin-top: 15px;
    font-size: 14px;
}

/* ===============================
   RESPONSIVE
================================ */
@media (max-width: 600px) {
    #fps-form {
        padding: 20px;
        margin: 20px 10px;
    }

    .fps-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .fps-grid-item img {
        height: 80px;
    }

    .fps-download-container {
        flex-direction: column;
    }
}