/* --- 1. STATIC TEASER SECTION --- */
.gn-batch-teaser {
    width: 90%;
    max-width: 1200px;
    margin: 60px auto;
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    border: 1px solid #333;
    border-left: 5px solid #9F00FF;
    border-radius: 15px;
    padding: 30px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    position: relative;
    overflow: hidden;
    flex-wrap: wrap;
    gap: 20px;
    
}

/* Glassy Shine Effect */
.gn-batch-teaser::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: skewX(-20deg);
    animation: shine 6s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

.teaser-text { z-index: 2; }

.teaser-text h3 {
    color: #fff;
    font-size: 24px;
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.teaser-text p {
    color: #888;
    margin: 0;
    font-size: 15px;
}

.teaser-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    z-index: 2;
}

/* Buttons */
.btn-open-batch {
    background: linear-gradient(135deg, #9F00FF, #7000b0);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(159, 0, 255, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    max-height: 600px !important;
}

.btn-open-batch:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(159, 0, 255, 0.6);
}

.btn-dl-control {
    background: #222;
    border: 1px solid #444;
    color: #ccc;
    padding: 12px 20px;
    border-radius: 30px;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}
.btn-dl-control:hover { background: #333; color: white; border-color: #666; }


/* --- 2. MODAL OVERLAY --- */
.gn-batch-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gn-batch-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.gn-batch-box {
    width: 90%;
    max-width: 900px;
    height: 85vh;
    background: #121212;
    border: 1px solid #333;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 0 50px rgba(0,0,0,0.6);
    position: relative;
}

.gn-batch-header-modal {
    padding: 20px;
    background: #1a1a1a;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gn-batch-header-modal h2 { margin: 0; color: white; font-size: 20px; }
.gn-batch-close { background: none; border: none; color: #666; font-size: 24px; cursor: pointer; }
.gn-batch-close:hover { color: white; }

.gn-batch-tabs {
    display: flex;
    background: #0f0f0f;
    padding: 0 20px;
    border-bottom: 1px solid #333;
}

.gn-batch-tab {
    padding: 15px 25px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #777;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
}

.gn-batch-tab:hover { color: #ccc; }
.gn-batch-tab.active { color: #9F00FF; border-bottom-color: #9F00FF; }

.gn-batch-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    align-content: start;
}

.gn-batch-content.history-mode {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: #1f1f1f;
    padding: 15px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid #00d4ff;
}
.history-item span { color: #ddd; font-size: 14px; }
.history-item small { color: #666; }

.batch-item {
    background: #1f1f1f;
    padding: 15px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
}
.batch-item:hover { background: #2a2a2a; }
.batch-item.selected { border-color: #9F00FF; background: rgba(159, 0, 255, 0.1); }
.batch-item img { width: 35px; height: 35px; border-radius: 6px; }
.batch-item h4 { margin: 0; color: #eee; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-checkbox { pointer-events: none; accent-color: #9F00FF; }

.gn-batch-footer-modal {
    padding: 20px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.batch-btn {
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    border: none;
    font-size: 14px;
}

.btn-dl-now { background: #9F00FF; color: white; box-shadow: 0 4px 10px rgba(159,0,255,0.3); }
.btn-dl-now:hover { background: #b02bff; }

.btn-clear { background: #333; color: #aaa; }
.btn-clear:hover { background: #444; color: white; }

/* =========================================
   LIGHT MODE OVERRIDES
========================================= */
body.light-mode .gn-batch-teaser {
    background: #ffffff;
    border-color: #e0e0e0;
    box-shadow: 0 10px 40px rgba(0,0,0,0.05);
}
body.light-mode .gn-batch-teaser h3 { color: #333; }
body.light-mode .btn-dl-control {
    background: #f0f0f0;
    border-color: #ccc;
    color: #333;
}
body.light-mode .btn-dl-control:hover { background: #e0e0e0; color: #000; }

body.light-mode .gn-batch-box {
    background: #f9f9f9;
    border-color: #ddd;
    box-shadow: 0 10px 60px rgba(0,0,0,0.2);
}
body.light-mode .gn-batch-header-modal,
body.light-mode .gn-batch-footer-modal {
    background: #ffffff;
    border-color: #eee;
    color: #333;
}
body.light-mode .gn-batch-header-modal h2 { color: #333; }
body.light-mode .gn-batch-close { color: #999; }
body.light-mode .gn-batch-close:hover { color: #333; }

body.light-mode .gn-batch-tabs { background: #f0f0f0; border-color: #ddd; }
body.light-mode .gn-batch-tab { color: #666; }
body.light-mode .gn-batch-tab:hover { color: #333; }
body.light-mode .gn-batch-tab.active { color: #9F00FF; background: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.05); }

body.light-mode .gn-batch-content { background: #f4f4f4; }
body.light-mode .batch-item {
    background: #ffffff;
    border: 1px solid #eee;
    color: #333;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}
body.light-mode .batch-item:hover { background: #fafafa; border-color: #ddd; }
body.light-mode .batch-item h4 { color: #222; }
body.light-mode .batch-item.selected { background: rgba(159,0,255,0.05); border-color: #9F00FF; }

body.light-mode .history-item {
    background: #ffffff;
    color: #333;
    border: 1px solid #eee;
    border-left: 3px solid #9F00FF;
}
body.light-mode .history-item .hist-name { color: #222; font-weight: 600; }
body.light-mode .btn-clear { background: #e0e0e0; color: #555; }
body.light-mode .btn-clear:hover { background: #d0d0d0; color: #000; }

@media (max-width: 768px) {
    .gn-batch-teaser { flex-direction: column; text-align: center; }
    .teaser-actions { width: 100%; justify-content: center; }
}
/* Save (Retry) Button */
.hist-btn.save {
    background: #00c853; /* Green */
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}
.hist-btn.save:hover { background: #00e676; }

/* Cancel (Remove) Button */
.hist-btn.cancel {
    background: #d50000; /* Red */
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}
.hist-btn.cancel:hover { background: #ff1744; }

/* Clear All Button (Footer) */
.btn-clear-history {
    background: #d32f2f;
    color: white;
    box-shadow: 0 4px 10px rgba(211, 47, 47, 0.3);
}
.btn-clear-history:hover { background: #f44336; }
/* --- Add/Update these specific styles --- */

.footer-left { display: flex; align-items: center; }
.footer-right { display: flex; gap: 10px; }

/* Schedule Button */
.btn-schedule {
    background: #ff9800; /* Orange */
    color: white;
    box-shadow: 0 4px 10px rgba(255, 152, 0, 0.3);
}
.btn-schedule:hover {
    background: #fb8c00;
    transform: translateY(-2px);
}

/* Ensure footer layout is correct */
.gn-batch-footer-modal {
    padding: 20px;
    background: #1a1a1a;
    border-top: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

/* Light mode for schedule button */
body.light-mode .btn-schedule {
    background: #ffb74d;
    color: #fff;
}
body.light-mode .btn-schedule:hover {
    background: #ffa726;
}

/* =========================
   MOBILE OPTIMIZATIONS
   - Ensure app names are visible
   - Better layout on small screens
   ========================= */

@media (max-width: 768px) {
    /* Make modal use more of the screen */
    .gn-batch-box {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    /* Single column list for readability */
    .gn-batch-content {
        grid-template-columns: 1fr;
        padding: 15px;
    }

    .batch-item {
        gap: 12px;
        padding: 12px;
    }

    .batch-item img {
        width: 32px;
        height: 32px;
    }

    /* Ensure text can wrap and is not cut off */
    .batch-item-info {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }

    .batch-item-info h4 {
        font-size: 15px;
        white-space: normal;
        word-break: break-word;
    }

    .batch-item-info p {
        font-size: 12px;
        opacity: 0.7;
    }

    /* Footer buttons stack better on mobile */
    .gn-batch-footer-modal {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-right {
        width: 100%;
        justify-content: flex-end;
    }
}
/* --- CUSTOM UNIVERSAL ALERT BOX --- */
.gn-alert-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 200000; /* Above everything */
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gn-alert-overlay.active {
    display: flex;
    opacity: 1;
}

.gn-alert-box {
    width: 90%;
    max-width: 450px;
    background: linear-gradient(145deg, #1a1a1a, #111);
    border: 1px solid #333;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
}

.gn-alert-overlay.active .gn-alert-box {
    transform: scale(1);
}

/* Accent Line */
.gn-alert-box::before {
    content: '';
    position: absolute;
    top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, #9F00FF, #00d4ff);
}

.gn-alert-icon {
    font-size: 40px;
    margin-bottom: 20px;
    background: -webkit-linear-gradient(#9F00FF, #00d4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.gn-alert-title {
    color: white;
    font-size: 22px;
    margin: 0 0 10px 0;
    font-weight: 700;
}

.gn-alert-msg {
    color: #bbb;
    font-size: 15px;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Input for Prompts */
.gn-alert-input {
    width: 100%;
    padding: 12px 15px;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 10px;
    color: white;
    margin-bottom: 25px;
    font-size: 16px;
    outline: none;
    display: none; /* Hidden by default */
}
.gn-alert-input:focus { border-color: #9F00FF; }

/* Buttons */
.gn-alert-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.alert-btn {
    padding: 12px 30px;
    border-radius: 30px;
    border: none;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    min-width: 100px;
}

.alert-btn.confirm {
    background: linear-gradient(135deg, #9F00FF, #7000b0);
    color: white;
    box-shadow: 0 5px 15px rgba(159, 0, 255, 0.3);
}
.alert-btn.confirm:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(159, 0, 255, 0.5); }

.alert-btn.cancel {
    background: #2a2a2a;
    color: #ddd;
    border: 1px solid #444;
}
.alert-btn.cancel:hover { background: #333; color: white; }

/* Light Mode Overrides */
body.light-mode .gn-alert-box { background: #ffffff; border-color: #eee; }
body.light-mode .gn-alert-title { color: #222; }
body.light-mode .gn-alert-msg { color: #666; }
body.light-mode .gn-alert-input { background: #f5f5f5; border-color: #ddd; color: #333; }
body.light-mode .alert-btn.cancel { background: #f0f0f0; border-color: #ddd; color: #555; }
body.light-mode .alert-btn.cancel:hover { background: #e0e0e0; color: #333; }