/* ======================================================= 
 *
 *      Auto Photo Albums Badges CSS
 *      Version: 1.0
 *      
 * ======================================================= */

/* Column wrapper for album and tag badges */
.album-column-wrapper {
    display: flex !important; /* Force flex display */
    flex-direction: column !important;
    width: 100%;
    gap: 5px; /* Add spacing between elements */
    position: absolute; /* Ensure proper stacking context */
    bottom: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    border-radius: 5px;
}

/* Tag badges container */
.album-column-wrapper > .album-tag-badges-container {
    display: flex;
    justify-content: flex-start;
    padding: 0px 10px;
    order: -1 !important; /* Force order */
    position: relative; /* Ensure proper stacking */
    z-index: 5;
}

@media (max-width: 768px) {
    .album-column-wrapper > .album-tag-badges-container {
        padding: 2px 3px;
    }
}

/* Traditional badge container (for download badge) */
.album-badges-container {
    position: absolute;
    display: flex;
    z-index: 5;
    padding: 8px;
    pointer-events: none; /* This prevents clicks to the container itself */
}

@media (max-width: 768px) {
    .album-badges-container {
        padding: 5px 5px;
    }
}

/* Badge Container Positions */
.album-badges-top-right {
    top: 0;
    right: 0;
    flex-direction: row;
}

.album-badges-top-left {
    top: 0;
    left: 0;
    flex-direction: row;
}

.album-badges-bottom-right {
    bottom: 0;
    right: 0;
    flex-direction: row;
}

.album-badges-bottom-left {
    bottom: 0;
    left: 0;
    flex-direction: row;
}

/* Individual Badges - Make all badges display tooltips */
.album-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0 3px;
    background-color: transparent;
    color: white;
    font-size: 24px;
    text-align: center;
    transition: transform 0.2s ease;
    cursor: default;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 0 0 9px #000;
    pointer-events: auto; /* Enable pointer events for all badges */
    position: relative; /* Added for tooltip positioning */
}

/* Non-clickable badges - make them show tooltips but pass through clicks */
.album-badge:not(.clickable) {
    pointer-events: auto; /* Enable hover effects */
}

/* Clickable badges */
.album-badge.clickable {
    cursor: pointer; /* Show pointer cursor for clickable badges */
    /* transform: scale(1.05); */
}

.album-badge.clickable:hover {
    transform: scale(1.1);
}

/* Tooltip styles for badges */
.album-badge:not(.badge-separator)::after {
    content: attr(data-title);
    position: absolute;
    bottom: 100%; /* Position above the badge */
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    z-index: 10; /* Ensure tooltip is above other elements */
    margin-bottom: 5px; /* Space between badge and tooltip */
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.album-badge:not(.badge-separator):hover::after {
    opacity: 1;
    visibility: visible;
}

/* Custom styling for specific badges - now using color instead of background-color */
.album-badge.futa-badge {
    color: rgb(255, 0, 255); /* Bright purple color */
}

.album-badge.female-badge {
    color: rgb(255, 105, 180); /* Pink color */
}

.album-badge.image-badge {
    color: rgb(0, 150, 255); /* Blue color */
}

.album-badge.video-badge {
    color: rgb(255, 50, 50); /* Red color */
}

.album-badge.download-badge {
    color: rgb(50, 205, 50); /* Green color */
    pointer-events: auto;
    cursor: pointer;
}

/* Make the SVG icon in download badge colored */
.album-badge.download-badge svg {
    fill: rgb(50, 205, 50); /* Match the text color */
    stroke: #000;
    stroke-width: 16px;
    width: 26px !important;
    height: 26px !important;
    filter: drop-shadow(0 0 9px rgb(0 0 0 / 0.6));
}

/*.album-badge.download-badge {*/
/*    width: 26px !important;*/
/*    height: 26px !important;*/
/*}*/

/* Hover effect for all badges */
.album-badge:hover {
    /* transform: scale(1.1); */
}

/* Styles for SVG icons within badges */
.album-badge svg {
    width: 100%; /* Make SVG fill the badge width */
    height: 100%; /* Make SVG fill the badge height */
    object-fit: contain; /* Ensure aspect ratio is maintained and SVG fits */
    vertical-align: top; /* Adjust as needed for alignment */
    filter:
        drop-shadow(1px 1px 0px rgba(0, 0, 0, 0.5))        
        drop-shadow(-1px -1px 0px rgba(0, 0, 0, 0.5))        
        drop-shadow(1px 0px 0px rgba(0, 0, 0, 0.5))        
        drop-shadow(0px 1px 0px rgba(0, 0, 0, 0.5))        
        drop-shadow(0px 0px 4px rgba(0, 0, 0, 0.8))
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .album-badge {
        /* width: 25px; */
        /* height: 25px; */
        font-size: 17px;
    }
    .album-column-wrapper {
        gap: 1px;
    }
}

/* Ensure media-box-album appears after badges */
.album-column-wrapper > .media-box-album {
    order: 1 !important; /* Force order */
    position: relative;
    padding: 0px 15px 15px 15px !important;
    border-radius: 5px;
}

@media (max-width: 768px) {
    .album-column-wrapper > .media-box-album {
        padding: 0px 7px 5px 7px !important;
    }
}

/* New role badge styles */
.album-badge.flirtation-badge {
    color: rgb(46, 204, 113); /* Green color to match the 💚 emoji */
}

.album-badge.passion-badge {
    color: rgb(241, 196, 15); /* Yellow color to match the 💛 emoji */
}

.album-badge.obsession-badge {
    color: rgb(231, 76, 60); /* Red color to match the 🔥 emoji */
}

/* Preview badge style */
.album-badge.preview-badge {
    color: rgb(138, 43, 226); /* BlueViolet for preview */
    /* Add other specific styles if needed, like different size or hover effect */
}

/* CSS for hidden badges */
.album-badge.hidden-badge {
    display: none !important;
}

/* Separator styling */
.album-badge.badge-separator {
    width: 1px;
    /* height: 20px; */
    margin: 0 8px;
    background-color: rgb(255, 255, 255);
    border-radius: 1px;
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.2);
    font-size: 0;
}

