/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
    --transition: all 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Prevent pull-to-refresh on mobile */
    overscroll-behavior-y: contain;
}

/* Better touch scrolling on iOS */
* {
    -webkit-overflow-scrolling: touch;
}

/* Login Page */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.login-form {
    margin-bottom: 1rem;
}

.login-footer {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.875rem;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="file"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    transition: var(--transition);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.title-input {
    min-height: 120px;
    font-size: 1rem;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
}

.form-group label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.char-count {
    font-size: 0.75rem;
    font-weight: normal;
    color: var(--text-secondary);
    margin-left: auto;
}

.char-count-warning {
    color: var(--warning-color);
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #475569;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1rem;
    transition: var(--transition);
    border-radius: 4px;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
}

.btn-icon-danger {
    color: #dc3545;
}

.btn-icon-danger:hover {
    background: rgba(220, 53, 69, 0.1);
    color: #c82333;
}

.btn-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.5rem;
    transition: var(--transition);
    color: var(--text-secondary);
    border-radius: 4px;
}

.btn-toggle:hover {
    background: var(--bg-tertiary);
}

.btn-toggle.active {
    color: #fbbf24;
}

.btn-icon i {
    font-size: 1rem;
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 250px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-secondary);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

.nav-icon {
    margin-right: 0.75rem;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: visible;
}

.top-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    margin-right: 1rem;
    border-radius: var(--radius);
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    background: var(--bg-tertiary);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.user-info i {
    margin-right: 0.5rem;
}

.top-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.user-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Page Content */
.page-content {
    display: block !important;
    padding: 2rem;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 200px;
    overflow: visible;
    position: relative;
}

/* Legacy class for backward compatibility (not needed in separate page files) */
.page-content.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    font-size: 2.5rem;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Quick Actions */
.quick-actions {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.quick-actions h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Page Toolbar */
.page-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.toolbar-left {
    display: flex;
    gap: 1rem;
    flex: 1;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.filter-select {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    background: var(--bg-primary);
    min-width: 150px;
}

/* Data Table */
.data-table-container {
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow-x: auto;
    min-height: 200px;
    display: block !important;
    visibility: visible !important;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    display: table !important;
    visibility: visible !important;
    table-layout: auto;
}

.data-table thead {
    background: var(--bg-tertiary);
    display: table-header-group !important;
}

.data-table tbody {
    display: table-row-group !important;
    visibility: visible !important;
}

.data-table tr {
    display: table-row !important;
    visibility: visible !important;
}

.data-table tbody tr {
    display: table-row !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    display: table-cell !important;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
    color: var(--text-primary);
    display: table-cell !important;
}

.data-table tbody tr:hover {
    background: var(--bg-secondary);
}

/* Drag and Drop for Categories */
.category-row.dragging {
    opacity: 0.5;
    cursor: grabbing !important;
}

.category-row.drag-over {
    border-top: 2px solid var(--primary-color);
}

.category-row[draggable="true"] {
    cursor: grab;
}

.category-row[draggable="true"]:active {
    cursor: grabbing;
}

.drag-handle {
    cursor: grab;
    user-select: none;
    text-align: center;
}

.drag-handle:active {
    cursor: grabbing;
}

.category-row.dragging .drag-handle {
    cursor: grabbing;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.table-image {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: transform 0.2s ease;
}

.table-image:hover {
    transform: scale(1.05);
    cursor: pointer;
}

.title-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.text-center {
    text-align: center;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.image-preview {
    margin-top: 1rem;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

/* Image Preview Modal */
.image-preview-modal {
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.9);
}

.image-preview-modal.active {
    display: flex;
}

.image-preview-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.image-preview-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: var(--transition);
    font-size: 1.25rem;
}

.image-preview-close:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.image-preview-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: var(--bg-secondary);
    max-height: calc(90vh - 100px);
    overflow: auto;
}

.preview-image-full {
    max-width: 100%;
    max-height: calc(90vh - 100px);
    height: auto;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
}

.image-preview-info {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.image-preview-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    word-wrap: break-word;
}

.error-message {
    background: #fee2e2;
    color: #991b1b;
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Pagination */
.pagination {
    margin-top: 1.5rem;
    display: flex !important;
    justify-content: center;
    visibility: visible !important;
    opacity: 1 !important;
    min-height: 60px;
}

.pagination-controls {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    visibility: visible !important;
    opacity: 1 !important;
    width: 100%;
}

.pagination-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    gap: 0.25rem;
    visibility: visible !important;
    opacity: 1 !important;
}

.pagination-btn:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-pages {
    display: flex !important;
    align-items: center;
    gap: 0.25rem;
    visibility: visible !important;
    opacity: 1 !important;
}

.pagination-page {
    min-width: 36px;
    height: 36px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    visibility: visible !important;
    opacity: 1 !important;
}

.pagination-page:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.pagination-page-active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    font-weight: 600;
}

.pagination-page-active:hover {
    background: var(--primary-hover);
    color: white;
}

.pagination-ellipsis {
    padding: 0 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.pagination-jump {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    margin-left: 0.5rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-color);
    visibility: visible !important;
    opacity: 1 !important;
}

.pagination-input {
    width: 60px;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.875rem;
    text-align: center;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: var(--transition);
    display: block !important;
    visibility: visible !important;
}

.pagination-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.pagination-go-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--primary-color);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    visibility: visible !important;
    opacity: 1 !important;
}

