/* WishWell Custom Styles */
body {
    font-family: 'Inter', sans-serif;
    scroll-behavior: smooth;
}

/* View Management */
.view-section {
    display: none;
}

.view-section.active {
    display: block;
}

/* Modal and Overlay Effects */
.modal, .notification, #emoji-selector {
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.modal-content, #emoji-selector {
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.blurred-text {
    filter: blur(8px);
    user-select: none;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes scaleIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes glow {
    0% { background-color: #fef9c3; } /* yellow-100 */
    100% { background-color: transparent; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Loading Indicator */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-message {
    margin-top: 16px;
    font-size: 16px;
    font-weight: 500;
}

@keyframes wishHighlight {
    0% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
        background-color: #dbeafe; /* blue-100 */
    }
    50% { 
        transform: scale(1.02); 
        box-shadow: 0 0 20px 10px rgba(59, 130, 246, 0.3);
        background-color: #bfdbfe; /* blue-200 */
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
        background-color: transparent;
    }
}

/* Wish highlight class for notification navigation */
.wish-highlight {
    animation: wishHighlight 2s ease-in-out !important;
    transition: all 0.3s ease !important;
    position: relative;
    z-index: 10;
    border: 3px solid #3b82f6 !important;
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.5) !important;
}

/* Supporting Wishes Styles */
.wish-container {
    position: relative;
}

.supporting-wishes-tile {
    position: relative;
    transition: all 0.3s ease;
    margin-top: 0;
}

.supporting-wishes-tile .bg-purple-50,
.supporting-wishes-tile .bg-purple-900 {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

/* Navigation buttons */
.prev-support-btn, .next-support-btn {
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.prev-support-btn:hover:not(:disabled), 
.next-support-btn:hover:not(:disabled) {
    transform: scale(1.1);
}

/* Expand/Collapse buttons */
.expand-supports-btn, .collapse-supports-btn {
    transition: all 0.2s ease;
}

.expand-supports-btn:hover, .collapse-supports-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(168, 85, 247, 0.2);
}

/* Smooth scroll for expanded view */
.max-h-64 {
    scrollbar-width: thin;
    scrollbar-color: #c084fc #f3e8ff;
}

.max-h-64::-webkit-scrollbar {
    width: 6px;
}

.max-h-64::-webkit-scrollbar-track {
    background: #f3e8ff;
    border-radius: 3px;
}

.max-h-64::-webkit-scrollbar-thumb {
    background: #c084fc;
    border-radius: 3px;
}

.max-h-64::-webkit-scrollbar-thumb:hover {
    background: #a855f7;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.view-section.active {
    display: block;
}

.wish-tile-animate-in {
    animation: scaleIn 0.4s ease-out both;
    /* Prevent long words from breaking layout */
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    /* Ensure container doesn't allow overflow */
    overflow: hidden;
}

/* Apply word breaking to all text content within wish tiles */
.wish-tile-animate-in p,
.wish-tile-animate-in .expandable-text,
.wish-tile-animate-in .expandable-text-full {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    /* Enable CSS hyphens for better text breaking */
    hyphens: auto;
}

.highlight-wish {
    animation: glow 2.5s ease-out;
}

.pop-in {
    animation: scaleIn 0.2s ease-out;
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Admin Views */
.admin-view { 
    display: none; 
}

.admin-view.active { 
    display: block; 
}

/* Loading States */
.loading-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: .5;
    }
}

/* Interactive Elements */
.hover-scale:hover {
    transform: scale(1.02);
}

.transition-all {
    transition: all 0.2s ease-in-out;
}

/* Wish Grid Improvements */
.wish-grid {
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .wish-grid {
        gap: 1rem;
    }
}

/* Calendar Month Grid Styles */
#months-grid .month-card {
    position: relative;
    padding: 1.5rem 1rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #f9fafb;
    /* Mobile: larger touch targets */
    min-height: 88px;
}

/* Responsive Grid Layout */
@media (max-width: 640px) {
    /* Mobile: Single column for easy scrolling */
    #months-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
        max-height: 60vh;
        overflow-y: auto;
    }
    
    #months-grid .month-card {
        padding: 1.25rem;
        min-height: 72px;
        /* Larger touch target on mobile */
    }
    
    #months-grid .month-card .month-name {
        font-size: 1.125rem;
    }
    
    #months-grid .month-card .charity-name {
        font-size: 0.875rem;
        -webkit-line-clamp: 3;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    /* Tablet: 2 columns */
    #months-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem;
    }
    
    #months-grid .month-card {
        min-height: 96px;
    }
}