/* Responsive separator styling */
@media (max-width: 768px) {
    .album-badge.badge-separator {
        margin: 0 4px;
    }
}
/* Don't apply hover effects to separators */
.album-badge.badge-separator:hover {
    transform: none;
}

/* Role badges container */
.album-badges-top-left {
    top: 0;
    left: 0;
    flex-direction: row;
}

/* Role badge styling */
.album-badge.role-badge {
    font-size: 24px;
    margin: 0 2px;
}

/* Media queries for responsive design */
@media (max-width: 768px) {
    .album-badge.role-badge {
        font-size: 20px;
    }
}

/* Offset for tag badges container on media files */
.album-column-wrapper.file-item-tags-wrapper {
    bottom: 0px;
    padding-bottom: 10px;
}

/* Filter Button Layout Styles */

/* Main container for all filter buttons and separators */
.media-boxes-filter-neumorphic .neumorphic-buttons-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    /* padding: 5px 0; */
    width: 100%;
    justify-content: space-between;
}

/* Wrapper for each individual filter button - adjust margin as needed */
.filter-neumorphic-button-wrapper {
    margin-right: 6px; /* Space between buttons within a group */
    margin-bottom: 6px; /* Space if buttons wrap to the next line */
}
/* Remove right margin from the last button wrapper before a separator or at the end of the container */
.filter-neumorphic-button-wrapper:last-child,
.filter-neumorphic-button-wrapper + .filter-group-separator {
    margin-right: 0;
}


/* Separator between filter groups */
.filter-group-separator {
    width: 1px;
    height: 30px;
    background-color: rgb(255 255 255 / 10%);
    margin: 0 5px;
    align-self: center;
}

/* NEW FILTER BUTTON STYLES (Based on "Female Peach Checkbox" example) */

.new-filter-style-container { /* Container for all new filter buttons */
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 10px 5px 10px;
}

.filter-button-wrapper { /* Wrapper for each individual filter (checkbox + label) */
    display: inline-block; /* Or flex, depending on desired layout with other elements */
    width: 22%;
}

.new-filter-checkbox-input { /* The actual checkbox, visually hidden */
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.new-filter-label { /* The clickable label that contains the button's appearance */
    position: relative; /* If needed for any absolute positioning inside */
    display: inline-block; /* Important for label behavior */
    cursor: pointer;
    width: 100%;
}

.new-filter-button {
    display: flex;
    align-items: center;
    gap: 10px; /* Space between icon and text, was 12px */
    padding: 10px 15px; /* Was 12px 20px */
    background-color: #33373a; /* Dark default background */
    border: none; /* 1. Remove border effects */
    border-radius: 8px;
    transition: transform 0.3s ease; /* Keep transform for hover if desired */
    font-size: 14px; /* Was 16px */
    font-weight: 500;
    color: #f0f0f1; /* Light default text color */
    min-width: 100px; /* Was 120px */
    box-sizing: border-box;
    box-shadow: none; /* 1. Remove border effects (shadow) */
    justify-content: center;
    height: 50px;
    filter: drop-shadow(1px 1px 0px rgba(0, 0, 0, 0.5)) drop-shadow(-1px 0px 0px rgba(0, 0, 0, 0.5)) drop-shadow(1px 0px 0px rgba(0, 0, 0, 0.5)) drop-shadow(0px 1px 0px rgba(0, 0, 0, 0.5)) drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.8));
}