.pagination-go-btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
    display: inline-block !important;
    visibility: visible !important;
}

.pagination-items-info {
    margin-left: 0.75rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.875rem;
    white-space: nowrap;
    display: inline-block !important;
    visibility: visible !important;
}

.pagination-ellipsis {
    display: inline-block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

@media (max-width: 768px) {
    .pagination-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pagination-jump {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-top: 0.75rem;
        width: 100%;
        justify-content: center;
    }
    
    .pagination-items-info {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        width: 100%;
        text-align: center;
    }
    
    .pagination-pages {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination-btn {
        flex: 1;
        min-width: auto;
    }
}

/* Notification Form */
.notification-container {
    max-width: 900px;
    margin: 0 auto;
}

.notification-header {
    margin-bottom: 2rem;
}

.notification-header h2 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.notification-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.notification-form {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.notification-mode {
    margin-bottom: 1.5rem;
}

.image-search-wrapper {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.image-search-wrapper .search-input {
    flex: 1;
}

.notification-image-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
}

.notification-image-item {
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    background: var(--bg-primary);
}

.notification-image-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.notification-image-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.notification-image-item-title {
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-primary);
    word-wrap: break-word;
    line-height: 1.4;
}

.selected-image-preview {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    border: 2px solid var(--primary-color);
    margin-top: 1rem;
    align-items: center;
}

.selected-image-preview img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius);
}

