/* assets/admin.css - Full updated version: Serial columns prominent, single headers enforced, Data Requests visibility fixed, bottom tablenav visible, JSON pre enhanced. Added status styling for requests. Layout forced to exactly 5-column grid with explicit positions for 2 rows of 5 buttons each. */
.dpdp-dashboard,
.dpdp-subpage {
    width: 100%;
    margin: 0;
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #c4b5fd 0%, #e9d5ff 50%, #d8b4fe 100%);
    color: #4c1d95;
    min-height: 100vh;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.dpdp-dashboard h1,
.dpdp-subpage h1 {
    color: #581c87;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.dpdp-dashboard p,
.dpdp-subpage p {
    color: #6b21a8;
    font-size: 1rem;
    margin-bottom: 30px;
    font-weight: 400;
}

.dpdp-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
    justify-content: center;
    width: 100%;
}

.metric-card {
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(200, 181, 253, 0.5);
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.metric-card::before {
    content: '📊';
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
}

.metric-card:nth-child(2)::before {
    content: '📝';
}

.metric-card:nth-child(3)::before {
    content: '🔒';
}

.metric-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    background: rgba(255,255,255,0.85);
}

.metric-card h3 {
    color: #581c87;
    margin: 0 0 15px;
    font-size: 1.1rem;
    font-weight: 600;
}

.metric-value {
    font-size: 3rem;
    font-weight: 700;
    margin: 0 0 10px;
    color: #7c3aed;
    line-height: 1;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.metric-card:nth-child(2) .metric-value {
    color: #ec4899;
}

.metric-card small {
    color: #8b5cf6;
    font-size: 0.9rem;
    display: block;
    font-style: italic;
    font-weight: 400;
}

.dpdp-nav-buttons {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, auto);
    gap: 15px;
    margin: 30px auto;
    max-width: 1200px;
    justify-content: center;
    width: 100%;
}

/* Explicit positioning to force exactly 5 per row: Top row (1-5), Bottom row (6-10) */
.nav-btn:nth-child(1) { grid-column: 1; grid-row: 1; } /* General Settings */
.nav-btn:nth-child(2) { grid-column: 2; grid-row: 1; } /* Consent Banner */
.nav-btn:nth-child(3) { grid-column: 3; grid-row: 1; } /* Translations */
.nav-btn:nth-child(4) { grid-column: 4; grid-row: 1; } /* Privacy Policy */
.nav-btn:nth-child(5) { grid-column: 5; grid-row: 1; } /* Consent Logs */
.nav-btn:nth-child(6) { grid-column: 1; grid-row: 2; } /* Data Requests */
.nav-btn:nth-child(7) { grid-column: 2; grid-row: 2; } /* Audit Logs */
.nav-btn:nth-child(8) { grid-column: 3; grid-row: 2; } /* Script Manager */
.nav-btn:nth-child(9) { grid-column: 4; grid-row: 2; } /* Exports */
.nav-btn:nth-child(10) { grid-column: 5; grid-row: 2; } /* Advanced */

.nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 15px;
    text-align: center;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    height: 100px;
    min-width: 160px;
    transition: all 0.3s ease;
    border: 1px solid rgba(200, 181, 253, 0.5);
    background: rgba(255,255,255,0.8);
    color: #581c87;
    position: relative;
    backdrop-filter: blur(10px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-btn::before {
    content: attr(data-icon);
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
    color: #7c3aed;
}

.nav-btn:hover {
    background: rgba(255,255,255,0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(200, 181, 253, 0.3);
}

.form-table {
    background: rgba(255,255,255,0.6);
    border-radius: 12px;
    padding: 20px;
    backdrop-filter: blur(10px);
    margin: 20px 0;
}

.form-table th,
.form-table td {
    padding: 15px 10px;
    border: none;
    background: none;
    vertical-align: top;
}

.form-table input,
.form-table textarea,
.form-table select {
    width: 100% !important;
    padding: 12px 16px;
    border: 2px solid rgba(200, 181, 253, 0.4);
    border-radius: 8px;
    font-size: 1rem;
    color: #4c1d95;
    background: rgba(255,255,255,0.9);
    transition: all 0.3s ease;
    box-sizing: border-box;
    margin-top: 5px;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    backdrop-filter: blur(5px);
}

.form-table input:focus,
.form-table textarea:focus,
.form-table select:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 33, 168, 0.1);
    outline: none;
    transform: translateY(-1px);
    background: #ffffff;
}

.form-table label {
    font-size: 0.95rem;
    color: #581c87;
    font-weight: 600;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.form-table textarea.large-text {
    min-height: 300px;
    resize: vertical;
    font-family: 'Monaco', 'Consolas', monospace;
    color: #4c1d95;
}

/* Button previews in Banner page */
.dpdp-btn-preview {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: default;
    margin-left: 10px;
    transition: all 0.2s;
}

.wp-list-table {
    background: rgba(255,255,255,0.7);
    border-radius: 12px;
    overflow: hidden;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    margin: 20px 0;
    border: none;
    width: 100%;
    table-layout: fixed;
}

.wp-list-table thead {
    display: table-header-group !important;
}

.wp-list-table thead th {
    background: rgba(255,255,255,0.8) !important;
    color: #581c87 !important;
    font-weight: 600;
    padding: 15px;
    border-bottom: 1px solid rgba(200, 181, 253, 0.3);
    position: sticky;
    top: 0;
    z-index: 10;
}

.wp-list-table tbody tr {
    background: rgba(255,255,255,0.5);
    transition: background 0.3s;
    display: table-row !important;
    opacity: 1 !important;
    min-height: 50px;
}

.wp-list-table tbody tr:hover {
    background: rgba(255,255,255,0.7);
}

.wp-list-table tbody tr:empty {
    display: none;
}

.wp-list-table td {
    padding: 15px;
    color: #581c87;
    border-bottom: 1px solid rgba(200, 181, 253, 0.2);
    word-wrap: break-word;
    overflow-wrap: break-word;
    vertical-align: top;
}

/* Serial number column - Global */
.wp-list-table .column-serial,
.wp-list-table .column-id {
    font-weight: 700 !important;
    color: #7c3aed !important;
    text-align: center !important;
    width: 60px !important;
    background: rgba(124, 62, 237, 0.1) !important;
    font-size: 1.1em !important;
    position: sticky;
    left: 0;
    z-index: 5;
}

/* Cookie ID specific */
.wp-list-table .column-cookie_id {
    min-width: 200px;
}

.wp-list-table .column-purposes {
    min-width: 300px;
}

/* Audit Logs specific */
.wp-list-table .column-action {
    min-width: 150px;
}

.wp-list-table .column-details pre {
    white-space: pre-wrap;
    font-size: 0.9rem;
    background: rgba(248, 250, 252, 0.9);
    padding: 10px;
    border-radius: 6px;
    margin: 0;
    max-height: 150px;
    overflow-y: auto;
    border-left: 4px solid #7c3aed;
    color: #1f2937;
    font-family: 'Monaco', 'Consolas', monospace;
    line-height: 1.4;
}

/* Data Requests specific */
.wp-list-table .column-type,
.wp-list-table .column-email {
    min-width: 150px;
}

.wp-list-table .column-data-requests tbody tr {
    border-top: 1px solid rgba(200, 181, 253, 0.2);
}

.wp-list-table .column-serial.column-id {
    font-size: 1.2em;
    color: #ec4899 !important;
}

.wp-list-table .dpdp-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.wp-list-table .dpdp-status.notice-success {
    background: #d1fae5;
    color: #065f46;
}

.wp-list-table .dpdp-status.notice-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Global JSON pre */
.wp-list-table pre {
    white-space: pre-wrap;
    font-size: 0.9rem;
    background: rgba(248, 250, 252, 0.9);
    padding: 10px;
    border-radius: 6px;
    margin: 0;
    max-height: 150px;
    overflow-y: auto;
    border-left: 4px solid #7c3aed;
    color: #1f2937;
    font-family: 'Monaco', 'Consolas', monospace;
    line-height: 1.4;
}

.wp-list-table .button-small {
    background: linear-gradient(135deg, #c4b5fd, #d8b4fe);
    color: #581c87;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-right: 5px;
    transition: all 0.3s;
}

.wp-list-table .button-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(200, 181, 253, 0.3);
}

.tablenav {
    text-align: center;
    margin: 20px 0;
}

/* Prevent duplicates */
.tablenav.top .displaying-num,
.screen-meta-toggle {
    display: none;
}

.wp-list-table tfoot,
.screen-meta {
    display: none !important;
}

.notice {
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(200, 181, 253, 0.4);
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    backdrop-filter: blur(10px);
    color: #581c87;
}

.notice-success {
    background: rgba(255,255,255,0.9);
    border-color: #34d399;
    color: #065f46;
}

.dpdp-subpage code {
    background: rgba(200, 181, 253, 0.3);
    color: #581c87;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Consolas', monospace;
}

/* Back to Dashboard button */
.back-to-dashboard {
    display: inline-block;
    margin-bottom: 20px;
    background: rgba(255,255,255,0.8);
    color: #581c87;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    backdrop-filter: blur(10px);
}

.back-to-dashboard:hover {
    background: rgba(255,255,255,0.9);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(200, 181, 253, 0.3);
}

/* Hide WP footer on DPDP pages */
#wpfooter {
    display: none;
}

@media (max-width: 782px) {
    .dpdp-nav-buttons {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 12px;
    }
    
    /* On mobile, reset to single column, no explicit positions needed */
    .nav-btn {
        grid-column: auto;
        grid-row: auto;
    }
    
    .dpdp-metrics {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .metric-value {
        font-size: 2.5rem;
    }
    
    .dpdp-dashboard,
    .dpdp-subpage {
        padding: 15px 10px;
    }
    
    .form-table th,
    .form-table td {
        display: block;
        width: 100%;
        padding: 15px;
    }
    
    .form-table th {
        width: 100%;
        border-bottom: none;
        background: rgba(255,255,255,0.7);
    }
    
    .wp-list-table th,
    .wp-list-table td {
        display: block;
        width: 100%;
        padding: 10px;
    }
    
    .wp-list-table .column-serial,
    .wp-list-table .column-id {
        width: 100%;
        text-align: left;
        font-size: 1em;
    }
    
    .wp-list-table pre {
        max-height: none;
        overflow-x: auto;
    }
}