.new-filter-label:hover .new-filter-button {
    background-color: #454a4e; /* Slightly lighter dark for hover on unchecked */
    /* transform: translateY(-1px); // Optional: keep hover lift */
    box-shadow: none; /* 1. Ensure no shadow on hover */
}

.new-filter-icon-container {
    display: inline-flex; /* Helps with SVG alignment */
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.8; /* Adjusted for dark background */
    min-width: 30px;
    min-height: 30px;
}

.new-filter-icon-container svg {
    width: 30px;
    height: 30px;
    object-fit: contain;
    fill: currentColor; /* Make SVG icon color inherit text color */
    filter: drop-shadow(1px 1px 0px rgba(0, 0, 0, 0.5)) drop-shadow(-1px 0px 0px rgba(0, 0, 0, 0.5)) drop-shadow(1px 0px 0px rgba(0, 0, 0, 0.5)) drop-shadow(0px 1px 0px rgba(0, 0, 0, 0.5)) drop-shadow(0px 0px 2px rgba(0, 0, 0, 0.8));
}
/* If icon is just text/emoji, not SVG: */
.new-filter-icon-container:not(:has(svg)) {
    font-size: 20px; /* Adjust if using emoji */
}


.new-filter-text {
    font-family: "Inter", Sans-serif;
    user-select: none;
    line-height: 1.2;
    text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 0 0 20px #000;
    font-size: 18px;
    margin-bottom: -2px;
    margin-right: 5px;
    min-height: 22px;
    font-weight: 400;
}

/* Unchecked state */
.new-filter-checkbox-input:not(:checked) + .new-filter-label .new-filter-button {
    /* Default styles are for unchecked state */
}

.new-filter-checkbox-input:not(:checked) + .new-filter-label .new-filter-icon-container {
    opacity: 0.7; /* Default icon opacity for dark bg */
    filter: none; /* Remove grayscale, not needed for dark bg */
}

/* Checked state */
.new-filter-checkbox-input:checked + .new-filter-label .new-filter-button {
    background-color: var(--filter-active-bg-color); /* 3. Use admin-defined active color */
    color: white; /* Assuming white text provides good contrast, adjust if needed */
    border: none; /* 1. Remove border effects */
    outline: 2px solid var(--filter-active-bg-color, #e98b49); /* ADD outline for active state */
    outline-offset: 2px; /* ADD outline-offset for active state */
}

.new-filter-checkbox-input:checked + .new-filter-label:hover .new-filter-button {
    filter: brightness(110%); /* Subtle hover effect for active buttons */
    /* transform: scale(1.1);  */
}

.new-filter-checkbox-input:checked + .new-filter-label .new-filter-icon-container {
    opacity: 1;
    filter: none;
    /* transform: scale(1.1); Icon slightly larger when checked */
}

/* Responsive filter button styles */
@media (max-width: 768px) {
    .new-filter-button {
      display: flex;
      align-items: center;
      gap: 2px;
      padding: 5px 5px;
      box-sizing: border-box;
      box-shadow: none;
      min-width: 68px;
      flex-direction: column;
      height: 63px;
    }
    
    .filter-group-separator {
        display: none;
    }

    /* .new-filter-style-container {
      padding: 10px 0px;
    } */

    .new-filter-text {
      margin-right: 0px;
      font-size: 16px;
    }
}

/* END NEW FILTER BUTTON STYLES */

.admin-options-badge svg {
    width: 18px;
    height: 18px;
    fill: #fff;
    transition: transform 0.3s ease;
}

.admin-options-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 10000;
    display: none; 
    align-items: center;
    justify-content: center;
    flex-direction: column;
    backdrop-filter: blur(5px);
}

.admin-options-menu.visible {
    display: flex; 
}

.admin-options-menu-content {
    background-color: #2c2c2c;
    padding: 40px;
    border-radius: 10px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 90%;
    width: 320px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.4);
}

.admin-options-menu .admin-menu-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    font-weight: bold;
    font-family: Arial, sans-serif;
    transition: color 0.2s;
}

.admin-options-menu .admin-menu-close-button:hover {
    color: #fff;
}

