/* Fatal Model Gallery Viewer - Styles */

.fmg-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

/* Controls / Form */
.fmg-controls {
    margin-bottom: 25px;
    background: #1a1a1a;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #333;
}

.fmg-url-form label {
    display: block;
    color: #fff;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
}

.fmg-input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.fmg-url-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #111;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.fmg-url-input:focus {
    border-color: #e91e63;
}

.fmg-hint {
    margin: 10px 0 0;
    color: #aaa;
    font-size: 13px;
}

/* Buttons */
.fmg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 22px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.fmg-btn-primary {
    background: linear-gradient(135deg, #e91e63, #c2185b);
    color: #fff;
}

.fmg-btn-primary:hover {
    background: linear-gradient(135deg, #f06292, #e91e63);
    transform: translateY(-1px);
}

.fmg-btn-success {
    background: linear-gradient(135deg, #43a047, #2e7d32);
    color: #fff;
    margin-top: 12px;
}

.fmg-btn-success:hover {
    background: linear-gradient(135deg, #66bb6a, #43a047);
}

.fmg-btn-outline {
    background: transparent;
    color: #e91e63;
    border: 2px solid #e91e63;
}

.fmg-btn-outline:hover {
    background: #e91e63;
    color: #fff;
}

/* Loading */
.fmg-loading {
    text-align: center;
    padding: 40px 20px;
    color: #ccc;
}

.fmg-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top-color: #e91e63;
    border-radius: 50%;
    margin: 0 auto 15px;
    animation: fmg-spin 0.8s linear infinite;
}

@keyframes fmg-spin {
    to { transform: rotate(360deg); }
}

/* Manual fallback */
.fmg-manual {
    margin-bottom: 25px;
}

.fmg-alert {
    padding: 15px 18px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.fmg-alert-warning {
    background: #3d2c00;
    border: 1px solid #ff9800;
    color: #ffcc80;
}

.fmg-alert code {
    background: #222;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.fmg-manual-textarea {
    width: 100%;
    padding: 14px;
    border: 1px solid #444;
    border-radius: 8px;
    background: #111;
    color: #eee;
    font-family: monospace;
    font-size: 13px;
    resize: vertical;
    min-height: 140px;
    box-sizing: border-box;
}

.fmg-manual-textarea:focus {
    border-color: #e91e63;
    outline: none;
}

/* Gallery Grid */
.fmg-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 10px;
}

.fmg-item {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #1a1a1a;
    aspect-ratio: 3/4;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.fmg-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(233, 30, 99, 0.25);
}

.fmg-item img,
.fmg-item video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.fmg-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.25s;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 15px;
}

.fmg-item:hover .fmg-item-overlay {
    opacity: 1;
}

.fmg-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(233, 30, 99, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
}

.fmg-play-icon::before {
    content: "▶";
    margin-left: 3px;
}

/* Load more */
.fmg-load-more-wrap {
    text-align: center;
    margin-top: 30px;
}

/* Lightbox */
.fmg-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.fmg-lightbox-content {
    position: relative;
    max-width: 95vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fmg-lightbox-media {
    max-width: 90vw;
    max-height: 85vh;
}

.fmg-lightbox-media img,
.fmg-lightbox-media video {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
}

.fmg-lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.fmg-lightbox-close:hover {
    opacity: 1;
}

.fmg-lightbox-prev,
.fmg-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    font-size: 40px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.fmg-lightbox-prev:hover,
.fmg-lightbox-next:hover {
    background: rgba(233, 30, 99, 0.8);
}

.fmg-lightbox-prev {
    left: -70px;
}

.fmg-lightbox-next {
    right: -70px;
}

/* Responsive */
@media (max-width: 768px) {
    .fmg-gallery {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }

    .fmg-input-group {
        flex-direction: column;
    }

    .fmg-lightbox-prev {
        left: 5px;
    }

    .fmg-lightbox-next {
        right: 5px;
    }

    .fmg-lightbox-close {
        top: -35px;
        right: 5px;
    }
}

@media (max-width: 480px) {
    .fmg-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tabs */
.fmg-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.fmg-tab {
    padding: 10px 18px;
    border: 1px solid #444;
    background: #222;
    color: #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.fmg-tab:hover {
    border-color: #e91e63;
    color: #fff;
}

.fmg-tab.active {
    background: linear-gradient(135deg, #e91e63, #c2185b);
    border-color: #e91e63;
    color: #fff;
}

.fmg-alert-info {
    background: #0d2137;
    border: 1px solid #2196f3;
    color: #90caf9;
}

.fmg-no-thumb {
    width: 100%;
    height: 100%;
    background: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fmg-item:not([data-type="video"]) .fmg-no-thumb::after {
    content: "▶";
    font-size: 40px;
    color: #e91e63;
}

.fmg-video-label {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    background: rgba(233, 30, 99, 0.9);
    padding: 6px 14px;
    border-radius: 20px;
}

/* Better video card when no thumb */
.fmg-item[data-type="video"] {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

.fmg-item[data-type="video"] .fmg-no-thumb {
    background: transparent;
}

.fmg-item[data-type="video"] .fmg-play-icon {
    width: 64px;
    height: 64px;
    font-size: 26px;
    background: rgba(233, 30, 99, 0.95);
    box-shadow: 0 4px 20px rgba(233, 30, 99, 0.5);
}

.fmg-item[data-type="video"] .fmg-item-overlay {
    opacity: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 60%);
}

.fmg-item[data-type="video"] .fmg-video-label {
    font-size: 13px;
    letter-spacing: 0.5px;
}

/* Number badge on each card */
.fmg-item-number {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    border: 2px solid rgba(255,255,255,0.3);
}
