/* Overlay that blocks the page */
.epm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4); /* Darker overlay for better contrast */
    backdrop-filter: blur(4px);    /* Subtle blur effect */
    -webkit-backdrop-filter: blur(4px); /* For Safari support */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    animation: epmFadeIn 0.3s ease-out;
}

@keyframes epmFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Popup container */
.epm-popup {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    padding: 0;
    max-width: 500px;
    max-height: 80vh;
    width: 90%;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 12px;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-x: hidden;
    box-sizing: border-box;
    animation: epmSlideIn 0.4s ease-out;
}

@keyframes epmSlideIn {
    from { 
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Heading - Clean and professional */
.epm-popup h2 {
    margin: 0 auto;
    padding: 10px 25px 10px 25px;
    font-size: 1.4em;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    line-height: 1.3;
}
/* Scrollable image container */
.epm-scroll {
    overflow-y: auto;
    max-height: 400px;
    width: 100%;
    padding: 20px 25px;
    text-align: center;
    background: #ffffff;
}

.epm-scroll img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Close button - More visible and prominent */
.epm-close {
    position: absolute;
    top: 6px;
    right: 12px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #dc3545;
    font-size: 20px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    color: #dc3545;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Close button hover state */
.epm-close:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Prevent background scroll when popup is active */
body.epm-lock-scroll {
    overflow: hidden;
}

/* Single popup mode styles - Clean and compact */
.epm-single-popup {
    max-width: 500px;
    width: 85%;
    max-height: 85vh;
    position: relative;
    z-index: 10000;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    overflow-x: hidden;
    animation: epmSlideIn 0.4s ease-out;
    display: flex;
    flex-direction: column;
}

/* Multi-popup carousel styles */
.epm-multi-popup {
    max-width: 700px;
    width: 90%;
    max-height: 80vh;
    position: relative;
    z-index: 10000;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    overflow-x: hidden;
    animation: epmSlideIn 0.4s ease-out;
}

.epm-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px 15px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.epm-popup-header h2 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.epm-event-counter {
    background: #007bff;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 500;
}

.epm-popup-content {
    position: relative;
    height: 450px;
    overflow: hidden;
}

.epm-popup-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.epm-popup-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.4s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.epm-popup-slide.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

.epm-slide-content {
    padding: 0;
    text-align: center;
    width: 100%;
    height: 100%;
    display: block;
    overflow: hidden;
    margin: 0;
    position: relative;
}

.epm-slide-image {
    width: 100%;
    height: calc(100% - 60px);
    overflow: hidden;
    display: block;
    padding: 0;
    margin: 0;
    position: absolute;
    top: 60px;
    left: 0;
}

.epm-slide-title {
    font-size: 1.4em;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    padding: 15px 20px;
    line-height: 1.3;
    background: linear-gradient(135deg, #4A90E2, #7B68EE);
    border-bottom: 2px solid rgba(255,255,255,0.2);
    width: 100%;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    border-radius: 8px 8px 0 0;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.epm-slide-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.2s ease;
    display: block;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
}

.epm-slide-image img:hover {
    transform: scale(1.01);
}

/* Eliminate bottom spacing in popup content */
.epm-popup-content {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    height: 100% !important;
}

.epm-popup-content * {
    margin-bottom: 0 !important;
}

.epm-popup-content *:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Ensure image containers have no extra spacing */
.epm-slide-image {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
    height: 100% !important;
}

.epm-slide-image:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Force popup slides to fill entire height */
.epm-popup-slide {
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
}

.epm-popup-slide:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

/* Ensure no white space at bottom */
.epm-popup-slide * {
    box-sizing: border-box;
}

.epm-popup-slide .epm-slide-content {
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

.epm-popup-slide .epm-slide-image {
    bottom: 0 !important;
}

/* Scrollbar styling for multi-popup images */
.epm-slide-image::-webkit-scrollbar {
    width: 6px;
}

.epm-slide-image::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.epm-slide-image::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 3px;
}

.epm-slide-image::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

.epm-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 10;
    pointer-events: none;
}

.epm-prev, .epm-next {
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: 2px solid #007bff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.9;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.epm-prev:hover, .epm-next:hover {
    background: #007bff;
    color: white;
    opacity: 1;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.epm-prev:disabled, .epm-next:disabled {
    background: rgba(0, 0, 0, 0.1);
    color: #999;
    border-color: #ccc;
    cursor: not-allowed;
    opacity: 0.5;
}

.epm-prev:disabled:hover, .epm-next:disabled:hover {
    transform: none;
    background: rgba(0, 0, 0, 0.1);
    color: #999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.epm-events-container {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    background: #ffffff;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.epm-event-title {
    margin: 0; /* remove gap before image */
    padding: 10px 25px 10px 25px;
    font-size: 1.4em;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #4A90E2, #7B68EE);
    border-bottom: 2px solid rgba(255,255,255,0.2);
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    border-radius: 8px 8px 0 0;
    flex-shrink: 0;
}

.epm-event-item {
    display: flex;
    flex-direction: column;
    margin-bottom: 10px;
}

.epm-event-image {
    text-align: center;
    margin-bottom: 0;
    padding: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 0; /* eliminate inline image gap */
}

.epm-event-image img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
    display: block;
    margin: 0;
    transition: transform 0.2s ease;
}

.epm-event-image img:hover {
    transform: scale(1.01);
}

.epm-event-separator {
    display: none; /* eliminate any visible white between items */
}

/* Scrollbar styling */
.epm-events-container::-webkit-scrollbar {
    width: 8px;
}

.epm-events-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.epm-events-container::-webkit-scrollbar-thumb {
    background: #06b6d4;
    border-radius: 4px;
}

.epm-events-container::-webkit-scrollbar-thumb:hover {
    background: #0891b2;
}

/* Desktop optimizations */
@media (min-width: 769px) {
    .epm-single-popup {
        max-width: 450px;
        width: 80%;
        max-height: 85vh;
    }
    
    .epm-events-container {
        max-height: 75vh;
        overflow-y: auto;
        overflow-x: hidden;
    }
    
    .epm-event-image img {
        width: 100%;
        height: auto;
        max-height: none;
        object-fit: cover;
    }
}

/* Responsive design for single popup */
@media (max-width: 768px) {
    .epm-overlay {
        padding: 10px;
        align-items: center;
        justify-content: center;
    }
    
    .epm-popup, .epm-single-popup, .epm-multi-popup {
        max-width: 95%;
        width: 100%;
        margin: 0;
        max-height: 90vh;
        position: relative;
    }
    
    .epm-events-container {
        max-height: 60vh;
    }
    
    .epm-event-title {
        font-size: 1.1em;
        padding: 15px 20px 12px 20px;
    }
    
    .epm-popup h2 {
        font-size: 1.2em;
        padding: 15px 20px 12px 20px;
    }
    
    .epm-scroll {
        padding: 15px 20px;
    }
    
    .epm-event-image img {
        height: auto;
        max-height: none;
    }
    
    /* Multi-popup responsive styles */
    .epm-popup-header {
        padding: 15px 20px 12px 20px;
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .epm-popup-header h2 {
        font-size: 1.2em;
    }
    
    .epm-popup-content {
        height: 400px;
    }
    
    .epm-slide-content {
        padding: 0;
    }
    
    .epm-slide-title {
        font-size: 1.2em;
        padding: 10px 15px;
        height: 50px;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        z-index: 2;
    }
    
    .epm-slide-image {
        width: 100%;
        height: calc(100% - 50px);
        overflow: hidden;
        position: absolute;
        top: 50px;
        left: 0;
    }
    
    .epm-slide-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        margin: 0;
        padding: 0;
        position: absolute;
        top: 0;
        left: 0;
    }
    
    .epm-navigation {
        padding: 0 10px;
    }
    
    .epm-prev, .epm-next {
        width: 40px;
        height: 40px;
    }
    
    /* Ensure proper centering on very small screens */
    @media (max-width: 480px) {
        .epm-overlay {
            padding: 5px;
        }
        
        .epm-popup, .epm-single-popup, .epm-multi-popup {
            max-width: 98%;
            width: 100%;
        }
    }
}

/* ========================================
   DASHBOARD STYLES (UNCHANGED)
======================================== */

/* Dashboard Header */
.epm-dashboard-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.epm-header-content {
    flex: 1;
    min-width: 300px;
}

.epm-main-title {
    font-size: 2.5em;
    margin: 0 0 10px 0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 15px;
}

.epm-icon {
    font-size: 1.2em;
}

.epm-version {
    background: rgba(255,255,255,0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.4em;
    font-weight: 500;
    margin-left: 10px;
}

.epm-subtitle {
    font-size: 1.1em;
    margin: 0;
    opacity: 0.9;
    font-weight: 300;
}

.epm-header-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.epm-stat-box {
    text-align: center;
    background: rgba(255,255,255,0.15);
    padding: 20px;
    border-radius: 10px;
    min-width: 120px;
    backdrop-filter: blur(10px);
}

.epm-stat-number {
    display: block;
    font-size: 2.5em;
    font-weight: 700;
    margin-bottom: 5px;
}

.epm-stat-label {
    font-size: 0.9em;
    opacity: 0.8;
    font-weight: 500;
}

/* Features Section */
.epm-features-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.epm-features-section h2 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: 600;
}

.epm-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.epm-feature-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    text-align: center;
}

.epm-feature-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.epm-feature-icon {
    font-size: 3em;
    margin-bottom: 15px;
    display: block;
}

.epm-feature-card h3 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1.3em;
    font-weight: 600;
}

.epm-feature-card p {
    color: #6c757d;
    margin: 0;
    line-height: 1.6;
    font-size: 0.95em;
}

/* Security Section */
.epm-security-section {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.epm-security-section h2 {
    color: #155724;
    margin-bottom: 20px;
    font-size: 1.6em;
    font-weight: 600;
}

.epm-security-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.epm-security-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #c3e6cb;
}

.epm-security-icon {
    font-size: 1.2em;
}

.epm-security-text {
    font-weight: 500;
    color: #155724;
}

/* Guide Section */
.epm-guide-section {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.epm-guide-section h2 {
    color: #0d47a1;
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: 600;
}

.epm-guide-steps {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.epm-guide-step {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: white;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #bbdefb;
}

.epm-step-number {
    background: #2196f3;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2em;
    flex-shrink: 0;
}

.epm-step-content h3 {
    color: #0d47a1;
    margin: 0 0 10px 0;
    font-size: 1.3em;
    font-weight: 600;
}

.epm-step-content p {
    color: #424242;
    margin: 0;
    line-height: 1.6;
}

/* Settings Section */
.epm-settings-section {
    background: white;
    border: 1px solid #dee2e6;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

/* Compact Event Popups rows styling */
.epm-row {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 12px;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

/* Compact admin grid for popup rows */
.epm-popup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
    gap: 12px;
}

/* Single-column layout spanning full width */
.epm-popup-grid-single {
    grid-template-columns: 1fr;
}

/* Sticky list controls for better UX */
.epm-list-controls {
    position: sticky;
    top: 32px; /* below WP admin bar */
    z-index: 20;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.epm-controls-left,
.epm-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.epm-controls-label {
    font-weight: 600;
    color: #374151;
}

.epm-row-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 20px;
    align-items: start;
}

@media (max-width: 900px) {
    .epm-row-content { 
        grid-template-columns: 1fr; 
        gap: 15px;
    }
}

/* Image Column - Left Side */
.epm-image-column {
    display: flex;
    flex-direction: column;
}

.epm-image-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.epm-image-section h4 {
    margin: 0 0 12px 0;
    color: #374151;
    font-size: 0.95em;
    font-weight: 600;
}

.epm-image-preview-large {
    width: 100%;
    min-height: 200px;
    max-height: 300px;
    background: #ffffff;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
}

.epm-image-preview-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.epm-no-image {
    color: #9ca3af;
    font-style: italic;
    font-size: 0.9em;
}

.epm-image-upload {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.epm-image-upload .epm-image-url {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
}

.epm-image-upload .epm-upload {
    background: #3b82f6;
    color: white;
    border: 1px solid #3b82f6;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.epm-image-upload .epm-upload:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-1px);
}

/* Controls Column - Right Side */
.epm-controls-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Compact input widths for small controls */
.epm-row .epm-form-row .epm-form-col input[type="date"] {
    width: 160px;
}

.epm-row .epm-form-row .epm-form-col select {
    width: 220px;
    max-width: 100%;
}

.epm-row .epm-section h4 {
    font-size: 0.95em;
    margin-bottom: 6px;
}

.epm-row .epm-section .epm-subsection h5 {
    font-size: 0.85em;
}

.epm-filter-select {
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 6px 10px;
}

.epm-row .epm-section {
    margin: 6px 0;
}

.epm-row .epm-form-row {
    gap: 8px;
}

.epm-row .epm-image-dimensions {
    gap: 10px;
    padding: 10px;
}

.epm-row:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #3b82f6;
}

/* Row head and collapse */
.epm-row-head {
    display: grid;
    grid-template-columns: 50% auto auto 1fr auto; /* title, enabled, chip, spacer, toolbar */
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.epm-row-head input[type="text"] { width: 100%; }
.epm-row-head .epm-row-toolbar { display: flex; gap: 4px; min-width: 130px; justify-content: flex-end; justify-self: end; }
.epm-row-head .epm-status-chip { white-space: nowrap; }
.epm-row-head label { white-space: nowrap; }
.epm-row-head .epm-collapse { padding: 2px 6px; }

/* Override absolute positioning of toolbar when placed in header */
.epm-row-head .epm-row-toolbar {
    position: static;
    top: auto; right: auto;
    background: transparent;
    padding: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 160px;
}

.epm-row-head input[type="text"] {
    flex: 1;
}

.epm-row.is-collapsed .epm-row-content {
    display: none;
}

.epm-collapse.button {
    border: 1px solid #d1d5db;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
}

.epm-collapse .chev {
    transition: transform 0.2s ease;
}

/* Status chip */
.epm-status-chip {
    background: #e5f6ff;
    color: #0369a1;
    border: 1px solid #bae6fd;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.epm-row.is-collapsed .epm-collapse .chev { transform: rotate(-90deg); }

/* Status variations */
.epm-status-chip.chip-active {
    background: #dcfce7;
    color: #166534;
    border-color: #bbf7d0;
}

.epm-status-chip.chip-inactive {
    background: #fee2e2;
    color: #991b1b;
    border-color: #fecaca;
}

.epm-status-chip.chip-scheduled {
    background: #e0f2fe;
    color: #075985;
    border-color: #bae6fd;
}

.epm-status-chip.chip-expired {
    background: #f3f4f6;
    color: #374151;
    border-color: #e5e7eb;
}

.epm-row-toolbar {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    background: rgba(255, 255, 255, 0.95);
    padding: 2px;
    border-radius: 6px;
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.epm-row-toolbar .button {
    padding: 3px 6px;
    line-height: 1.2;
    height: auto;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #374151;
    min-width: 28px;
    text-align: center;
}

.epm-row-toolbar .button:hover {
    background: #f3f4f6;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.epm-row-toolbar .button.epm-delete:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

/* Compact Admin sections */
.epm-section {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    margin: 8px 0;
    transition: all 0.2s ease;
}

.epm-section:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.epm-section h4 {
    margin: 0 0 8px 0;
    color: #374151;
    font-size: 0.95em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.epm-subsection {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    padding: 8px;
    margin-top: 8px;
}

.epm-subsection h5 {
    margin: 0 0 6px 0;
    color: #6b7280;
    font-size: 0.85em;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.epm-form-row {
    display: flex;
    gap: 12px;
    margin: 8px 0;
}

.epm-form-col {
    flex: 1;
}

.epm-form-col label {
    margin-top: 0;
    font-weight: 500;
    color: #6b7280;
    font-size: 0.8em;
    margin-bottom: 4px;
    display: block;
}

.epm-row label {
    font-weight: 500;
    margin-top: 8px;
    margin-bottom: 4px;
    display: block;
    color: #6b7280;
    font-size: 0.8em;
}

/* Compact form inputs */
.epm-row input[type="text"],
.epm-row input[type="url"],
.epm-row input[type="date"],
.epm-row input[type="number"],
.epm-row select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s ease;
    background: #ffffff;
}

.epm-row input[type="text"]:focus,
.epm-row input[type="url"]:focus,
.epm-row input[type="date"]:focus,
.epm-row input[type="number"]:focus,
.epm-row select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
    outline: none;
}

.epm-row input[type="color"] {
    width: 32px;
    height: 28px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.epm-row input[type="color"]:hover {
    border-color: #3b82f6;
    transform: scale(1.05);
}

/* Compact buttons */
.epm-row .button {
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 500;
    font-size: 12px;
    transition: all 0.2s ease;
    border: 1px solid #d1d5db;
}

.epm-row .epm-upload.button {
    background: #3b82f6;
    color: white;
    border: 1px solid #3b82f6;
}

.epm-row .epm-upload.button:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    transform: translateY(-1px);
}

/* Compact image preview */
.epm-preview {
    margin-top: 8px;
    padding: 8px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 4px;
    text-align: center;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.epm-preview img {
    max-width: 80px;
    max-height: 50px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Compact gradient preview */
.epm-gradient-preview {
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.epm-gradient-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Compact admin page styling */
.epm-compact-wrap {
    background: #f8fafc;
    padding: 15px;
    max-width: 1400px;
    margin: 0 auto;
}

.epm-compact-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 25px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.epm-header-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.epm-title {
    font-size: 1.8em;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.epm-version {
    font-size: 0.6em;
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-weight: 500;
}

.epm-stats-inline {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    opacity: 0.9;
}

.epm-stat {
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 15px;
    font-weight: 500;
}

.epm-header-right {
    display: flex;
    align-items: center;
}

.epm-security-badges {
    display: flex;
    gap: 8px;
}

.epm-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

.epm-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.epm-settings-column {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.epm-settings-column h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}

.epm-radio-group {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.epm-radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.epm-radio-label:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.epm-radio-label input[type="radio"]:checked + .epm-radio-text {
    color: #3b82f6;
    font-weight: 600;
}

.epm-radio-label input[type="radio"]:checked {
    accent-color: #3b82f6;
}

.epm-color-row {
    display: flex;
    gap: 15px;
    align-items: end;
    margin-bottom: 20px;
}

.epm-color-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.epm-color-group label {
    font-size: 0.85em;
    font-weight: 500;
    color: #6b7280;
}

.epm-color-picker {
    width: 50px;
    height: 40px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.epm-color-picker:hover {
    border-color: #3b82f6;
    transform: scale(1.05);
}

.epm-gradient-preview {
    width: 50px;
    height: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.epm-gradient-preview:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.epm-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.epm-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.epm-input-group label {
    font-size: 0.85em;
    font-weight: 500;
    color: #374151;
}

.epm-input-group input {
    padding: 8px 12px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.epm-input-group input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

.epm-save-section {
    background: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    text-align: center;
}

.epm-save-section .button-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.epm-save-section .button-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Responsive design for compact layout */
@media (max-width: 768px) {
    .epm-compact-wrap {
        padding: 10px;
    }
    
    .epm-compact-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .epm-settings-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .epm-radio-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .epm-color-row {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .epm-input-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

.epm-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 16px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.epm-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.epm-title {
    font-size: 2.5em;
    font-weight: 800;
    margin: 0 0 10px 0;
    display: flex;
    align-items: center;
    gap: 15px;
    position: relative;
    z-index: 1;
}

.epm-icon {
    font-size: 1.2em;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.epm-subtitle {
    font-size: 1.1em;
    margin: 0;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.epm-settings-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.epm-settings-section h2 {
    color: #1f2937;
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 3px solid #3b82f6;
    font-weight: 600;
}

/* Enhanced buttons and form elements */
.epm-settings-section .button-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    font-weight: 600;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    transition: all 0.3s ease;
}

.epm-settings-section .button-primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.epm-settings-section .button {
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.epm-settings-section .button:hover {
    transform: translateY(-1px);
}

/* Enhanced form styling */
.epm-settings-section input[type="text"],
.epm-settings-section input[type="number"],
.epm-settings-section select {
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.epm-settings-section input[type="text"]:focus,
.epm-settings-section input[type="number"]:focus,
.epm-settings-section select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    outline: none;
}

/* Enhanced checkbox styling */
.epm-settings-section input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3b82f6;
    border-radius: 4px;
}

/* Enhanced table styling */
.epm-settings-section table {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.epm-settings-section th {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    font-weight: 600;
    color: #374151;
    padding: 16px;
}

.epm-settings-section td {
    padding: 16px;
    border-bottom: 1px solid #f1f5f9;
}

/* Enhanced notice styling */
.epm-settings-section .notice {
    border-radius: 12px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

.epm-settings-section .notice-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left: 4px solid #10b981;
}

.epm-settings-section .notice-error {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-left: 4px solid #ef4444;
}

/* Responsive design */
@media (max-width: 768px) {
    .epm-admin-wrap {
        padding: 10px;
    }
    
    .epm-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .epm-title {
        font-size: 2em;
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .epm-settings-section {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .epm-form-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .epm-row-toolbar {
        position: static;
        margin-top: 16px;
        justify-content: center;
        background: transparent;
        padding: 0;
    }
    
    .epm-row-toolbar .button {
        font-size: 11px;
        padding: 4px 8px;
    }
}

/* Animation keyframes */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.epm-row {
    animation: fadeInUp 0.5s ease-out;
}

.epm-section {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading states */
.epm-loading {
    opacity: 0.6;
    pointer-events: none;
}

.epm-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #3b82f6;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Help Section */
.epm-help-section {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 1px solid #f59e0b;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.1);
}

.epm-help-section h2 {
    color: #856404;
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: 600;
}

.epm-help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.epm-help-card {
    background: white;
    padding: 25px;
    border-radius: 10px;
    border: 1px solid #ffeaa7;
    text-align: center;
}

.epm-help-card h3 {
    color: #856404;
    margin: 0 0 15px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.epm-help-card p {
    color: #6c757d;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.epm-help-link {
    display: inline-block;
    background: #ffc107;
    color: #212529;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.epm-help-link:hover {
    background: #e0a800;
    color: #212529;
    text-decoration: none;
    transform: translateY(-2px);
}

/* Image Dimensions Section */
.epm-image-dimensions {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.epm-image-dimensions label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    display: block;
}

.epm-image-dimensions input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.epm-image-dimensions > div {
    flex: 1;
    min-width: 120px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .epm-dashboard-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .epm-header-stats {
        justify-content: center;
    }
    
    .epm-features-grid {
        grid-template-columns: 1fr;
    }
    
    .epm-security-grid {
        grid-template-columns: 1fr;
    }
    
    .epm-guide-step {
        flex-direction: column;
        text-align: center;
    }
    
    .epm-help-grid {
        grid-template-columns: 1fr;
    }
    
    .epm-main-title {
        font-size: 2em;
        flex-direction: column;
        gap: 10px;
    }
    
    .epm-image-dimensions {
        flex-direction: column;
    }
}

/* Gradient Controls */
.epm-gradient-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin: 10px 0;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.epm-color-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.epm-color-label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.epm-color-picker {
    width: 50px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.epm-color-picker:hover {
    border-color: #0073aa;
}

.epm-gradient-preview {
    width: 80px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 4px;
    flex-shrink: 0;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

/* Responsive gradient controls */
@media (max-width: 768px) {
    .epm-gradient-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .epm-color-group {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .epm-gradient-preview {
        width: 100%;
        height: 30px;
    }
}

/* Filter Buttons */
.epm-filter-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    flex-wrap: wrap;
}

.epm-filter-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: #ffffff;
    color: #495057;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-transform: capitalize;
}

.epm-filter-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-1px);
}

.epm-filter-btn.active {
    background: #007bff;
    color: #ffffff;
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.epm-filter-btn.active:hover {
    background: #0056b3;
    border-color: #0056b3;
}

@media (max-width: 768px) {
    .epm-filter-buttons {
        padding: 10px;
        gap: 6px;
    }
    
    .epm-filter-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}