.admin-options-menu .admin-option {
    background: #3e3e3e;
    color: white;
    padding: 15px;
    margin: 0;
    border-radius: 5px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    transition: background-color 0.2s;
    font-size: 14px;
    font-weight: bold;
}

.admin-options-menu .admin-option:hover {
    background-color: #555;
}

/* Modal for replacing images */
.apa-replace-image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.apa-replace-image-modal-content {
    background-color: #2c2c2c;
    padding: 20px;
    border-radius: 5px;
    display: flex;
    gap: 20px;
}

.apa-replace-image-box {
    border: 1px dashed #555;
    padding: 10px;
    text-align: center;
}

.apa-replace-image-box img {
    max-width: 200px;
    max-height: 200px;
    display: block;
    margin: 10px auto;
}

.apa-replace-image-modal-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
}

/* Thumbnail Uploader Modal */
.apa-thumbnail-uploader-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 10001; /* Higher than admin menu */
    display: none;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.apa-thumbnail-uploader-modal.visible {
    display: flex;
}

.apa-thumbnail-uploader-content {
    background-color: #2c2c2c;
    padding: 30px;
    border-radius: 10px;
    position: relative;
    max-width: 90%;
    width: 500px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.4);
    color: #fff;
}

.apa-thumbnail-uploader-content h3 {
    margin-top: 0;
    color: #fff;
    font-size: 20px;
    border-bottom: 1px solid #444;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.apa-thumbnail-uploader-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 28px;
    line-height: 1;
    color: #aaa;
    cursor: pointer;
    font-weight: bold;
    font-family: Arial, sans-serif;
    transition: color 0.2s;
}

.apa-thumbnail-uploader-close:hover {
    color: #fff;
}

.apa-thumbnail-upload-zone {
    border: 2px dashed #666;
    padding: 30px;
    text-align: center;
    background-color: #3e3e3e;
    margin-top: 20px;
    border-radius: 5px;
    transition: background-color 0.2s, border-color 0.2s;
    cursor: pointer;
}

.apa-thumbnail-upload-zone.drag-over {
    background-color: #4a4a4a;
    border-color: #888;
}

.apa-thumbnail-upload-instructions i {
    font-size: 3em;
    color: #888;
    margin-bottom: 15px;
    display: block;
}

.apa-thumbnail-upload-instructions p {
    margin: 0;
    color: #ccc;
}

#apa-thumbnail-file-input {
    display: none;
}

.apa-thumbnail-preview-container {
    margin-top: 20px;
    text-align: center;
    display: none;
}

.apa-thumbnail-preview-container h4 {
    margin-bottom: 10px;
    color: #ccc;
}

.apa-thumbnail-preview-container img {
    max-width: 100%;
    max-height: 200px;
    border: 2px solid #555;
    border-radius: 5px;
}

.apa-thumbnail-uploader-actions {
    margin-top: 20px;
    text-align: right;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.apa-progress-container {
    margin: 20px 0;
    display: none;
}

.apa-progress-bar {
    height: 10px;
    background-color: #444;
    border-radius: 5px;
    overflow: hidden;
}

.apa-progress-bar-fill {
    height: 100%;
    background-color: #5cb85c;
    width: 0%;
    transition: width 0.3s ease;
}

.apa-progress-text {
    font-size: 12px;
    color: #ccc;
    text-align: right;
    margin-top: 5px;
}

/* Re-using some button styles for consistency */
.apa-thumbnail-uploader-actions .button-primary,
.apa-thumbnail-uploader-actions .button-secondary {
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    border: none;
    border-radius: 3px;
}

.apa-thumbnail-uploader-actions .button-primary {
    background-color: #28a745;
    color: white;
}
.apa-thumbnail-uploader-actions .button-primary:disabled {
    background-color: #555;
    cursor: not-allowed;
}

.apa-thumbnail-uploader-actions .button-secondary {
    background-color: #6c757d;
    color: white;
}

/* Dual Uploader for Image & Thumbnail */
.apa-dual-uploader-modal .apa-thumbnail-uploader-content {
    width: 700px;
    max-width: 95%;
}

.apa-dual-upload-zones {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}

.apa-dual-upload-zone-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.apa-dual-upload-zone-wrapper h4 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #ccc;
    font-size: 16px;
    text-align: center;
}

/* Make individual drop zones smaller for the dual view */
.apa-dual-upload-zone-wrapper .apa-thumbnail-upload-zone {
    width: 100%;
    height: 150px;
    min-height: 150px;
    padding: 10px;
}

.apa-dual-upload-zone-wrapper .apa-thumbnail-preview-container img {
    max-height: 120px;
}