/* ========================================= */
/* 🛡️ ADMIN PANEL CSS (Premium Dashboard)     */
/* ========================================= */
body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8fafc;
    color: #1e293b;
}

/* Header */
.admin-header {
    background: #1e293b;
    color: white;
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.admin-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.back-btn {
    color: white;
    text-decoration: none;
    font-weight: bold;
    background: #ef4444;
    padding: 8px 15px;
    border-radius: 8px;
    transition: 0.3s;
}

.back-btn:hover {
    background: #dc2626;
}

/* Main Container */
.admin-container {
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.tab-btn {
    background: white;
    border: 1px solid #cbd5e1;
    padding: 12px 25px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    color: #64748b;
    transition: 0.3s;
}

.tab-btn:hover {
    background: #f1f5f9;
}

.tab-btn.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
}

/* Tab Content */
.tab-content {
    display: none;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.filter-bar select {
    padding: 8px 15px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    outline: none;
    cursor: pointer;
    font-size: 1rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th,
td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background-color: #f1f5f9;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

tr:hover {
    background-color: #f8fafc;
}

/* Badges */
.badge {
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
}

.badge.red {
    background: #fee2e2;
    color: #ef4444;
}

.badge.yellow {
    background: #fef9c3;
    color: #eab308;
}

.badge.green {
    background: #dcfce3;
    color: #22c55e;
}

/* Buttons */
.del-btn {
    background: #fee2e2;
    color: #ef4444;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.del-btn:hover {
    background: #ef4444;
    color: white;
}

.ban-btn {
    background: #1e293b;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}

/* Admin Panel Mobile Optimization */
@media (max-width: 600px) {

    /* Buttons ko side-by-side rakho */
    .admin-nav-buttons {
        display: flex;
        gap: 10px;
        padding: 10px;
    }

    .admin-nav-buttons button {
        flex: 1;
        font-size: 0.8rem !important;
        padding: 12px 5px !important;
    }

    /* Table Header ko mobile par chhupa do */
    .report-header-row {
        display: none;
    }

    /* List Container */
    #reportsList {
        padding: 10px;
    }

    /* Har Report ko ek Card banao */
    .report-item {
        display: flex;
        flex-direction: column;
        background: white;
        border-radius: 15px;
        padding: 15px;
        margin-bottom: 15px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        border: 1px solid #f1f5f9;
        position: relative;
    }

    /* Email/Name ko bold aur bada rakho */
    .reporter-email {
        font-size: 0.95rem;
        font-weight: 700;
        color: #1e293b;
        word-break: break-all;
        /* Lamba email niche wrap hoga */
        margin-bottom: 8px;
    }

    /* Action Buttons (Delete/View) ko bottom par set karo */
    .report-actions {
        display: flex;
        gap: 10px;
        margin-top: 15px;
        border-top: 1px solid #f1f5f9;
        padding-top: 12px;
    }

    .report-actions button {
        flex: 1;
        padding: 10px !important;
    }
}

@media screen and (max-width: 768px) {

    /* Table ke structure ko poora khatam kardo mobile par */
    .admin-table,
    .admin-table thead,
    .admin-table tbody,
    .admin-table tr,
    .admin-table td {
        display: block;
        width: 100%;
    }

    /* Table headers ko gayab karo */
    .admin-table thead {
        display: none;
    }

    /* Har row ab ek "Floating Card" ban jayegi */
    .admin-table tr {
        background: #ffffff;
        margin-bottom: 15px;
        padding: 15px;
        border-radius: 18px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
        border: 1px solid #f1f5f9;
        position: relative;
    }

    /* Data labels (Reporter, Type etc) ko gayab karke layout set karo */
    .admin-table td {
        border: none;
        padding: 5px 0;
        text-align: left;
    }

    /* Email/Reporter ko top par bold rakho */
    .admin-table td:first-child {
        font-size: 1rem;
        font-weight: 800;
        color: #1e293b;
        border-bottom: 1px solid #f1f5f9;
        padding-bottom: 10px;
        margin-bottom: 10px;
        word-break: break-all;
    }

    /* Actions button ko niche ek row mein set karo */
    .admin-table td.actions {
        display: flex;
        gap: 10px;
        margin-top: 10px;
    }

    .admin-table td.actions button {
        flex: 1;
        border-radius: 12px;
        padding: 12px !important;
        font-weight: 600;
    }
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    /* Rows ke beech gap */
}

th {
    background: #f8fafc;
    color: #64748b;
    padding: 12px;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

td {
    padding: 15px;
    background: white;
    border-bottom: 1px solid #f1f5f9;
}

/* Mobile View: Table to Cards */
@media screen and (max-width: 768px) {

    table,
    thead,
    tbody,
    th,
    td,
    tr {
        display: block;
        /* Table khatam, ab block elements hain */
    }

    thead tr {
        display: none;
        /* Header gayab */
    }

    tr {
        margin-bottom: 20px;
        border-radius: 15px;
        overflow: hidden;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        border: 1px solid #e2e8f0;
    }

    td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: right;
        padding: 12px 20px;
        position: relative;
        border-bottom: 1px solid #f8fafc;
    }

    /* Ye hai magic: data-label se heading banana */
    td::before {
        content: attr(data-label);
        font-weight: 800;
        text-transform: uppercase;
        font-size: 0.75rem;
        color: #94a3b8;
        text-align: left;
    }

    /* First column (Reporter) ko alag style do */
    td:first-child {
        background: #f8fafc;
        border-bottom: 2px solid #e2e8f0;
        justify-content: center;
        font-size: 1rem;
    }

    td:first-child::before {
        display: none;
        /* Name ke aage label ki zarurat nahi */
    }

    .del-btn {
        width: 100%;
        padding: 12px !important;
        justify-content: center;
        display: flex;
        gap: 8px;
    }
}

/* View Map Link Fix */
.map-link {
    color: #2563eb;
    text-decoration: none;
    /* Default underline hatao */
    font-weight: 700;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border-bottom: 1.5px solid transparent;
    /* Pehle se space rakho */
    transition: all 0.2s;
}

.map-link:hover {
    border-bottom: 1.5px solid #2563eb;
    /* Sirf text ke niche underline aayegi */
    color: #1d4ed8;
}

/* Delete Button Fix */
.del-btn {
    background: #fee2e2 !important;
    /* Soft red background */
    color: #ef4444 !important;
    /* Sharp red text */
    border: none;
    padding: 8px 16px !important;
    /* Padding kam kar di */
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.8rem !important;
    font-weight: 700;
    display: inline-flex;
    /* Isse button content ke hisab se resize hogi */
    align-items: center;
    gap: 6px;
    width: auto !important;
    /* 🚨 Isse button bahut bada nahi dikhega */
    margin-left: auto;
    /* Agar card mein right side chahiye toh */
    transition: all 0.2s;
}

.del-btn:hover {
    background: #fecaca !important;
    transform: translateY(-1px);
}

/* Card Row Fix (Jo tumhara data-label wala td hai) */
@media screen and (max-width: 768px) {
    td[data-label="Action"] {
        justify-content: flex-end;
        /* Button ko right mein dhakelo */
        padding-top: 15px;
    }
}

/* Filter Bar Fix */
.filter-bar {
    display: flex;
    flex-direction: column;
    /* Mobile par stack karo */
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

#reportFilter {
    width: 100%;
    /* Mobile par dropdown full width hoga */
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background-color: #f8fafc;
}

/* View Map Link styling */
.map-link {
    text-decoration: none;
    color: #3b82f6;
    font-weight: 700;
    font-size: 0.85rem;
    border-bottom: 1px solid transparent;
}

/* Delete Button styling */
.del-btn {
    background: #fee2e2 !important;
    color: #ef4444 !important;
    border: none;
    padding: 6px 15px !important;
    /* Fixed padding */
    border-radius: 8px;
    font-size: 0.8rem !important;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: auto !important;
    /* Utni hi jagah lega jitni zarurat hai */
}

/* Status Badge Fix */
.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    background: #fef9c3;
    /* Yellow for caution */
    color: #854d0e;
}