/* ============================================================
   instagram-grid / style.css
   Prefix: ig-
   ============================================================ */

.ig-container {
    max-width: 700px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* --- Section Cards --- */
.ig-section {
    background: #fdfdfd;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    border: 1px solid #eee;
    margin-bottom: 16px;
}

.ig-section-title {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e1306c;
}

/* --- Safety banner --- */
.ig-safety-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 8px 14px;
    font-size: 12px;
    color: #166534;
    margin-bottom: 14px;
}

/* --- Drop zone --- */
.ig-dropzone {
    border: 2.5px dashed #ccc;
    border-radius: 10px;
    padding: 36px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafafa;
    position: relative;
}

.ig-dropzone.dragover {
    border-color: #e1306c;
    background: #fff5f8;
}

.ig-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}

.ig-dropzone-icon {
    font-size: 40px;
    margin-bottom: 8px;
    display: block;
}

.ig-dropzone-text {
    font-size: 15px;
    font-weight: 700;
    color: #444;
    margin-bottom: 4px;
}

.ig-dropzone-sub {
    font-size: 12px;
    color: #999;
}

.ig-thumb-wrap {
    position: relative;
    display: none;
}

.ig-thumb-preview {
    width: 100%;
    max-height: 200px;
    object-fit: contain;
    border-radius: 6px;
    display: block;
}

.ig-change-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    padding: 4px 10px;
    cursor: pointer;
}

/* --- Option buttons --- */
.ig-option-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #666;
    margin-bottom: 8px;
}

.ig-btn-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ig-opt-btn {
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid #ddd;
    border-radius: 20px;
    background: #fff;
    cursor: pointer;
    color: #555;
    transition: all 0.15s;
    white-space: nowrap;
}

.ig-opt-btn:hover {
    border-color: #e1306c;
    color: #e1306c;
}

.ig-opt-btn.active {
    background: #e1306c;
    border-color: #e1306c;
    color: #fff;
}

/* --- Preview grid --- */
.ig-preview-outer {
    background: #0f0f0f;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 14px;
}

.ig-preview-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.ig-preview-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ig-grid-overlay {
    position: absolute;
    inset: 0;
    display: grid;
}

.ig-overlay-cell {
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 4px;
    box-sizing: border-box;
}

.ig-order-badge {
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 10px;
    line-height: 1.4;
    white-space: nowrap;
}

.ig-preview-empty {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #555;
    font-size: 14px;
}

/* --- Split button --- */
.ig-split-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.15s;
    margin-top: 4px;
}

.ig-split-btn:hover {
    opacity: 0.88;
}

.ig-split-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Spinner --- */
.ig-spinner-wrap {
    display: none;
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

/* --- Results section --- */
.ig-results-section {
    display: none;
}

.ig-result-info {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: #f5f5f5;
    border-radius: 6px;
    line-height: 1.6;
}

.ig-thumbs-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.ig-thumb-tile {
    flex: 0 0 calc(33.333% - 7px);
    min-width: 80px;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.ig-thumb-tile img {
    width: 100%;
    display: block;
    aspect-ratio: 1;
    object-fit: cover;
}

.ig-thumb-tile-footer {
    padding: 6px 8px;
    text-align: center;
    font-size: 11px;
    color: #333;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ig-thumb-post-num {
    font-weight: 800;
    color: #e1306c;
}

.ig-tile-dl-btn {
    display: block;
    width: 100%;
    padding: 4px;
    font-size: 11px;
    background: #f0f0f0;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    color: #333;
    font-weight: 700;
    text-align: center;
    transition: background 0.15s;
}

.ig-tile-dl-btn:hover {
    background: #e0e0e0;
}

/* ZIP download */
.ig-zip-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px;
    font-size: 15px;
    font-weight: 700;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
}

.ig-zip-btn:hover {
    background: #333;
}

.ig-zip-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ig-quality-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #555;
    flex-wrap: wrap;
}

.ig-quality-label {
    font-weight: 700;
    white-space: nowrap;
}

.ig-quality-slider {
    flex: 1;
    min-width: 100px;
    accent-color: #e1306c;
}

.ig-quality-val {
    font-weight: 700;
    color: #e1306c;
    min-width: 40px;
}

/* --- Error message --- */
.ig-error {
    display: none;
    color: #c5221f;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    background: #fce8e6;
    border-radius: 6px;
    margin-top: 10px;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .ig-thumb-tile {
        flex: 0 0 calc(50% - 5px);
    }

    .ig-btn-group {
        gap: 4px;
    }

    .ig-opt-btn {
        font-size: 12px;
        padding: 6px 10px;
    }
}