/* Overlay that blocks the page */
.epm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    /* Updated for transparent blurred background */
    background: rgba(0, 0, 0, 0.2); /* Semi-transparent black */
    backdrop-filter: blur(8px);    /* Blur effect */
    -webkit-backdrop-filter: blur(8px); /* For Safari support */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Popup container */
.epm-popup {
    background: #fcf4ad !important;
    border: 1px solid rgb(70, 68, 68); /* Add this line for a subtle gray border */
    padding: 20px;
    max-width: 600px;
    max-height: 90vh;
    width: 90%;
    /* Retained original box shadow and border radius for a clean look */
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    border-radius: 8px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    box-sizing: border-box;
}

/* Heading - Applying the gradient effect from the original */
.epm-popup h2 {
    margin-top: 0;
    font-size: 1.5em;
    text-align: center;
    font-weight: 800;
    background: linear-gradient(to right, #06b6d4, #1d4ed8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0px 3px 6px rgba(0, 0, 0, 0.15);
}

/* Scrollable image container */
.epm-scroll {
    overflow-y: auto;
    max-height: 70vh;
    width: 100%;
    margin-top: 10px;
    text-align: center;
}

.epm-scroll img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Close button - Updated with circular border */
.epm-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    /* Added border for the circle */
    border: 2px solid #ff4d4d; /* Red border matching the text color */
    font-size: 24px;
    line-height: 24px;
    width: 36px;
    height: 36px;
    border-radius: 50%; /* Makes it a circle */
    cursor: pointer;
    color: #ff4d4d;
    transition: transform 0.2s ease-in-out, color 0.2s ease-in-out, border-color 0.2s ease-in-out; /* Add border-color to transition */
    display: flex; /* Use flexbox to center the X */
    align-items: center;
    justify-content: center;
}

/* Close button hover state - Updated border color on hover */
.epm-close:hover {
    color: #cc0000;
    border-color: #cc0000; /* Darker red border on hover */
    background: none;
    transform: scale(1.2);
}

/* Prevent background scroll when popup is active */
body.epm-lock-scroll {
    overflow: hidden;
}

/* Single popup mode styles - SIMPLE SCROLLABLE LIST */
.epm-single-popup {
    max-width: 800px;
    width: 95%;
    max-height: 90vh;
    position: relative;
    z-index: 10000;
    background: white;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

.epm-events-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
}

.epm-event-title {
    margin: 15px 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #1f2937;
    background: linear-gradient(to right, #06b6d4, #1d4ed8);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    word-wrap: break-word;
    overflow-wrap: break-word;
    width: 100%;
    text-align: center;
}

.epm-event-image {
    text-align: center;
    margin-bottom: 20px;
}

.epm-event-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto;
}

.epm-event-separator {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 30px 0;
}

/* 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;
}

/* Responsive design for single popup */
@media (max-width: 768px) {
    .epm-single-popup {
        max-width: 95%;
        margin: 10px;
    }
    
    .epm-events-container {
        max-height: 50vh;
    }
}

/* ========================================
   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;
}

.epm-settings-section h2 {
    color: #495057;
    margin-bottom: 25px;
    font-size: 1.8em;
    font-weight: 600;
}

/* Help Section */
.epm-help-section {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
}

.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;
    }
}