@media (min-width: 1025px) {
    /* Desktop: 4 columns */
    #months-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 0.75rem;
    }
}

.dark #months-grid .month-card {
    background-color: #374151;
}

#months-grid .month-card:not(.disabled):not(.booked):hover {
    background-color: #eff6ff;
    border-color: #3b82f6;
    transform: translateY(-2px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dark #months-grid .month-card:not(.disabled):not(.booked):hover {
    background-color: #1e3a8a;
    border-color: #60a5fa;
}

#months-grid .month-card .month-name {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.dark #months-grid .month-card .month-name {
    color: #f3f4f6;
}

#months-grid .month-card.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: #f3f4f6;
}

.dark #months-grid .month-card.disabled {
    background-color: #1f2937;
}

#months-grid .month-card.disabled .month-name {
    color: #9ca3af;
}

#months-grid .month-card.booked {
    background-color: #fee2e2;
    border-color: #ef4444;
    cursor: not-allowed;
}

.dark #months-grid .month-card.booked {
    background-color: #7f1d1d;
    border-color: #dc2626;
}

#months-grid .month-card.booked .month-name {
    color: #991b1b;
}

.dark #months-grid .month-card.booked .month-name {
    color: #fca5a5;
}

#months-grid .month-card .booked-label {
    font-size: 0.625rem;
    font-weight: 700;
    color: #dc2626;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.dark #months-grid .month-card .booked-label {
    color: #fca5a5;
}

#months-grid .month-card .charity-name {
    font-size: 0.75rem;
    color: #7f1d1d;
    text-align: center;
    line-height: 1.2;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.dark #months-grid .month-card .charity-name {
    color: #fecaca;
}

#months-grid .month-card.selected {
    background-color: #3b82f6;
    border-color: #2563eb;
    transform: scale(1.05);
}

.dark #months-grid .month-card.selected {
    background-color: #2563eb;
    border-color: #1d4ed8;
}

#months-grid .month-card.selected .month-name {
    color: white;
    font-weight: 700;
}

#months-grid .month-card.suggested {
    animation: pulse-suggestion 2s infinite;
    border-color: #10b981;
}

@keyframes pulse-suggestion {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(16, 185, 129, 0);
    }
}

/* Mobile Modal Optimizations */
@media (max-width: 640px) {
    #charity-schedule-calendar-modal .modal-content {
        max-width: 100%;
        max-height: 95vh;
        margin: 0;
        border-radius: 0.75rem;
        display: flex;
        flex-direction: column;
    }
    
    #charity-schedule-calendar-modal .modal-content > div:nth-child(2) {
        /* Main content area - make scrollable */
        flex: 1;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Sticky header on mobile */
    #charity-schedule-calendar-modal .sticky {
        position: sticky;
        top: 0;
        z-index: 10;
    }
    
    /* Year navigation - more compact on mobile */
    #prev-year-btn,
    #next-year-btn {
        padding: 0.75rem;
        min-height: 44px;
        min-width: 44px;
    }
    
    #prev-year-btn span,
    #next-year-btn span {
        display: none;
    }
    
    #calendar-year {
        font-size: 1.5rem;
    }
    
    /* Larger confirm button on mobile */
    #confirm-schedule-btn {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
        font-weight: 600;
    }
    
    /* Footer adjustments */
    #charity-schedule-calendar-modal .border-t {
        padding: 1rem;
        flex-direction: column-reverse;
        gap: 0.75rem;
    }
    
    #charity-schedule-calendar-modal .border-t button:first-child {
        width: 100%;
        padding: 0.75rem;
    }
}

/* ============================================
   PHASE 2: MOBILE ENHANCEMENTS
   - Filter Drawer System
   - Enhanced Touch Feedback
   ============================================ */

