/* ============================================
   ADMIN COMMON RESPONSIVE STYLES
   Shared across all admin pages
   ============================================ */

/* --- Hamburger button (hidden on desktop) --- */
.admin-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: #ffffff;
    margin-left: auto;
}

.admin-hamburger svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Drawer overlay --- */
.admin-drawer-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10003;
}

.admin-drawer-overlay.active {
    display: block;
}

/* --- Slide-in drawer --- */
.admin-drawer {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: #0a1628;
    z-index: 10004;
    transition: right 0.3s ease;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    -webkit-overflow-scrolling: touch;
}

.admin-drawer.active {
    right: 0;
}

.admin-drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.admin-drawer-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
}

.admin-drawer-close:hover {
    color: #ffffff;
}

.admin-drawer-user {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
    font-family: 'Poppins', sans-serif;
}

.admin-drawer-user strong {
    color: #ffffff;
}

.admin-drawer-section {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-drawer-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 8px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
}

.admin-drawer-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
    transition: color 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.admin-drawer-link:hover {
    color: #ffffff;
}

.admin-drawer-link.active {
    color: #3b82f6;
}

.admin-drawer-link.preview-link {
    color: #10b981;
}

.admin-drawer-link.preview-link:hover {
    color: #34d399;
}

.admin-drawer-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.admin-drawer-btn {
    display: block;
    width: 100%;
    padding: 10px 16px;
    border-radius: 6px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    border: none;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
}

.admin-drawer-btn.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.admin-drawer-btn.danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

/* --- Staging indicator in drawer --- */
.admin-drawer .staging-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.admin-drawer .publish-all-btn {
    width: 100%;
    padding: 8px 16px;
    background: #10b981;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
    font-family: 'Poppins', sans-serif;
}

.admin-drawer .publish-all-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

/* --- Responsive table card view --- */

.table-card-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 0;
    margin-bottom: 8px;
    font-size: 0.85rem;
    color: #6b7280;
    font-family: 'Poppins', sans-serif;
}

.table-card-toggle label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

/* Toggle switch */
.table-card-toggle .toggle-switch {
    position: relative;
    width: 40px;
    height: 22px;
    background: #d1d5db;
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.table-card-toggle .toggle-switch.active {
    background: #3b82f6;
}

.table-card-toggle .toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.table-card-toggle .toggle-switch.active::after {
    transform: translateX(18px);
}

/* Card container */
.responsive-cards {
    display: none;
}

.responsive-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.responsive-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

.responsive-card:active {
    background: #f9fafb;
}

.responsive-card.unread {
    border-left: 3px solid #3b82f6;
}

.responsive-card .card-field {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
    gap: 12px;
}

.responsive-card .card-field:last-child {
    border-bottom: none;
}

.responsive-card .card-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    font-weight: 600;
    flex-shrink: 0;
    padding-top: 2px;
    font-family: 'Poppins', sans-serif;
}

.responsive-card .card-value {
    font-size: 0.85rem;
    color: #1f2937;
    text-align: right;
    flex: 1;
    min-width: 0;
    word-break: break-word;
}

.responsive-card .card-value img {
    max-width: 48px;
    max-height: 48px;
    border-radius: 6px;
}

.responsive-card .card-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    padding-top: 12px;
    margin-top: 4px;
    border-top: 1px solid #e5e7eb;
}

/* --- Mobile media queries --- */

@media (max-width: 768px) {
    /* Show hamburger, keep header horizontal */
    .admin-hamburger {
        display: flex;
    }

    .admin-header {
        flex-direction: row !important;
        gap: 0 !important;
        text-align: left !important;
        padding: 12px 16px !important;
    }

    .admin-header-left {
        flex-direction: row !important;
        gap: 10px !important;
    }

    .admin-header-left .admin-logo {
        height: 28px;
    }

    .admin-header-left .admin-title {
        font-size: 0.9rem;
    }

    /* Hide header-right items (moved to drawer) */
    .admin-header-right {
        display: none !important;
    }

    /* Hide floating menu (navigation in drawer) */
    .admin-floating-menu,
    .admin-floating-menu-expand {
        display: none !important;
    }

    /* Show card view toggle */
    .table-card-toggle {
        display: flex;
    }
}

/* Desktop: ensure cards and toggle always hidden */
@media (min-width: 769px) {
    .responsive-cards {
        display: none !important;
    }

    .table-card-toggle {
        display: none !important;
    }

    .admin-drawer,
    .admin-drawer-overlay {
        display: none !important;
    }
}