.selected-image-info {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.selected-image-info strong {
    color: var(--text-primary);
    font-size: 0.9rem;
    word-wrap: break-word;
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.success-message {
    background: #d1fae5;
    color: #065f46;
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.form-group label input[type="radio"] {
    margin-right: 0.5rem;
}

.form-group label {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

/* Notification History */
.notification-history {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.notification-history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.notification-history-header h2 {
    font-size: 1.25rem;
    color: var(--text-primary);
}

.notification-history-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.notification-history-item {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.notification-history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.notification-history-item-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
    flex-wrap: wrap;
}

.notification-history-item-title strong {
    font-size: 1rem;
    color: var(--text-primary);
}

.notification-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.status-success {
    background: #d1fae5;
    color: #065f46;
}

.status-failed {
    background: #fee2e2;
    color: #991b1b;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.notification-history-item-content {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.notification-history-item-details {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.notification-history-item-details div {
    margin-bottom: 0.25rem;
}

.notification-history-item-details strong {
    color: var(--text-primary);
}

.notification-history-item-image {
    flex-shrink: 0;
}

.notification-history-item-image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.notification-history-item-image img:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow);
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .mobile-overlay {
        display: block;
        pointer-events: none;
    }
    
    .mobile-overlay.active {
        pointer-events: auto;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: var(--shadow-lg);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-left {
        flex-direction: column;
    }

    .search-input,
    .filter-select {
        width: 100%;
    }

    .data-table {
        font-size: 0.8rem;
    }

    .data-table th,
    .data-table td {
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }

    .data-table th:first-child,
    .data-table td:first-child {
        padding-left: 0.75rem;
    }

    .data-table th:last-child,
    .data-table td:last-child {
        padding-right: 0.75rem;
    }

    .top-header {
        padding: 1rem;
        gap: 0.5rem;
    }

    .top-header h1 {
        font-size: 1.25rem;
        flex: 1;
        min-width: 0;
    }

    .user-info {
        font-size: 0.8rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }

    .user-info i {
        display: none;
    }

    .page-content {
        padding: 1rem;
    }

    .modal-content {
        max-width: 100%;
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.75rem;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .btn {
        padding: 0.75rem 1rem;
        min-height: 44px;
        font-size: 0.875rem;
    }

    .btn-icon {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .btn-toggle {
        min-width: 44px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .title-input {
        min-height: 100px;
    }

    .char-count {
        font-size: 0.7rem;
    }

    .search-input {
        min-height: 44px;
    }

    .filter-select {
        min-height: 44px;
    }

    .table-image {
        width: 80px;
        height: 80px;
    }

    .title-cell {
        max-width: 150px;
    }
}

@media (max-width: 480px) {
    /* Safe area support for iOS */
    body {
        padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    .modal-footer {
        flex-direction: column;
        gap: 0.75rem;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .modal-footer .btn {
        width: 100%;
    }

    .toolbar-left {
        flex-direction: column;
        width: 100%;
    }

    .search-input,
    .filter-select {
        width: 100%;
    }

    .page-toolbar {
        flex-direction: column;
        align-items: stretch;
        position: sticky;
        top: 0;
        background: var(--bg-primary);
        z-index: 50;
        padding: 1rem;
        margin: -1rem -1rem 1rem -1rem;
        box-shadow: var(--shadow);
    }

    .page-toolbar .btn {
        width: 100%;
    }

    /* Mobile Table Card View */
    .data-table-container {
        overflow-x: visible;
        background: transparent;
        box-shadow: none;
    }

    .data-table {
        display: block;
        font-size: 0.875rem;
        border: none;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: block !important;
        visibility: visible !important;
    }
    
    .data-table tbody tr {
        display: block !important;
        visibility: visible !important;
        margin-bottom: 1rem;
    }

    .data-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        background: var(--bg-primary);
        padding: 1rem;
        box-shadow: var(--shadow);
        transition: var(--transition);
    }

    .data-table tbody tr:active {
        transform: scale(0.98);
        box-shadow: var(--shadow);
    }

    .data-table tbody td {
        display: block;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid var(--bg-tertiary);
        text-align: left;
    }

    .data-table tbody td:last-child {
        border-bottom: none;
        padding-top: 0.75rem;
    }

    .data-table tbody tr:has(.table-image) td:first-of-type {
        padding: 0 0 1rem 0;
        border-bottom: 1px solid var(--border-color);
    }

    .sidebar {
        width: 100%;
        max-width: 300px;
    }

    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .user-info {
        display: none;
    }

    .image-preview-modal-content {
        max-width: 100vw;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }

    .image-preview-container {
        padding: 1rem;
        max-height: calc(100vh - 120px);
    }

    .preview-image-full {
        max-height: calc(100vh - 120px);
    }

    .image-preview-close {
        top: 1rem;
        right: 1rem;
        width: 40px;
        height: 40px;
        font-size: 1.125rem;
    }

    .image-preview-info {
        padding: 1rem;
    }

    .image-preview-info h3 {
        font-size: 0.95rem;
    }

    .notification-image-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }

    .selected-image-preview {
        flex-direction: column;
        text-align: center;
    }

    .selected-image-info {
        flex-direction: column;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .form-actions {
        flex-direction: column;
        padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    }

    .form-actions .btn {
        width: 100%;
    }

    .image-search-wrapper {
        flex-direction: column;
    }

    /* Bulk Actions Mobile Optimization */
    .bulk-actions-bar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        position: sticky;
        top: 0;
        z-index: 100;
    }

    .bulk-actions-buttons {
        flex-direction: column;
        width: 100%;
    }

    .bulk-actions-buttons .btn {
        width: 100%;
    }

    /* Toast positioning on mobile */
    .toast-container {
        top: auto;
        bottom: 20px;
        left: 10px;
        right: 10px;
        max-width: 100%;
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    /* Pagination mobile optimization */
    .pagination-controls {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }

    .pagination-pages {
        order: -1;
        flex-wrap: wrap;
        justify-content: center;
        margin: 0.5rem 0;
    }

    .pagination-jump {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border-color);
        padding-top: 1rem;
        width: 100%;
        justify-content: center;
    }

    .pagination-items-info {
        margin-left: 0;
        padding-left: 0;
        border-left: none;
        width: 100%;
        text-align: center;
        order: 1;
    }

    .pagination-btn {
        flex: 1;
        min-width: 0;
    }

    /* Keyboard shortcuts help mobile */
    .keyboard-shortcuts {
        bottom: auto;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        max-width: 90vw;
        max-height: 80vh;
        overflow-y: auto;
    }

    /* Advanced filters mobile */
    .advanced-filters-grid {
        grid-template-columns: 1fr;
    }

    /* Notification history mobile */
    .notification-history-item-content {
        flex-direction: column;
    }

    .notification-history-item-image {
        width: 100%;
        text-align: center;
    }

    .notification-history-item-image img {
        width: 100%;
        max-width: 200px;
        height: auto;
    }

    /* Stats cards mobile optimization */
    .stat-card {
        padding: 1rem 0.75rem;
    }

    .stat-icon {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.8rem;
    }

    /* Top header sticky on mobile */
    .top-header {
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--bg-primary);
        box-shadow: var(--shadow);
    }

    /* Page content padding adjustment */
    .page-content {
        padding: 0.75rem;
    }

    /* Modal full screen on mobile */
    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        border-radius: var(--radius) var(--radius) 0 0;
        max-height: 95vh;
        margin: 0;
        width: 100%;
    }

    /* Prevent text selection on buttons */
    .btn, .btn-icon, .btn-toggle {
        -webkit-tap-highlight-color: transparent;
        user-select: none;
        -webkit-user-select: none;
    }

    /* Better touch targets */
    .btn-icon {
        min-width: 48px;
        min-height: 48px;
        padding: 0.5rem;
    }

    .btn-toggle {
        min-width: 48px;
        min-height: 48px;
    }

    /* Notification history header mobile */
    .notification-history-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .notification-history-header > div {
        width: 100%;
    }

    .notification-history-header h2 {
        margin-bottom: 0;
    }

    /* Template items mobile */
    .template-item {
        padding: 0.75rem;
    }

    .template-icon {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
}

/* Additional Mobile Optimizations */
@media (max-width: 768px) {
    /* Sticky bulk actions */
    #bulkActionsBar {
        position: sticky;
        top: 0;
        z-index: 101;
    }

    /* Better table display */
    .data-table-container {
        border-radius: var(--radius);
    }

    /* Optimize notification image list */
    .notification-image-list {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    /* Better modal on tablet */
    .modal-content {
        max-width: 95vw;
    }

    /* Toast adjustments */
    .toast-container {
        max-width: calc(100vw - 40px);
    }
}

/* Ultra small screens */
@media (max-width: 360px) {
    .notification-image-list {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }

    .pagination-page {
        min-width: 32px;
        height: 32px;
        font-size: 0.75rem;
    }

    .stat-card {
        padding: 0.75rem;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 300px;
    pointer-events: auto;
    animation: slideInRight 0.3s ease;
    border-left: 4px solid var(--primary-color);
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--danger-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast.info {
    border-left-color: var(--primary-color);
}

.toast-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast.info .toast-icon {
    color: var(--primary-color);
}

.toast-content {
    flex: 1;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.125rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: var(--transition);
    flex-shrink: 0;
}

.toast-close:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Bulk Actions Bar */
.bulk-actions-bar {
    position: sticky;
    top: 0;
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 100;
    box-shadow: var(--shadow);
    margin: -2rem -2rem 1.5rem -2rem;
    border-radius: var(--radius);
}

#historyBulkActionsBar {
    margin: 0 0 1.5rem 0;
    position: relative;
    top: 0;
}

.bulk-actions-bar.active {
    display: flex;
}

.bulk-actions-info {
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bulk-actions-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bulk-actions-bar .btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.bulk-actions-bar .btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Checkbox Styling */
.table-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

/* Sortable Table Headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 1.5rem;
}

.sortable-header:hover {
    color: var(--primary-color);
}

.sortable-header::after {
    content: '⇅';
    position: absolute;
    right: 0.5rem;
    font-size: 0.75rem;
    opacity: 0.5;
    transition: var(--transition);
}

.sortable-header.sort-asc::after {
    content: '↑';
    opacity: 1;
    color: var(--primary-color);
}

.sortable-header.sort-desc::after {
    content: '↓';
    opacity: 1;
    color: var(--primary-color);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Upload Progress */
.upload-progress {
    margin-top: 1rem;
    display: none;
}

.upload-progress.active {
    display: block;
}

.upload-progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s ease;
    width: 0%;
}

.upload-progress-text {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
}

/* Quick Actions Menu */
.quick-actions-menu {
    position: relative;
    display: inline-block;
}

.quick-actions-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    display: none;
    z-index: 1000;
    padding: 0.5rem;
}

.quick-actions-dropdown.active {
    display: block;
}

.quick-actions-dropdown .btn {
    width: 100%;
    justify-content: flex-start;
    margin-bottom: 0.25rem;
}

.quick-actions-dropdown .btn:last-child {
    margin-bottom: 0;
}

/* Advanced Filters */
.advanced-filters {
    background: var(--bg-primary);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    display: none;
}

.advanced-filters.active {
    display: block;
}

.advanced-filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.advanced-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* Stats Cards Enhancement */
.stat-card {
    transition: var(--transition);
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state-text {
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
}

/* Keyboard Shortcuts Help */
.keyboard-shortcuts {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    max-width: 300px;
    display: none;
    z-index: 9999;
}

.keyboard-shortcuts.active {
    display: block;
}

.keyboard-shortcuts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-weight: 600;
}

.keyboard-shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.875rem;
}

.keyboard-shortcut-item:last-child {
    border-bottom: none;
}

.keyboard-shortcut-key {
    background: var(--bg-tertiary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--text-primary);
}

/* Duplicate Button */
.btn-duplicate {
    color: var(--primary-color);
}

.btn-duplicate:hover {
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary-hover);
}

/* Export Button */
.btn-export {
    color: var(--success-color);
}

.btn-export:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

/* Radio Group Styling */
.radio-group {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    margin-right: 1rem;
    background: var(--bg-primary);
}

.radio-group:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
}

.radio-group input[type="radio"] {
    margin-right: 0.5rem;
    margin: 0 0.5rem 0 0;
}

.radio-group input[type="radio"]:checked + span {
    color: var(--primary-color);
    font-weight: 500;
}

.radio-group:has(input[type="radio"]:checked) {
    border-color: var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

/* Notification Templates */
.template-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.template-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.template-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 50%;
    font-size: 1.5rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.template-info {
    flex: 1;
}

.template-info strong {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.template-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin: 0;
}

/* Notification Preview */
#notificationPreviewContent {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

#previewNotificationImage img {
    max-width: 100%;
    max-height: 200px;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

#previewNotificationTitle {
    color: white;
    margin-bottom: 0.5rem;
}

#previewNotificationContent {
    color: rgba(255, 255, 255, 0.9);
}

/* Image Grid View Toggle */
.notification-image-list.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
}

.notification-image-list.grid-view .notification-image-item {
    aspect-ratio: 1;
}

.notification-image-list.grid-view .notification-image-item-title {
    display: none;
}

.notification-image-list {
    min-height: 200px;
    position: relative;
}

/* Loading state for image list */
.notification-image-list:has(.text-center) {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* History Search */
.notification-history-header {
    flex-wrap: wrap;
    gap: 1rem;
}

.notification-history-header h2 {
    margin: 0;
}

/* Better Image Selection */
.notification-image-item {
    position: relative;
}

.notification-image-item.selected {
    border-color: var(--primary-color);
    border-width: 3px;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.notification-image-item.selected::after {
    content: "✓";
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.875rem;
    z-index: 2;
}

.notification-image-item img {
    transition: transform 0.2s ease;
}

.notification-image-item:hover img {
    transform: scale(1.05);
}

.no-image-placeholder {
    width: 100%;
    height: 120px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 2rem;
}

.notification-image-featured {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: var(--warning-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 1;
}

.notification-image-item-title {
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-primary);
    word-wrap: break-word;
    line-height: 1.4;
    background: var(--bg-primary);
    min-height: 48px;
    display: flex;
    align-items: center;
}

/* Draft Save Indicator */
.draft-indicator {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--warning-color);
    color: white;
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: none;
    align-items: center;
    gap: 0.5rem;
    z-index: 9999;
}

.draft-indicator.active {
    display: flex;
}

/* Character Counter for Notification */
.char-counter {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: right;
    margin-top: 0.25rem;
}

.char-counter.warning {
    color: var(--warning-color);
}

.char-counter.error {
    color: var(--danger-color);
}

/* Notification Stats Enhancement */
.stat-card.clickable {
    cursor: pointer;
}

/* Better Form Layout */
.notification-form {
    position: relative;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-secondary) 50%, var(--bg-tertiary) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--radius);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Notification History Selection */
.history-item-selected {
    border-color: var(--primary-color) !important;
    background: rgba(79, 70, 229, 0.05) !important;
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2) !important;
}

.notification-history-item {
    transition: var(--transition);
}

.notification-history-item:hover {
    border-color: var(--primary-color);
}

/* Responsive Improvements */
@media (max-width: 768px) {
    .notification-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .notification-history-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .notification-history-header > div {
        width: 100%;
    }
    
    .radio-group {
        width: 100%;
        margin-bottom: 0.5rem;
        margin-right: 0;
    }
    
    .template-item {
        flex-direction: column;
        text-align: center;
    }
}
