/* Gallery Styles - Mobile First */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    padding: 0 5px; /* Small padding on mobile */
}

/* Tablet */
@media (min-width: 600px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
        padding: 0;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
        margin-bottom: 30px;
    }
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 16px;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    aspect-ratio: 1;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    -webkit-tap-highlight-color: transparent;
    border: 2px solid transparent;
}

.gallery-item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0,0,0,0.2);
    border-color: rgba(102, 126, 234, 0.3);
}

.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
    pointer-events: none;
}

.gallery-item:hover::before {
    opacity: 1;
}

/* On touch devices, show overlay on tap instead of hover */
@media (hover: none) and (pointer: coarse) {
    .gallery-item-overlay {
        opacity: 1;
        background: rgba(0,0,0,0.5);
    }
    
    .gallery-item:active .gallery-item-overlay {
        background: rgba(0,0,0,0.7);
    }
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    gap: 10px;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

.gallery-item-overlay button {
    padding: 8px 16px;
    background: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
}

.gallery-item-overlay button:hover {
    transform: scale(1.05);
}

/* Video indicator */
.video-indicator {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    pointer-events: none;
    z-index: 1;
}

.gallery-item.is-video::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    pointer-events: none;
    z-index: 1;
}

.gallery-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.gallery-empty p {
    font-size: 1.1em;
    margin-bottom: 10px;
}

/* Upload Form - Mobile First */
.upload-form {
    max-width: 100%;
    margin: 20px 10px;
    background: #f9f9f9;
    padding: 20px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

@media (min-width: 768px) {
    .upload-form {
        max-width: 600px;
        margin: 30px auto;
        padding: 30px;
    }
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 12px;
}

.file-input-wrapper {
    position: relative;
    display: block;
    padding: 12px;
    border: 2px dashed #667eea;
    border-radius: 8px;
    background: #f0f6ff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-wrapper:hover {
    background: #e6f0ff;
    border-color: #5568d3;
}

.file-input-wrapper.drag-over {
    background: #d9e8ff;
    border-color: #4a5fc1;
    transform: scale(1.02);
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.file-input-display {
    text-align: center;
    padding: 20px;
}

.file-input-display svg {
    margin-bottom: 10px;
    color: #667eea;
}

.file-input-wrapper .file-name {
    color: #667eea;
    font-weight: 500;
    display: block;
    margin-top: 8px;
}

/* File Preview Grid */
.file-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
}

.file-preview:empty {
    display: none;
}

.file-preview-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
}

.file-preview-item img {
    width: 100%;
    height: 80px;
    object-fit: contain;
    display: block;
    background: #fff;
    padding: 5px;
}

