:root {
    --ag-glass-bg: rgba(255, 255, 255, 0.8);
    --ag-glass-border: rgba(255, 255, 255, 0.6);
    --ag-glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.04);
    --ag-primary: #3b82f6;
    --ag-text-main: #0f172a;
    --ag-text-muted: #64748b;
    --ag-input-bg: rgba(255, 255, 255, 0.6);
    --ag-radius: 20px;
}

body.dark-mode {
    --ag-glass-bg: rgba(15, 23, 42, 0.75);
    --ag-glass-border: rgba(255, 255, 255, 0.08);
    --ag-glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
    --ag-text-main: #f8fafc;
    --ag-text-muted: #94a3b8;
    --ag-input-bg: rgba(30, 41, 59, 0.5);
}

.ag-glass-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.3);
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transition: 0.3s ease;
    padding: 20px; box-sizing: border-box;
    will-change: opacity;
}

.ag-glass-modal.active { opacity: 1; visibility: visible; }

.ag-glass-content {
    width: 100%; max-width: 420px;
    background: var(--ag-glass-bg);
    border: 1px solid var(--ag-glass-border);
    box-shadow: var(--ag-glass-shadow);
    border-radius: var(--ag-radius);
    padding: 32px 24px;
    position: relative;
    transform: scale(0.96) translateZ(0);
    transition: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    direction: rtl; text-align: right;
    font-family: inherit;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none; 
    -webkit-tap-highlight-color: transparent;
    will-change: transform;
}

.ag-glass-content::-webkit-scrollbar { display: none; }

.ag-glass-modal.active .ag-glass-content { transform: scale(1) translateZ(0); }

.ag-close-modal {
    position: absolute; top: 20px; left: 20px;
    background: transparent !important;
    border: none;
    color: var(--ag-text-muted);
    cursor: pointer;
    z-index: 10;
    padding: 0;
    width: 32px; height: 32px;
    transition: color 0.2s;
    display: flex; align-items: center; justify-content: center;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.ag-close-modal:hover { color: #ef4444; }

.ag-modal-header { margin-bottom: 24px; text-align: center; }
.ag-modal-header h3 { margin: 0; font-size: 17px; color: var(--ag-text-main); font-weight: 700; }

.ag-section-label {
    display: block; width: 100%; font-size: 12px; font-weight: 600;
    margin-bottom: 10px; color: var(--ag-text-muted);
}

.ag-user-profile-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 20px;
}
.ag-user-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.ag-user-info-text { display: flex; flex-direction: column; }
.ag-user-name { font-size: 13px; font-weight: 600; color: var(--ag-text-main); }

.ag-input-group { margin-bottom: 16px; width: 100%; }
.ag-row-inputs { display: flex; gap: 12px; margin-bottom: 16px; }
.ag-field-col { flex: 1; }

.ag-glass-content input, .ag-glass-content textarea {
    width: 100%; padding: 12px 14px;
    border-radius: 14px; border: 1px solid transparent;
    background: var(--ag-input-bg);
    color: var(--ag-text-main);
    font-family: inherit; font-size: 13px;
    outline: none; transition: 0.2s;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.ag-glass-content input::placeholder, .ag-glass-content textarea::placeholder {
    color: var(--ag-text-muted); opacity: 0.7;
}

.ag-glass-content input:focus, .ag-glass-content textarea:focus {
    background: var(--ag-glass-bg);
    border-color: var(--ag-primary);
}

.ag-glass-content textarea { height: 80px; resize: none; }

.ag-input-wrapper { position: relative; width: 100%; }
.ag-has-icon input { padding-left: 42px !important; }

.ag-market-icon-container {
    position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
    width: 20px; height: 20px; pointer-events: none; opacity: 0; transition: 0.3s;
    display: flex; align-items: center; justify-content: center;
}
.ag-market-icon-container.show { opacity: 1; }
.ag-market-icon-container svg, .ag-market-icon-container img { width: 100%; height: 100%; object-fit: contain; }

.ag-files-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; width: 100%; }
#ag-select-all-btn {
    background: transparent !important; border: none; color: var(--ag-primary);
    font-size: 11px; font-weight: 600; cursor: pointer; padding: 0;
    white-space: nowrap; flex-shrink: 0; outline: none;
    -webkit-tap-highlight-color: transparent;
}

