/* Widget Styles for GMIS */

/* ========================================
   CKEditor Content Widget
   ======================================== */
.ckeditor-content {
    line-height: 1.7;
    color: #333;
}

.ckeditor-content h1,
.ckeditor-content h2,
.ckeditor-content h3,
.ckeditor-content h4 {
    color: #2d5f3f;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.ckeditor-content p {
    margin-bottom: 1rem;
}

.ckeditor-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.ckeditor-content ul,
.ckeditor-content ol {
    margin-left: 1.5rem;
    margin-bottom: 1rem;
}

.ckeditor-content blockquote {
    border-left: 4px solid #2d5f3f;
    padding-left: 1rem;
    margin: 1.5rem 0;
    font-style: italic;
    color: #666;
}

/* ========================================
   Image Gallery Widget
   ======================================== */
.image-gallery-widget {
    margin: 2rem 0;
}

.gallery-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2d5f3f;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
}

.gallery-link {
    display: block;
    position: relative;
    overflow: hidden;
}

.gallery-link img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-link:hover img {
    transform: scale(1.05);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.875rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-link:hover .gallery-caption {
    transform: translateY(0);
}

.image-credit {
    padding: 0.5rem;
    font-size: 0.75rem;
    color: #666;
    font-style: italic;
}

/* ========================================
   Video Gallery Widget
   ======================================== */
.video-gallery-widget {
    margin: 2rem 0;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.video-item {
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

.video-wrapper iframe,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e0e0e0;
}

.video-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.no-thumbnail {
    color: #999;
    font-size: 1rem;
}

.video-info {
    padding: 1rem;
}

.video-title {
    font-size: 1.125rem;
    margin: 0 0 0.5rem 0;
    color: #2d5f3f;
}

.video-caption {
    font-size: 0.875rem;
    color: #666;
    margin: 0.5rem 0;
}

.video-credit,
.video-duration {
    font-size: 0.75rem;
    color: #999;
    font-style: italic;
    margin-top: 0.25rem;
}

/* ========================================
   Metadata Widget
   ======================================== */
.metadata-widget {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
    border-left: 4px solid #2d5f3f;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.meta-item:last-child {
    margin-bottom: 0;
}

.meta-icon {
    color: #2d5f3f;
    font-size: 1.25rem;
}

.meta-label {
    font-weight: 600;
    color: #333;
}

.meta-value {
    color: #666;
}

.meta-tags {
    flex-wrap: wrap;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    display: inline-block;
    background: #2d5f3f;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Status text colors removed - let badges handle their own styling */

/* ========================================
   Share Buttons Widget
   ======================================== */
.share-buttons-widget {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 0;
    margin: 1.5rem 0;
    border-top: 1px solid #e0e0e0;
    border-bottom: 1px solid #e0e0e0;
}

.share-label {
    font-weight: 600;
    color: #333;
}

.share-button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    color: white;
}

.share-btn svg {
    width: 18px;
    height: 18px;
}

.share-facebook {
    background: #1877f2;
}

.share-facebook:hover {
    background: #0d6efd;
}

.share-twitter {
    background: #1da1f2;
}

.share-twitter:hover {
    background: #0d8ecf;
}

.share-linkedin {
    background: #0077b5;
}

.share-linkedin:hover {
    background: #006399;
}

.share-email {
    background: #666;
}

.share-email:hover {
    background: #555;
}

/* ========================================
   Thumbnail Widget
   ======================================== */
.thumbnail-widget {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
}

.thumbnail-widget img {
    width: 100%;
    height: auto;
    display: block;
}

.thumbnail-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    color: white;
    padding: 1rem;
    font-size: 0.875rem;
}

/* ========================================
   Related Content Widget
   ======================================== */
.related-content-widget {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.related-content-title {
    font-size: 1.25rem;
    color: #2d5f3f;
    margin-bottom: 1rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.related-item {
    background: white;
    border-radius: 8px;
    padding: 1rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.related-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.related-item-title {
    font-size: 1rem;
    color: #2d5f3f;
    margin-bottom: 0.5rem;
    text-decoration: none;
    display: block;
}

.related-item-title:hover {
    color: #1a4d2e;
}

.related-item-excerpt {
    font-size: 0.875rem;
    color: #666;
    line-height: 1.5;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

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

    .share-buttons-widget {
        flex-direction: column;
        align-items: flex-start;
    }

    .share-btn span {
        display: none;
    }

    .share-btn {
        padding: 0.5rem;
    }

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

/* ========================================
   Image/Video Gallery Selector Widget
   ======================================== */
.image-gallery-selector-widget,
.video-gallery-selector-widget {
    margin: 1rem 0;
}

.gallery-preview-container {
    border: 2px dashed var(--border-color, #ddd);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--surface-light, #f8f9fa);
    min-height: 150px;
}

.gallery-preview-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.gallery-preview-scroll::-webkit-scrollbar {
    height: 8px;
}

.gallery-preview-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.gallery-preview-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.gallery-preview-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.gallery-preview-item {
    position: relative;
    flex-shrink: 0;
    width: 150px;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.gallery-preview-item img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.gallery-preview-title {
    padding: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-dark, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-preview-type {
    padding: 0 0.5rem 0.5rem;
    font-size: 0.7rem;
    color: var(--text-muted, #666);
    font-style: italic;
}

.gallery-preview-remove {
    position: absolute;
    top: 0.25rem;
    right: 0.25rem;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.gallery-preview-remove:hover {
    background: rgba(220, 53, 69, 1);
}

.gallery-preview-remove .material-icons {
    font-size: 16px;
}

.gallery-preview-empty {
    text-align: center;
    color: var(--text-muted, #666);
    padding: 2rem;
    font-style: italic;
}

.gallery-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.gallery-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Gallery Selector Modal */
.gallery-selector-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.gallery-selector-modal.active {
    opacity: 1;
    pointer-events: all;
}

.gallery-selector-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 1000px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

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

.gallery-selector-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-dark, #333);
}

.modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

.modal-close:hover {
    background: var(--surface-light, #f8f9fa);
}

.gallery-selector-search {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #ddd);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .material-icons {
    position: absolute;
    left: 1rem;
    color: var(--text-muted, #666);
}

.gallery-search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    font-size: 1rem;
}

.gallery-search-input:focus {
    outline: none;
    border-color: var(--primary-color, #2d5f3f);
}

.gallery-selector-grid {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    align-content: start;
}

.gallery-selector-item {
    position: relative;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface-light, #f8f9fa);
}

.gallery-selector-item:hover {
    border-color: var(--primary-color, #2d5f3f);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gallery-selector-item.selected {
    border-color: var(--primary-color, #2d5f3f);
    background: rgba(45, 95, 63, 0.1);
}

.gallery-selector-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

.gallery-selector-overlay {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.gallery-selector-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color, #2d5f3f);
}

.gallery-selector-title {
    padding: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-dark, #333);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: white;
}

.gallery-selector-badge {
    position: absolute;
    bottom: 2.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 4px;
    font-weight: 600;
}

.gallery-selector-radio {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary-color, #2d5f3f);
}

.gallery-preview-type {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.2rem 0.5rem;
    font-size: 0.7rem;
    border-radius: 4px;
    font-weight: 600;
}

.gallery-selector-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color, #ddd);
    gap: 1rem;
}

.selected-count {
    font-weight: 600;
    color: var(--text-dark, #333);
}

.loading-spinner,
.no-results,
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-muted, #666);
}

.loading-spinner .material-icons,
.no-results .material-icons,
.error-message .material-icons {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.rotating {
    animation: rotate 1s linear infinite;
}

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

/* ========================================
   Thumbnail Selector Widget
   ======================================== */
.thumbnail-selector-widget {
    margin: 1rem 0;
}

.thumbnail-preview-container {
    border: 2px dashed var(--border-color, #ddd);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--surface-light, #f8f9fa);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.thumbnail-preview img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border: 1px solid var(--border-color, #ddd);
}

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

.thumbnail-title {
    font-size: 0.875rem;
    color: var(--text-dark, #333);
    margin-bottom: 0.5rem;
}

.thumbnail-placeholder {
    text-align: center;
    color: var(--text-muted, #666);
}

.thumbnail-placeholder .material-icons {
    font-size: 4rem;
    opacity: 0.3;
    margin-bottom: 1rem;
}

.thumbnail-placeholder p {
    font-style: italic;
}

.thumbnail-select-btn,
.thumbnail-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========================================
   File Upload Progress Widget
   ======================================== */
.file-upload-widget {
    margin: 1rem 0;
}

.current-file-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--surface-light, #f8f9fa);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    margin-bottom: 1rem;
}

.current-file-info .material-icons {
    color: var(--primary-color, #2d5f3f);
}

.current-file-info a {
    color: var(--primary-color, #2d5f3f);
    text-decoration: none;
}

.current-file-info a:hover {
    text-decoration: underline;
}

.file-dropzone {
    border: 2px dashed var(--border-color, #ddd);
    border-radius: 8px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--surface-light, #f8f9fa);
}

.file-dropzone:hover,
.file-dropzone.drag-over {
    border-color: var(--primary-color, #2d5f3f);
    background: rgba(45, 95, 63, 0.05);
}

.dropzone-icon {
    font-size: 48px;
    color: var(--primary-color, #2d5f3f);
    margin-bottom: 1rem;
}

.dropzone-text {
    font-size: 1rem;
    color: var(--text-dark, #333);
    margin-bottom: 0.5rem;
}

.dropzone-hint {
    font-size: 0.875rem;
    color: var(--text-muted, #666);
    font-style: italic;
}

/* File Selected Info */
.file-selected-info {
    background: white;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    padding: 1rem;
}

.file-info-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-info-content .material-icons {
    font-size: 32px;
    color: var(--primary-color, #2d5f3f);
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--text-dark, #333);
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.file-size {
    font-size: 0.875rem;
    color: var(--text-muted, #666);
}

.file-remove-btn {
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-muted, #666);
    border-radius: 4px;
    transition: all 0.2s;
}

.file-remove-btn:hover {
    background: rgba(231, 76, 60, 0.1);
    color: #e74c3c;
}

.file-remove-btn .material-icons {
    font-size: 20px;
}

.upload-progress-container {
    margin-top: 1rem;
}

.upload-progress-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.upload-progress-item {
    background: white;
    border: 1px solid var(--border-color, #ddd);
    border-radius: 8px;
    padding: 1rem;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.progress-filename {
    font-weight: 600;
    color: var(--text-dark, #333);
    font-size: 0.875rem;
}

.progress-percentage {
    font-size: 0.875rem;
    color: var(--text-muted, #666);
}

.progress-bar-container {
    background: var(--surface-light, #f1f1f1);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color, #2d5f3f), #4caf50);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-bar.complete {
    background: #4caf50;
}

.progress-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.progress-status .material-icons {
    font-size: 1.125rem;
}

.progress-status.success {
    color: #28a745;
}

.progress-status.error {
    color: #dc3545;
}

/* ========================================
   CKEditor Preview Modal
   ======================================== */
.ckeditor-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.ckeditor-preview-modal.active {
    opacity: 1;
    pointer-events: all;
}

.ckeditor-preview-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    position: relative;
}

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

.ckeditor-preview-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-dark, #333);
}

.preview-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.2s;
}

.preview-close-btn:hover {
    background: var(--surface-light, #f8f9fa);
}

.ckeditor-preview-body {
    padding: 1rem 0;
}

/* Section header with toggle button */
.section-header-with-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header-with-toggle h2 {
    margin: 0;
}

.ckeditor-toggle-preview-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Inline preview container */
.ckeditor-preview-container {
    border: 2px solid var(--border-color, #ddd);
    border-radius: 8px;
    padding: 2rem;
    background: white;
    min-height: 300px;
}

.preview-content-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.ckeditor-preview-container .ckeditor-content {
    line-height: 1.8;
    color: var(--text-dark, #333);
}

.ckeditor-preview-container .no-content-message {
    text-align: center;
    color: var(--text-muted, #666);
    font-style: italic;
    padding: 3rem;
}

/* CKEditor Z-Index Fix - Keep below navigation (nav is z-index: 1000) */
.ck.ck-balloon-panel,
.ck.ck-toolbar,
.ck-sticky-panel,
.ck-sticky-panel__content,
.ck.ck-toolbar__items {
    z-index: 900 !important;
}

.ck.ck-editor__editable {
    z-index: 1 !important;
}

/* CKEditor Upload Progress Bar */
.ckeditor-upload-progress {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: var(--surface-light, #f8f9fa);
    border: 1px solid var(--border-color, #ddd);
    border-radius: 6px;
}

.upload-progress-bar {
    width: 100%;
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color, #2d5f3f) 0%, #3d7f5f 100%);
    transition: width 0.3s ease;
    border-radius: 4px;
}

.upload-progress-text {
    font-size: 0.875rem;
    color: var(--text-dark, #333);
    text-align: center;
    font-weight: 500;
}

/* Responsive adjustments for widgets */
@media (max-width: 768px) {
    .gallery-selector-content {
        width: 95%;
        max-height: 95vh;
    }

    .gallery-selector-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.75rem;
    }

    .gallery-preview-item {
        width: 120px;
    }

    .ckeditor-preview-content {
        width: 95%;
        padding: 1.5rem;
    }
}

/* ========================================
   Image Upload Widget
   ======================================== */
.image-upload-widget {
    margin-bottom: 1rem;
}

.image-dropzone {
    border: 2px dashed var(--border-color, #ddd);
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--surface-light, #f8f9fa);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.image-dropzone:hover {
    border-color: var(--primary-color, #2d5f3f);
    background: rgba(45, 95, 63, 0.05);
}

.image-dropzone.dragover {
    border-color: var(--primary-color, #2d5f3f);
    background: rgba(45, 95, 63, 0.1);
    transform: scale(1.02);
}

.image-dropzone .dropzone-icon {
    font-size: 48px;
    color: var(--primary-color, #2d5f3f);
    margin-bottom: 1rem;
    pointer-events: none;
}

.image-dropzone .dropzone-text {
    font-size: 1rem;
    color: var(--text-dark, #333);
    margin-bottom: 0.5rem;
    pointer-events: none;
}

.image-dropzone .dropzone-hint {
    font-size: 0.875rem;
    color: var(--text-muted, #666);
    font-style: italic;
    pointer-events: none;
}

.current-image-preview {
    position: relative;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    max-width: 400px;
}

.current-image-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.current-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 95, 63, 0.9);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.current-image-preview:hover .current-image-overlay {
    opacity: 1;
}

.current-image-overlay .material-icons {
    font-size: 48px;
    margin-bottom: 0.5rem;
}

.current-image-overlay p {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.current-image-overlay .btn {
    margin-top: 1rem;
}

.image-preview-container {
    position: relative;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    max-width: 400px;
    border: 2px solid var(--border-color, #ddd);
}

.image-preview-container .image-preview {
    width: 100%;
    height: auto;
    display: block;
}

.image-preview-actions {
    padding: 1rem;
    background: white;
    border-top: 1px solid var(--border-color, #ddd);
    display: flex;
    justify-content: center;
}

.image-remove-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* ========================================
   Thumbnail Selector Widget
   ======================================== */
.thumbnail-selector-widget {
    margin-bottom: 1rem;
}

.current-thumbnail-preview {
    position: relative;
    margin-bottom: 1rem;
    border-radius: 8px;
    overflow: hidden;
    max-width: 400px;
}

.current-thumbnail-preview img {
    width: 100%;
    height: auto;
    display: block;
}

.current-thumbnail-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(45, 95, 63, 0.9);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.current-thumbnail-preview:hover .current-thumbnail-overlay {
    opacity: 1;
}

.current-thumbnail-overlay .material-icons {
    font-size: 48px;
    margin-bottom: 0.5rem;
}

.current-thumbnail-overlay p {
    margin: 0 0 1rem 0;
    font-size: 1rem;
    font-weight: 600;
}

.current-thumbnail-overlay .btn {
    margin-top: 0.5rem;
}

/* =============================================================================
   Venue Map Selector Widget
   ============================================================================= */

.venue-map-selector-widget {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
    background: #ffffff;
    margin-bottom: 20px;
}

.venue-field-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
}

.venue-field-label .material-icons {
    font-size: 20px;
    color: #2196F3;
}

.required-indicator {
    color: #d32f2f;
    font-weight: bold;
}

/* Search Section */
.venue-search-section {
    margin-bottom: 24px;
}

.venue-autocomplete-wrapper {
    position: relative;
}

.venue-autocomplete-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.venue-autocomplete-input:focus {
    outline: none;
    border-color: #2196F3;
}

.venue-autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-top: none;
    border-radius: 0 0 4px 4px;
    max-height: 350px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.autocomplete-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.2s;
}

.autocomplete-item:hover {
    background-color: #f5f5f5;
}

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

.autocomplete-item .material-icons {
    color: #2196F3;
    font-size: 24px;
    margin-top: 2px;
}

.autocomplete-item-text {
    flex: 1;
}

.autocomplete-main {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.autocomplete-secondary {
    font-size: 13px;
    color: #666;
}

.autocomplete-empty {
    padding: 16px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.autocomplete-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    color: #666;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2196F3;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.venue-search-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

.venue-search-hint .material-icons {
    font-size: 16px;
}

/* Manual Entry Fields */
.venue-fields-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.venue-field-group {
    display: flex;
    flex-direction: column;
}

.venue-address-input,
.venue-name-input {
    padding: 10px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.venue-address-input:focus,
.venue-name-input:focus {
    outline: none;
    border-color: #2196F3;
}

.field-help-text {
    margin-top: 6px;
    font-size: 12px;
    color: #999;
}

/* Map Section */
.venue-map-section {
    margin-bottom: 16px;
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.map-recenter-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    font-size: 13px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.map-recenter-btn:hover {
    background: #e0e0e0;
}

.map-recenter-btn .material-icons {
    font-size: 18px;
}

.venue-map-container {
    width: 100%;
    height: 400px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background: #f5f5f5;
}

.venue-map-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

.venue-map-hint .material-icons {
    font-size: 16px;
}

/* Coordinates Display */
.venue-coordinates-display {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 12px;
}

.venue-coordinates-display .material-icons {
    font-size: 18px;
    color: #666;
}

.coordinates-label {
    font-weight: 600;
    color: #666;
    margin-right: 4px;
}

.coordinates-text {
    font-family: 'Courier New', 'Consolas', monospace;
    color: #333;
    font-size: 13px;
}

/* Status Messages */
.venue-status-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    margin-top: 12px;
}

.venue-status-message.status-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.venue-status-message.status-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.venue-status-message.status-warning {
    background: #fff3e0;
    color: #e65100;
    border: 1px solid #ffb74d;
}

.venue-status-message.status-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

.venue-status-message .status-icon {
    font-size: 20px;
}

/* Places API Toggle Controls */
.places-api-toggles {
    display: none; /* Hidden by default, shown after moved to map controls */
    align-items: center;
    gap: 20px;
    margin-left: 16px;
}

.toggle-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.toggle-label {
    font-size: 13px;
    font-weight: 500;
    color: #555;
    white-space: nowrap;
}

/* Toggle Switch Slider */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    cursor: pointer;
}

.toggle-switch input[type="checkbox"] {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: all 0.3s ease;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background-color: #4CAF50;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch input[type="checkbox"]:focus + .toggle-slider {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

.toggle-switch input[type="checkbox"]:disabled + .toggle-slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Info Button with Tooltip */
.info-btn {
    background: none;
    border: none;
    padding: 4px;
    cursor: help;
    color: #757575;
    transition: color 0.2s;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.info-btn:hover {
    color: #2d5f3f;
}

.info-btn .material-icons {
    font-size: 18px;
}

/* Tooltip */
.info-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
    z-index: 1000;
    max-width: 300px;
    white-space: normal;
}

.info-btn::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.85);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.info-btn:hover::after,
.info-btn:hover::before {
    opacity: 1;
}

.info-btn:hover::after {
    transform: translateX(-50%) translateY(-4px);
}

/* Map Controls Container */
.map-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Map with Search Panel Container */
.venue-map-with-search {
    display: flex;
    gap: 0;
    position: relative;
    height: 600px; /* Increased height for better proportion with side panel */
}

.venue-map-container-wrapper {
    position: relative;
    height: 100%;
    width: 100%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1); /* Smooth width transition */
}

/* When side panel is shown, map container shrinks width */
.venue-map-container-wrapper.with-side-panel {
    width: calc(100% - 400px); /* Shrink to make room for 400px panel */
}

.venue-map-with-search .venue-map-container {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    position: relative;
    z-index: 1;
}

/* Shared Side Panel (replaces both overlay card and search panel) */
.venue-side-panel {
    position: relative;
    width: 0;
    height: 100%;
    background: var(--primary-bg); /* Dark mode background */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    opacity: 0;
    z-index: 2;
}

/* When side panel is shown */
.venue-side-panel.show {
    width: 400px;
    opacity: 1;
}

/* Side panel content containers */
.side-panel-content {
    width: 400px; /* Fixed width to prevent content reflow during transition */
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Close button for side panel */
.side-panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.side-panel-close:hover {
    background: rgba(211, 47, 47, 0.9);
    border-color: rgba(211, 47, 47, 1);
    color: white;
    box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3);
}

.side-panel-close .material-icons {
    font-size: 20px;
}

gmp-place-details {
    display: block;
    width: 100%;
    border-radius: 0;

    /* Google Maps Material Design theming - DARK MODE */

    /* Backgrounds - Dark mode */
    --gmp-mat-color-surface: var(--primary-bg); /* Dark background */
    --gmp-mat-color-disabled-surface: rgba(255, 255, 255, 0.08);

    /* Text colors - Light text on dark background */
    --gmp-mat-color-on-surface: var(--text-primary); /* Light cream text */
    --gmp-mat-color-on-surface-variant: rgba(232, 220, 196, 0.7); /* Muted light text */

    /* Accent colors */
    --gmp-mat-color-primary: var(--accent-color); /* Gold accent */
    --gmp-mat-color-secondary-container: rgba(92, 169, 154, 0.15);
    --gmp-mat-color-on-secondary-container: var(--secondary-color);

    /* Status indicators */
    --gmp-mat-color-positive: #66bb6a;
    --gmp-mat-color-negative: #ef5350;
    --gmp-mat-color-info: var(--accent-color);

    /* Supporting colors */
    --gmp-mat-color-neutral-container: rgba(255, 255, 255, 0.05);
    --gmp-mat-color-on-neutral-container: rgba(232, 220, 196, 0.6);
    --gmp-mat-color-outline-decorative: rgba(255, 255, 255, 0.12);

    /* Typography - match GMIS font */
    --gmp-mat-font-family: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --gmp-mat-font-body-medium: 400 0.875rem/1.5 var(--gmp-mat-font-family);
    --gmp-mat-font-body-small: 400 0.75rem/1.4 var(--gmp-mat-font-family);
    --gmp-mat-font-title-small: 500 1rem/1.4 var(--gmp-mat-font-family);
    --gmp-mat-font-label-medium: 500 0.75rem/1.4 var(--gmp-mat-font-family);
}

/* Wrong Place Button - Dark mode styling */
.place-card-wrong-btn {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #ef5350;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
}

.place-card-wrong-btn:hover {
    background: rgba(239, 83, 80, 0.15);
    color: #ff6659;
}

.place-card-wrong-btn .material-icons {
    font-size: 18px;
}

/* Place Search Content - Dark mode styling */
.place-search-content {
    padding-top: 48px; /* Space for close button */
}

.place-search-content gmp-place-search {
    display: block;
    width: 100%;
    height: calc(100% - 48px);
}

/* Dark mode for Google Maps place search component */
gmp-place-search {
    /* Background colors */
    --gmp-mat-color-surface: var(--primary-bg);
    --gmp-mat-color-disabled-surface: rgba(255, 255, 255, 0.08);

    /* Text colors */
    --gmp-mat-color-on-surface: var(--text-primary);
    --gmp-mat-color-on-surface-variant: rgba(232, 220, 196, 0.7);

    /* Accent colors */
    --gmp-mat-color-primary: var(--accent-color);
    --gmp-mat-color-secondary-container: rgba(92, 169, 154, 0.15);
    --gmp-mat-color-on-secondary-container: var(--secondary-color);

    /* Supporting colors */
    --gmp-mat-color-neutral-container: rgba(255, 255, 255, 0.05);
    --gmp-mat-color-on-neutral-container: rgba(232, 220, 196, 0.6);
    --gmp-mat-color-outline-decorative: rgba(255, 255, 255, 0.12);

    /* Typography */
    --gmp-mat-font-family: 'Plus Jakarta Sans', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --gmp-mat-font-body-medium: 400 0.875rem/1.5 var(--gmp-mat-font-family);
    --gmp-mat-font-body-small: 400 0.75rem/1.4 var(--gmp-mat-font-family);
    --gmp-mat-font-title-small: 500 1rem/1.4 var(--gmp-mat-font-family);
}

/* Hints container */
.venue-map-hints {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Google Places Autocomplete Dropdown Z-Index Fix */
/* Must appear below form wizard nav (z-index: 100) and sticky navigation bar (z-index: 1000) */
.pac-container {
    z-index: 90 !important;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .venue-map-selector-widget {
        padding: 16px;
    }

    .venue-fields-section {
        grid-template-columns: 1fr;
    }

    .venue-map-container {
        height: 300px;
    }

    .map-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .places-api-toggles {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-left: 0;
        margin-top: 8px;
    }

    .map-controls {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    /* Stack map and side panel vertically on mobile */
    .venue-map-with-search {
        flex-direction: column;
        height: auto; /* Auto height on mobile */
    }

    .venue-map-container-wrapper {
        width: 100% !important; /* Full width on mobile */
    }

    .venue-map-container-wrapper.with-side-panel {
        width: 100% !important; /* Keep full width even when panel is shown */
    }

    .venue-map-with-search .venue-map-container {
        height: 300px;
        border-radius: 8px !important; /* Keep rounded on mobile */
    }

    /* Side panel stacks below map on mobile */
    .venue-side-panel {
        width: 100% !important;
        margin-top: 16px;
        border-radius: 8px;
    }

    .venue-side-panel.show {
        width: 100% !important;
    }

    .side-panel-content {
        width: 100%;
        height: 400px; /* Fixed height on mobile */
    }
}