/* Enhanced Touch Feedback - All Devices */
button, a, .clickable {
    -webkit-tap-highlight-color: rgba(59, 130, 246, 0.3);
    transition: transform 0.1s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

button:active, a:active, .clickable:active {
    transform: scale(0.98);
}

/* Primary Buttons - Enhanced Feedback */
.bg-blue-600:active, .bg-green-600:active, .bg-red-600:active, 
.bg-orange-600:active, .bg-purple-600:active {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Mobile Filter Drawer System */
.mobile-filter-drawer {
    display: none; /* Hidden by default, shown via JS on mobile */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-height: 85vh;
    overflow-y: auto;
}

.mobile-filter-drawer.dark {
    background: #1f2937;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4);
}

.mobile-filter-drawer.active {
    transform: translateY(0);
}

.mobile-filter-drawer-header {
    position: sticky;
    top: 0;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 10;
}

.dark .mobile-filter-drawer-header {
    background: #1f2937;
    border-bottom-color: #374151;
}

.mobile-filter-drawer-content {
    padding: 1.5rem;
}

.mobile-filter-drawer-actions {
    position: sticky;
    bottom: 0;
    background: white;
    border-top: 1px solid #e5e7eb;
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
}

.dark .mobile-filter-drawer-actions {
    background: #1f2937;
    border-top-color: #374151;
}

/* Floating Filter Button */
.mobile-filter-fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
    border: none;
    display: none; /* Hidden on desktop, shown on mobile via @media query */
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 999;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mobile-filter-fab:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.mobile-filter-fab.has-active-filters {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.mobile-filter-fab .filter-count-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 11px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* Backdrop Overlay */
.mobile-filter-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-filter-backdrop.active {
    opacity: 1;
}

/* Mobile Admin Reports Optimization */
@media (max-width: 768px) {
    /* Admin Reports - Header Buttons */
    #reported-wishes-buttons,
    #pending-wishes-buttons,
    #reported-buttons,
    #pending-buttons {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    #reported-wishes-buttons button,
    #pending-wishes-buttons button,
    #reported-buttons button,
    #pending-buttons button {
        width: 100%;
        min-height: 44px;
        justify-content: center;
        font-size: 14px;
    }
    
    /* Filters - Stack Vertically */
    .bg-gray-100.dark\\:bg-gray-700 .flex.flex-wrap {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    
    .bg-gray-100.dark\\:bg-gray-700 .flex.flex-wrap > div {
        width: 100%;
    }
    
    .bg-gray-100.dark\\:bg-gray-700 .flex.flex-wrap label {
        display: block;
        margin-bottom: 0.25rem;
    }
    
    .bg-gray-100.dark\\:bg-gray-700 .flex.flex-wrap select {
        width: 100%;
        min-height: 44px;
        font-size: 16px; /* Prevents iOS zoom */
    }
    
    /* Filter Action Buttons */
    .bg-gray-100.dark\\:bg-gray-700 .flex.gap-2 {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .bg-gray-100.dark\\:bg-gray-700 .flex.gap-2 button {
        width: 100%;
        min-height: 44px;
    }
    
    /* Report Groups - Mobile Card Style */
    .report-group {
        margin-bottom: 1rem;
    }
    
    .report-group > div:first-child {
        /* Header */
        padding: 1rem !important;
    }
    
    .report-group h3 {
        font-size: 1rem !important;
    }
    
    .report-group .flex.justify-between {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .report-group .text-right {
        text-align: left !important;
    }
    
    .report-group .text-2xl {
        font-size: 1.5rem !important;
    }
    
    /* Toggle Button */
    .toggle-reports-btn {
        min-height: 36px;
        font-size: 12px !important;
    }
    
    /* Individual Reports */
    .report-group .reports-container > div {
        padding: 1rem !important;
    }
    
    /* Report Content */
    .report-group .bg-white.dark\\:bg-gray-700 {
        padding: 0.75rem !important;
    }
    
    /* Admin Actions - Stack Vertically */
    .report-group .bg-gray-50.dark\\:bg-gray-700,
    .report-group .bg-purple-50.dark\\:bg-purple-900\\/20 {
        padding: 1rem !important;
    }
    
    .report-group .flex.justify-end {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    .report-group .flex.justify-end button {
        width: 100%;
        min-height: 44px;
    }
    
    /* Reported Content Box */
    .report-group code {
        word-break: break-all;
        font-size: 11px;
    }
    
    /* Reporter Info */
    .report-group .text-xs {
        font-size: 11px !important;
    }
    
    /* Status Badges */
    .report-group span.px-2 {
        font-size: 11px !important;
        padding: 0.25rem 0.5rem !important;
    }
    
    /* Dismiss/Delete Buttons - More Visible */
    .admin-dismiss-all-btn,
    .admin-delete-item-btn {
        font-size: 14px !important;
        padding: 0.75rem 1rem !important;
    }

    /* CHARITY SUBMISSIONS - Mobile Optimization */
    
    /* Status Tabs - Horizontal Scroll on Mobile */
    .submissions-tab {
        white-space: nowrap;
        min-width: auto;
        padding: 0.75rem 1rem !important;
        font-size: 13px !important;
    }
    
    #admin-charity-submissions nav {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        gap: 0.5rem;
    }
    
    /* Submission Cards */
    .submission-item {
        padding: 1rem !important;
    }
    
    .submission-item h4 {
        font-size: 1rem !important;
    }
    
    /* Submission Header - Stack Logo and Title */
    .submission-item > div:first-child {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 0.75rem;
    }
    
    .submission-item > div:first-child > div:first-child {
        flex-direction: column;
        align-items: flex-start !important;
        width: 100%;
    }
    
    .submission-item img {
        width: 60px !important;
        height: 60px !important;
        margin-bottom: 0.5rem;
    }
    
    .submission-item .submission-checkbox {
        margin-bottom: 0.5rem;
    }
    
    /* Grid to Stack on Mobile */
    .submission-item .grid.grid-cols-1.md\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Links Break Properly */
    .submission-item a {
        word-break: break-all;
        font-size: 13px;
    }
    
    /* Status Badge */
    .submission-item .status-badge {
        font-size: 11px !important;
        padding: 0.375rem 0.75rem !important;
    }
    
    /* Action Buttons - Stack Vertically */
    .submission-item .flex.items-center.justify-between.pt-4 {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch !important;
    }
    
    .submission-item .flex.items-center.space-x-2 {
        flex-direction: column !important;
        gap: 0.5rem !important;
        width: 100%;
    }
    
    .submission-item .flex.items-center.space-x-2 button {
        width: 100%;
        min-height: 44px;
    }
    
    /* Schedule/Logo Buttons */
    .schedule-submission-btn,
    .upload-logo-btn,
    .approve-submission-btn,
    .reject-submission-btn,
    .preview-charity-btn,
    .update-schedule-btn {
        font-size: 14px !important;
        padding: 0.75rem 1rem !important;
    }
    
    /* Bulk Actions Bar */
    #submissions-bulk-actions .flex.items-center.justify-between {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
    }
    
    #submissions-bulk-actions .flex.items-center.space-x-4,
    #submissions-bulk-actions .flex.items-center.space-x-2 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }
    
    #submissions-bulk-actions button {
        width: 100%;
        min-height: 44px;
    }
    
    #submissions-bulk-actions span {
        text-align: center;
        padding: 0.5rem;
    }
    
    /* RECATEGORIZE - Mobile Optimization */
    
    /* Category Management Cards */
    #recategorize-list .grid.grid-cols-1.md\\:grid-cols-2 {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    /* Category Management Forms */
    #recategorize-list .flex.gap-2 {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }
    
    #recategorize-list .flex.gap-2 input,
    #recategorize-list .flex.gap-2 select {
        width: 100% !important;
        min-height: 44px;
        font-size: 16px;
    }
    
    #recategorize-list .flex.gap-2 button {
        width: 100%;
        min-height: 44px;
        font-size: 14px;
    }
    
    /* Wish Cards */
    #recategorize-list .space-y-4 > div {
        padding: 1rem !important;
    }
    
    #recategorize-list .text-sm {
        font-size: 13px !important;
    }
    
    /* Recategorize Controls */
    #recategorize-list .flex.items-center.gap-2 {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }
    
    #recategorize-list .category-select {
        width: 100% !important;
        min-height: 44px;
        font-size: 16px;
    }
    
    #recategorize-list .recategorize-btn {
        width: 100%;
        min-height: 44px;
        font-size: 14px !important;
    }
    
    #recategorize-list label {
        width: 100%;
        text-align: left;
    }
    
    /* CHARITY SETTINGS - Mobile Optimization */
    
    /* Charity Settings Form */
    #admin-charity .space-y-4 {
        padding: 1rem !important;
    }
    
    #admin-charity input[type="text"],
    #admin-charity input[type="url"],
    #admin-charity input[type="file"],
    #admin-charity textarea,
    #admin-charity select {
        font-size: 16px !important; /* Prevents iOS zoom */
        min-height: 44px;
    }
    
    #admin-charity textarea {
        min-height: 100px;
    }
    
    /* File Input - Make More Touch-Friendly */
    #admin-charity input[type="file"] {
        padding: 0.75rem !important;
    }
    
    #admin-charity input[type="file"]::file-selector-button {
        min-height: 36px;
        font-size: 14px;
    }
    
    /* Save Button */
    #admin-charity .text-right {
        text-align: left !important;
    }
    
    #admin-charity #save-charity-btn {
        width: 100%;
        min-height: 44px;
        font-size: 14px !important;
    }
    
    /* Charity History Cards */
    #admin-charity #charity-history-container > div {
        padding: 1rem !important;
    }
    
    /* Charity Info Cards - Stack Elements */
    #admin-charity .flex.justify-between.items-start {
        flex-direction: column !important;
        gap: 1rem;
    }
    
    #admin-charity .flex.justify-between.items-start .flex-1 {
        width: 100%;
    }
    
    #admin-charity .flex.justify-between.items-start .flex-shrink-0 {
        width: 100%;
        margin-right: 0 !important;
        margin-bottom: 0.5rem;
    }
    
    /* Logo in Cards */
    #admin-charity .flex.justify-between.items-start img {
        width: 80px !important;
        height: 80px !important;
    }
    
    /* External Link Icon */
    #admin-charity .flex.justify-between.items-start a svg {
        width: 20px !important;
        height: 20px !important;
    }
    
    /* Status Badges in History */
    #admin-charity .px-2.py-1 {
        font-size: 11px !important;
        padding: 0.375rem 0.75rem !important;
    }
    
    /* Earnings Text */
    #admin-charity .text-sm.font-semibold {
        font-size: 13px !important;
    }
    
    /* Submitted By Section */
    #admin-charity .p-3.bg-purple-50 {
        padding: 0.75rem !important;
    }
    
    #admin-charity .p-3.bg-purple-50 .text-sm {
        font-size: 12px !important;
    }
    
    #admin-charity .p-3.bg-purple-50 button {
        word-break: break-word;
    }
    
    /* Charity History Cards - Reposition "Set as Active" Button */
    .charity-history-item .flex.items-start.justify-between {
        flex-direction: column !important;
    }
    
    .charity-history-item .flex.items-center {
        flex-wrap: wrap !important;
        gap: 0.5rem;
    }
    
    /* Move "Set as Active" button below the name/badge */
    .reactivate-charity-btn {
        margin-left: 0 !important;
        margin-top: 0.75rem !important;
        width: 100%;
        min-height: 44px;
        justify-content: center !important;
        font-size: 14px !important;
    }
    
    /* Grid of dates/info - Stack on Mobile */
    .charity-history-item .grid.grid-cols-1 {
        gap: 0.75rem !important;
        margin-top: 1rem !important;
    }
    
    /* Action Buttons at Bottom */
    .charity-history-item .mt-3.flex.space-x-2 {
        flex-direction: column !important;
        gap: 0.5rem !important;
        margin-top: 1rem !important;
    }
    
    .charity-history-item .mt-3.flex.space-x-2 button {
        width: 100%;
        min-height: 44px;
        font-size: 14px !important;
    }
    
    /* Logo Size */
    .charity-history-item img.w-8 {
        width: 40px !important;
        height: 40px !important;
    }
    
    /* NOTIFICATIONS DROPDOWN - Mobile Positioning */
    /* Position from viewport, not relative to parent container */
    #notifications-dropdown {
        position: fixed !important;
        left: 0.5rem !important;
        right: auto !important;
        top: 4rem !important;
        width: calc(100vw - 1rem) !important;
        max-width: 380px !important;
        z-index: 1000 !important;
    }
    
    /* CHARITY INFORMATION PAGE - Mobile Optimization */
    
    /* Current Charity Partner Card - Uses same layout as Historical Timeline */
    #charity-info-view .bg-white.dark\\:bg-gray-800.rounded-lg.shadow-md {
        padding: 1rem !important;
    }
    
    /* No custom styling needed - createCharityInfoHTML() provides consistent layout */
    
    #charity-info-view h1 {
        font-size: 1.5rem !important;
    }
    
    #charity-info-view h2 {
        font-size: 1.125rem !important;
    }
    
    #charity-info-view h3 {
        font-size: 1rem !important;
    }
    
    /* Charity tabs - equal spacing on both sides of dividers */
    #charity-info-view nav.flex {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap !important;
        gap: 0;
        padding-bottom: 0.5rem;
        padding-left: 0.5rem;
        padding-right: 0.5rem;
        justify-content: flex-start;
    }
    
    .charity-tab {
        flex-shrink: 0;
        min-width: auto;
        padding: 0.75rem 2rem 0.75rem 0.25rem !important;
        font-size: 13px !important;
        position: relative;
    }
    
    /* Divider positioned at right edge - adjusted padding for visual balance */
    .charity-tab:not(:last-child)::after {
        content: '';
        position: absolute;
        right: 0;
        top: 25%;
        bottom: 25%;
        width: 1px;
        background-color: #d1d5db;
    }
    
    body.dark-mode .charity-tab:not(:last-child)::after {
        background-color: #4b5563;
    }
    
    /* Charity suggestion form */
    #charity-suggest-form input,
    #charity-suggest-form textarea {
        font-size: 16px !important; /* Prevents iOS zoom */
    }
    
    #charity-suggest-form label {
        font-size: 14px !important;
    }
    
    #submit-charity-suggestion-btn {
        font-size: 14px !important;
        padding: 0.875rem 1rem !important;
    }
    
    /* Charity cards in timeline */
    #upcoming-charities-list > div,
    #charity-history-timeline > div {
        padding: 1rem !important;
    }
    
    /* ABOUT/MISSION PAGE - Mobile Optimization */
    
    #our-mission-view h1 {
        font-size: 1.75rem !important;
    }
    
    #our-mission-view h2 {
        font-size: 1.25rem !important;
    }
    
    /* Keep the dollar amount BIG and BOLD! */
    #total-contributions {
        font-size: 2.5rem !important;
        font-weight: 800 !important;
    }
    
    #our-mission-view h3:not(#charity-name-mission) {
        font-size: 1.125rem !important;
    }
    
    #our-mission-view p:not(#total-contributions):not(#charity-desc-mission),
    #our-mission-view li {
        font-size: 14px !important;
        line-height: 1.6;
    }
    
    #our-mission-view .bg-white.dark\\:bg-gray-800 {
        padding: 1.5rem !important;
    }
    
    #our-mission-view .space-y-6 {
        gap: 1.5rem;
    }
    
    /* Featured Charity Section - Icon next to name, description fills width */
    #our-mission-view .mt-6.p-6.border {
        flex-direction: column !important;
        gap: 0.75rem !important;
        padding: 1rem !important;
    }
    
    /* Icon and name row - keep them together */
    #charity-logo-container-mission {
        display: inline-block !important;
        vertical-align: middle !important;
        margin-right: 1rem !important;
    }
    
    #charity-logo-container-mission img,
    #charity-logo-container-mission svg {
        width: 48px !important;
        height: 48px !important;
        display: inline-block !important;
    }
    
    #charity-name-mission {
        display: inline-block !important;
        vertical-align: middle !important;
        font-size: 1.125rem !important;
        margin-bottom: 0 !important;
    }
    
    /* Description fills full width below */
    #charity-desc-mission {
        display: block !important;
        font-size: 14px !important;
        line-height: 1.5 !important;
        margin-top: 0.75rem !important;
    }
    
    #charity-website-mission {
        display: inline-block !important;
        margin-top: 0.5rem !important;
        font-size: 14px !important;
    }
    
    /* COMMUNITY GUIDELINES - Mobile Optimization */
    
    #community-guidelines-view h1 {
        font-size: 1.75rem !important;
    }
    
    #community-guidelines-view h2 {
        font-size: 1.125rem !important;
    }
    
    #community-guidelines-view h3:not(.text-2xl) {
        font-size: 1rem !important;
    }
    
    #community-guidelines-view h3.text-2xl {
        font-size: 1.5rem !important;
    }
    
    #community-guidelines-view h4 {
        font-size: 1.125rem !important;
    }
    
    #community-guidelines-view p,
    #community-guidelines-view li {
        font-size: 14px !important;
        line-height: 1.6;
    }
    
    #community-guidelines-view .bg-white.dark\\:bg-gray-800,
    #community-guidelines-view .bg-blue-50.dark\\:bg-blue-900 {
        padding: 1.5rem !important;
    }
    
    #community-guidelines-view ul,
    #community-guidelines-view ol {
        padding-left: 1.5rem;
    }
    
    #community-guidelines-view .space-y-4 {
        gap: 1rem;
    }
}

/* Tablet Adjustments (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    .report-group {
        font-size: 14px;
    }
    
    .report-group h3 {
        font-size: 1.125rem !important;
    }
    
    #reported-wishes-buttons button,
    #pending-wishes-buttons button {
        font-size: 13px;
        padding: 0.625rem 1rem;
    }
    
    /* Charity Submissions - Tablet */
    .submission-item {
        font-size: 14px;
    }
    
    .submission-item h4 {
        font-size: 1.125rem !important;
    }
    
    /* Recategorize - Tablet */
    #recategorize-list .text-sm {
        font-size: 13px !important;
    }
}