.file-preview-item .file-preview-name {
    padding: 5px;
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.file-preview-item .remove-file {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.file-preview-item .remove-file:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

/* Upload Progress */
.upload-progress {
    margin-top: 15px;
}

.upload-progress:empty {
    display: none;
}

.progress-item {
    margin-bottom: 12px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.progress-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
    font-size: 13px;
}

.progress-item-name {
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.progress-item-status {
    margin-left: 10px;
    font-size: 12px;
    color: #666;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-item.success .progress-bar {
    background: #4caf50;
}

.progress-item.error .progress-bar {
    background: #f44336;
}

.progress-item.success .progress-item-status {
    color: #4caf50;
}

.progress-item.error .progress-item-status {
    color: #f44336;
}

/* Upload Status */
.upload-status {
    margin-top: 20px;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

.upload-status.success {
    background: #d4edda;
    color: #155724;
}

.upload-status.error {
    background: #f8d7da;
    color: #721c24;
}

/* Folders */
.create-folder {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.create-folder input {
    flex: 1;
    min-width: 200px;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
}

.folders-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.folder-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    transition: all 0.3s ease;
}

.folder-item:hover {
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.folder-item h3 {
    margin-bottom: 10px;
    color: #667eea;
}

.folder-item p {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.folder-item-actions {
    display: flex;
    gap: 10px;
}

.folder-item-actions button {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 0;
    border-radius: 16px;
    max-width: 95%;
    max-height: 95vh;
    width: 100%;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .modal-content {
        max-width: 900px;
        width: 90%;
    }
}

@media (min-width: 1200px) {
    .modal-content {
        max-width: 1000px;
    }
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    color: #495057;
    background: white;
    border-radius: 50%;
    z-index: 10;
    line-height: 1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

@media (min-width: 768px) {
    .close {
        right: 20px;
        top: 20px;
        width: 45px;
        height: 45px;
        font-size: 26px;
    }
}

.close:hover {
    background: #f44336;
    color: white;
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.4);
}

/* Modal Body - Mobile First */
.modal-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 25px 20px;
    overflow-y: auto;
    max-height: calc(95vh - 100px);
}

@media (min-width: 1024px) {
    .modal-body {
        grid-template-columns: 1.2fr 1fr;
        gap: 30px;
        padding: 30px;
    }
}

/* Modal Image - Mobile First */
.modal-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 12px;
    min-height: 300px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

@media (min-width: 768px) {
    .modal-image {
        min-height: 450px;
    }
}

@media (min-width: 1024px) {
    .modal-image {
        position: sticky;
        top: 0;
    }
}

.modal-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: 8px;
}

@media (min-width: 768px) {
    .modal-image img {
        max-height: 550px;
    }
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.modal-metadata-section {
    position: relative;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.modal-metadata-section h2 {
    font-size: 1.5em;
    margin-bottom: 12px;
    color: #212529;
    font-weight: 700;
}

.modal-metadata-section p {
    margin: 8px 0;
    line-height: 1.6;
}

.edit-metadata-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

@media (min-width: 768px) {
    .edit-metadata-btn {
        font-size: 13px;
        padding: 6px 12px;
    }
}

.edit-metadata-btn:hover {
    background: #1976D2;
}

#metadataEditMode .form-group {
    margin-bottom: 15px;
}

#metadataEditMode .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

#metadataEditMode .form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

#metadataEditMode textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

.edit-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.edit-actions .btn {
    flex: 1;
}

#saveMetadataBtn {
    background: #4CAF50;
    color: white;
}

#saveMetadataBtn:hover {
    background: #45a049;
}

#cancelMetadataBtn {
    background: #f44336;
    color: white;
}

#cancelMetadataBtn:hover {
    background: #da190b;
}

.modal-details h2 {
    color: #333;
    margin-bottom: 10px;
}

.modal-details p {
    color: #666;
    line-height: 1.5;
}

.modal-info {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 18px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.info-item .label {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.info-item .label::before {
    margin-right: 6px;
}

.info-item:has(#modalDimensions) .label::before {
    content: "📐";
}

.info-item:has(#modalFileSize) .label::before {
    content: "💾";
}

.info-item:has(#modalCreated) .label::before {
    content: "📅";
}

.modal-tools {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.modal-tools h3 {
    margin: 0 0 18px 0;
    font-size: 1.1em;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-tools h3::before {
    content: "🛠️";
    font-size: 1.2em;
}

.tool-section {
    margin-bottom: 18px;
    padding: 15px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tool-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

.tool-section:last-child {
    margin-bottom: 0;
}

.tool-section > label:first-child {
    font-size: 13px;
    font-weight: 700;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.tool-section input[type="number"],
.tool-section input[type="range"],
.tool-section button {
    width: 100%;
}

.tool-section input[type="range"] {
    padding: 0;
    height: 6px;
    border-radius: 3px;
    background: #dee2e6;
    outline: none;
    cursor: pointer;
}

.tool-section input[type="range"]::-webkit-slider-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.tool-section input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: none;
}

.tool-section .btn-sm {
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.tool-section .btn-sm:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5568d3 0%, #6a3e8f 100%);
}

.tool-section .btn-sm:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.3);
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

.modal-actions button {
    flex: 1;
    min-width: 120px;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.modal-actions button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-actions .btn-warning {
    background: linear-gradient(135deg, #ff9800 0%, #f57c00 100%);
    color: white;
}

.modal-actions .btn-secondary {
    background: linear-gradient(135deg, #607d8b 0%, #455a64 100%);
    color: white;
}

.modal-actions .btn-danger {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
}

/* Landing Page Cards */
.gallery-item.landing-page-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    min-height: 200px;
    position: relative;
    overflow: hidden;
}

.landing-page-card .page-preview-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.6) 100%);
    z-index: 1;
}

.landing-page-card .landing-page-icon {
    font-size: 48px;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    z-index: 2;
    position: relative;
}

.landing-page-card .landing-page-info {
    text-align: center;
    width: 100%;
    z-index: 2;
    position: relative;
}

.landing-page-card .landing-page-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 10px 0;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.landing-page-card .page-status {
    display: inline-block;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    margin-bottom: 8px;
    background: rgba(255,255,255,0.2);
}

.landing-page-card .page-status.active {
    background: rgba(76, 175, 80, 0.3);
}

.landing-page-card .page-status.inactive {
    background: rgba(255, 152, 0, 0.3);
}

.landing-page-card .landing-page-updated {
    font-size: 12px;
    margin: 8px 0 0 0;
    opacity: 0.9;
}

.landing-page-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
}

.landing-page-card .gallery-item-overlay {
    background: rgba(0, 0, 0, 0.85);
    z-index: 3;
}

/* Modal - Mobile First approach */
@media (min-width: 768px) {
    .modal-body {
        grid-template-columns: 1fr 1fr;
        padding: 30px;
        gap: 30px;
    }
    
    .modal-image {
        min-height: 400px;
    }
}

/* Remove old desktop-first media query */

/* Share Badges Overlay - Appears on gallery items */
.share-badges-overlay {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    z-index: 2;
    flex-wrap: wrap;
    max-width: calc(100% - 16px);
}

.share-badge-mini {
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.share-badge-mini.badge-gallery {
    background: rgba(33, 150, 243, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.share-badge-mini.badge-grapesjs {
    background: rgba(156, 39, 176, 0.9);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Share/Unshare buttons in overlay */
.gallery-item-overlay .btn-gallery {
    background: #2196f3;
    color: white;
}

.gallery-item-overlay .btn-gallery:hover {
    background: #1976d2;
}

.gallery-item-overlay .btn-grapesjs {
    background: #9c27b0;
    color: white;
}

.gallery-item-overlay .btn-grapesjs:hover {
    background: #7b1fa2;
}

.gallery-item-overlay .btn-unshare {
    background: #95a5a6;
    color: white;
}

.gallery-item-overlay .btn-unshare:hover {
    background: #7f8c8d;
}

/* Mobile optimizations for share badges */
@media (max-width: 600px) {
    .share-badges-overlay {
        top: 4px;
        right: 4px;
    }
    
    .share-badge-mini {
        font-size: 10px;
        padding: 3px 6px;
    }
}


/* ===== DARK MODE SUPPORT FOR MODAL ===== */
body[data-theme="dark"] .modal {
    background: rgba(0,0,0,0.85);
}

body[data-theme="dark"] .modal-content {
    background: #2d2d2d;
    border: 1px solid #495057;
}

body[data-theme="dark"] .close {
    background: #495057;
    color: #e9ecef;
}

body[data-theme="dark"] .close:hover {
    background: #f44336;
    color: white;
}

body[data-theme="dark"] .modal-image {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
}

body[data-theme="dark"] .modal-metadata-section,
body[data-theme="dark"] .modal-info,
body[data-theme="dark"] .modal-tools {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%);
    border-color: #495057;
}

body[data-theme="dark"] .modal-metadata-section h2 {
    color: #e9ecef;
}

body[data-theme="dark"] .modal-metadata-section p,
body[data-theme="dark"] .modal-details p {
    color: #adb5bd;
}

body[data-theme="dark"] .info-item {
    border-bottom-color: #495057;
}

body[data-theme="dark"] .info-item .label {
    color: #e9ecef;
}

body[data-theme="dark"] .tool-section {
    background: #2d2d2d;
    border: 1px solid #495057;
}

body[data-theme="dark"] .tool-section > label:first-child {
    color: #e9ecef;
}

body[data-theme="dark"] .tool-section input[type="number"],
body[data-theme="dark"] .tool-section input[type="text"] {
    background: #1a1a1a;
    color: #e9ecef;
    border-color: #495057;
}

body[data-theme="dark"] .tool-section input[type="range"] {
    background: #495057;
}

body[data-theme="dark"] .modal-share-section {
    background: linear-gradient(135deg, #1e3a5f 0%, #2c5282 100%);
    border-color: #3182ce;
}

body[data-theme="dark"] .share-label {
    color: #90cdf4;
}

body[data-theme="dark"] .modal-share-section small {
    color: #90cdf4;
}

body[data-theme="dark"] #shareLinkContainer {
    background: #1a202c !important;
}

body[data-theme="dark"] #shareLinkInput {
    background: #2d3748 !important;
    color: #e9ecef !important;
    border-color: #4299e1 !important;
}

body[data-theme="dark"] .modal-actions {
    border-top-color: #495057;
}

body[data-theme="dark"] #metadataEditMode .form-control {
    background: #1a1a1a;
    color: #e9ecef;
    border-color: #495057;
}

body[data-theme="dark"] .modal-tools h3 {
    color: #e9ecef;
}

body[data-theme="dark"] .gallery-item-overlay button {
    background: #343a40;
    color: #e9ecef;
}

body[data-theme="dark"] .gallery-item-overlay button:hover {
    background: #495057;
}