.ag-files-list {
    display: flex; flex-direction: column; gap: 8px;
    margin-bottom: 20px; max-height: 160px; overflow-y: auto;
    width: 100%;
}

.ag-checkbox-wrapper { cursor: pointer; display: block; -webkit-tap-highlight-color: transparent; }
.ag-checkbox-wrapper input { display: none; }
.ag-cb-card {
    display: flex; align-items: center; padding: 12px;
    background: var(--ag-input-bg);
    border: 1px solid transparent;
    border-radius: 14px; transition: 0.2s;
}

.ag-checkbox-wrapper input:checked + .ag-cb-card {
    background: transparent; border-color: var(--ag-primary);
}

.ag-cb-card.static {
    cursor: default; background: transparent; border-color: var(--ag-primary);
}

.ag-cb-icon { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; margin-left: 10px; color: var(--ag-text-muted); }
.ag-checkbox-wrapper input:checked + .ag-cb-card .ag-cb-icon, .ag-cb-card.static .ag-cb-icon { color: var(--ag-primary); }

.ag-cb-info { flex-grow: 1; display: flex; flex-direction: column; }
.ag-cb-info .fname { font-size: 12px; font-weight: 600; color: var(--ag-text-main); }
.ag-cb-info .fver { font-size: 10px; color: var(--ag-text-muted); margin-top: 2px; }
.ag-cb-tick { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: transparent; transition: 0.2s; }
.ag-checkbox-wrapper input:checked + .ag-cb-card .ag-cb-tick { color: var(--ag-primary); }

.ag-submit-report-btn {
    width: 100%; background: var(--ag-text-main);
    color: var(--ag-glass-bg); border: none; padding: 14px;
    border-radius: 14px; font-weight: 600; font-size: 13px;
    cursor: pointer; transition: opacity 0.2s;
    display: flex; justify-content: center; align-items: center;
    -webkit-tap-highlight-color: transparent; outline: none;
}
body.dark-mode .ag-submit-report-btn { background: var(--ag-primary); color: #fff; }
.ag-submit-report-btn:active { opacity: 0.8; }

.ag-submit-report-btn .btn-loader { width: 16px; height: 16px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: agSpin 0.6s infinite linear; display: none; margin-right: 8px; }
.ag-submit-report-btn.loading .btn-loader { display: block; }
.ag-submit-report-btn.loading .btn-text { display: none; }
@keyframes agSpin { to { transform: rotate(360deg); } }

.ag-success-message { text-align: center; padding: 30px 0; }
.ag-success-anim { width: 48px; height: 48px; margin: 0 auto 16px; color: #10b981; }
.ag-success-anim .tick { stroke-dasharray: 50; stroke-dashoffset: 50; }
@keyframes agDash { to { stroke-dashoffset: 0; } }
.ag-success-message h4 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ag-text-main); }
.ag-success-message p { margin: 10px 0 0; font-size: 12px; font-weight: 600; color: var(--ag-text-muted); opacity: 0.9; }

.ag-report-toast {
    position: fixed; bottom: 30px; left: 50%; transform: translate(-50%, 20px) translateZ(0);
    background: var(--ag-glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    padding: 10px 16px; border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; font-weight: 600; color: var(--ag-text-main);
    z-index: 9999999; opacity: 0; transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    border: 1px solid var(--ag-glass-border); width: max-content; max-width: 90%; direction: rtl;
    will-change: transform, opacity;
}
.ag-report-toast.show { opacity: 1; transform: translate(-50%, 0) translateZ(0); }
.ag-report-toast.error { color: #ef4444; }
.ag-report-toast .ag-rt-icon { display: flex; align-items: center; justify-content: center; }

@media (max-width: 600px) {
    .ag-glass-modal { padding: 16px; }
    .ag-glass-content { padding: 24px 20px; border-radius: 24px; }
    .ag-report-toast { bottom: 20px; }
}