/* Dialog animations */
@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        transform: scale(0.95) translateY(-10px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Dialog (Rename / Move / Confirm) — Modern Style */
.rename-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-overlay-light);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(2px);
    animation: modalFadeIn 0.2s ease;
}

.rename-dialog-content {
    background-color: var(--color-bg-surface);
    border-radius: 16px;
    width: 420px;
    max-width: 90%;
    box-shadow: 0 20px 60px var(--color-shadow-2xl);
    overflow: hidden;
    animation: modalSlideIn 0.25s ease;
}

.rename-dialog-header {
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text-heading);
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.rename-dialog-body {
    padding: 24px;
}

.rename-dialog input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    font-size: 15px;
    background: var(--color-bg-hover);
    color: var(--color-text-heading);
    transition: all 0.15s ease;
    outline: none;
}

.rename-dialog input:focus {
    border-color: var(--color-accent);
    background: var(--color-bg-surface);
    box-shadow: 0 0 0 3px var(--color-accent-ring);
}

.rename-dialog input--error {
    border-color: var(--color-error-text);
}

.rename-dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: var(--color-bg-hover);
    border-top: 1px solid var(--color-border);
}

.rename-dialog-buttons .btn-outline {
    background: transparent;
    color: var(--color-text-secondary);
    border: 1px solid var(--color-border-medium);
}

.rename-dialog-buttons .btn-outline:hover {
    background: var(--color-bg-alt);
    border-color: var(--color-text-placeholder);
}

/* Share Dialog — Modern Style */
.share-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-overlay-light);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(2px);
    animation: modalFadeIn 0.2s ease;
}

.share-dialog-content {
    background-color: var(--color-bg-surface);
    border-radius: 16px;
    width: 480px;
    max-width: 90%;
    box-shadow: 0 20px 60px var(--color-shadow-2xl);
    overflow: hidden;
    animation: modalSlideIn 0.25s ease;
    max-height: 85vh;
    overflow-y: auto;
}

.share-dialog-header {
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text-heading);
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.share-dialog input,
.share-dialog textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    font-size: 14px;
    background: var(--color-bg-input);
    color: var(--color-text-heading);
    transition: all 0.15s ease;
    outline: none;
}

.share-dialog input:focus,
.share-dialog textarea:focus {
    border-color: var(--color-accent);
    background: var(--color-bg-surface);
    box-shadow: 0 0 0 3px var(--color-accent-ring);
}

.share-dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: var(--color-bg-hover);
    border-top: 1px solid var(--color-border);
}

.shared-item-info {
    padding: 12px 24px;
    background: var(--color-bg-hover);
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}

.share-options {
    padding: 20px 24px 20px;
}

.share-options > #share-confirm-btn {
    display: block;
    margin-left: auto;
    margin-top: 16px;
}

.share-options h3,
#existing-shares-section h3,
#new-share-section h3 {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--color-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#existing-shares-section,
#new-share-section {
    padding: 0 24px;
}

.share-dialog .form-group {
    padding: 0;
}

/* Shared View Dialog (edit/notification dialogs inside sharedView component) */
.shared-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-overlay-light);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    backdrop-filter: blur(2px);
    animation: modalFadeIn 0.2s ease;
}

.shared-dialog-content {
    background-color: var(--color-bg-surface);
    border-radius: 16px;
    width: 480px;
    max-width: 90%;
    box-shadow: 0 20px 60px var(--color-shadow-2xl);
    overflow: hidden;
    animation: modalSlideIn 0.25s ease;
    max-height: 85vh;
    overflow-y: auto;
    padding: 0;
}

.shared-dialog-header {
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text-heading);
    padding: 20px 24px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 12px;
}

.shared-dialog-header .close-dialog-btn {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: var(--color-text-muted);
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.shared-dialog-header .close-dialog-btn:hover {
    background: var(--color-bg-empty);
    color: var(--color-text-heading);
}

.shared-dialog .share-link-section,
.shared-dialog .share-permissions-section,
.shared-dialog .share-password-section,
.shared-dialog .share-expiration-section,
.shared-dialog .notification-form {
    padding: 16px 24px;
}

.shared-dialog .share-link-section label,
.shared-dialog .share-permissions-section h4,
.shared-dialog .notification-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-text);
    font-size: 14px;
}

.shared-dialog .share-link-input {
    display: flex;
    gap: 8px;
}

.shared-dialog .share-link-input input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--color-bg-hover);
    color: var(--color-text-heading);
}

.shared-dialog .share-permissions-section label,
.shared-dialog .share-password-section label,
.shared-dialog .share-expiration-section label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--color-text-secondary);
}

.shared-dialog .password-input-group {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.shared-dialog .password-input-group input {
    flex: 1;
    padding: 8px 12px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--color-bg-hover);
}

.shared-dialog .share-expiration-section input[type="date"] {
    padding: 8px 12px;
    border: 2px solid var(--color-border);
    border-radius: 8px;
    font-size: 13px;
    background: var(--color-bg-hover);
    margin-top: 8px;
}

.shared-dialog .share-actions,
.shared-dialog .notification-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 16px 24px;
    background: var(--color-bg-hover);
    border-top: 1px solid var(--color-border);
}

.shared-dialog .notification-form input,
.shared-dialog .notification-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--color-border);
    border-radius: 10px;
    font-size: 14px;
    background: var(--color-bg-hover);
    color: var(--color-text-heading);
    outline: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
}

.shared-dialog .notification-form input:focus,
.shared-dialog .notification-form textarea:focus {
    border-color: var(--color-accent);
    background: var(--color-bg-surface);
    box-shadow: 0 0 0 3px var(--color-accent-ring);
}

.shared-dialog .notification-form .form-group {
    padding: 0;
    margin-bottom: 15px;
}

/* Move dialog breadcrumb navigation */
.move-dialog-breadcrumb {
    display: none; /* Hidden by default, shown via JS when navigating into subfolders */
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 12px;
    background: var(--color-bg-hover);
    border-radius: 8px;
    margin-bottom: 12px;
    font-size: 13px;
    overflow-x: auto;
}

.move-breadcrumb-item {
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.move-breadcrumb-item:hover {
    background: var(--color-bg-hover);
    color: var(--color-text-heading);
}

.move-breadcrumb-item.current {
    color: var(--color-accent);
    font-weight: 600;
    cursor: default;
}

.move-breadcrumb-separator {
    color: var(--color-text-placeholder);
    margin: 0 2px;
}

/* Folder select items in move dialog */
.folder-select-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--color-text-secondary);
    font-size: 14px;
}

.folder-select-item:hover {
    background-color: var(--color-bg-hover);
}

.folder-select-item.selected {
    background-color: var(--color-accent-ring);
    color: var(--color-accent);
    font-weight: 600;
}

.folder-select-item i {
    color: var(--color-cal-1);
    font-size: 16px;
}

.folder-select-item.selected i {
    color: var(--color-accent);
}

/* "Select this folder" option */
.folder-select-item.folder-select-current {
    background-color: var(--color-success-ring);
    color: var(--color-success-text-strong);
    font-weight: 500;
}

.folder-select-item.folder-select-current:hover {
    background-color: var(--color-success-ring-dark);
}

.folder-select-item.folder-select-current i {
    color: var(--color-success-border);
}

/* Navigate up option */
.folder-select-item.folder-navigate-up {
    color: var(--color-text-muted);
    font-style: italic;
}

.folder-select-item.folder-navigate-up:hover {
    color: var(--color-text-secondary);
}

.folder-select-item.folder-navigate-up i {
    color: var(--color-text-placeholder);
}

/* Folder navigation item (click to enter) */
.folder-select-item.folder-navigate {
    justify-content: space-between;
}

.folder-select-item.folder-navigate .folder-name {
    flex: 1;
}

.folder-select-item.folder-navigate .folder-navigate-icon {
    color: var(--color-text-placeholder);
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.folder-select-item.folder-navigate:hover .folder-navigate-icon {
    opacity: 1;
}

/* Empty folder message */
.folder-select-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 24px;
    color: var(--color-text-placeholder);
    font-size: 14px;
}

.folder-select-empty i {
    font-size: 20px;
}

/* Playlist track count in selector */
.playlist-track-count {
    margin-left: auto;
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Custom confirm dialog */
.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-overlay-light);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    backdrop-filter: blur(2px);
    animation: modalFadeIn 0.2s ease;
}

.confirm-dialog.active {
    display: flex;
    opacity: 1;
}

.confirm-dialog-content {
    background: var(--color-bg-surface);
    border-radius: 16px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 20px 60px var(--color-shadow-2xl);
    overflow: hidden;
    animation: modalSlideIn 0.25s ease;
    text-align: center;
}

.confirm-dialog-icon {
    padding: 28px 24px 12px;
}

.confirm-dialog-icon i {
    font-size: 40px;
    color: var(--color-danger-bg);
}

.confirm-dialog-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--color-text-heading);
    padding: 0 24px 8px;
}

.confirm-dialog-message {
    font-size: 14px;
    color: var(--color-text-muted);
    padding: 0 24px 20px;
    line-height: 1.5;
}

.confirm-dialog-buttons {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: var(--color-bg-hover);
    border-top: 1px solid var(--color-border);
    justify-content: flex-end;
}

.confirm-dialog-buttons .btn-danger {
    background: linear-gradient(135deg, var(--color-danger-bg) 0%, var(--color-danger-bg-hover) 100%);
    color: var(--color-danger-text);
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 2px 8px var(--color-danger-ring);
}

.confirm-dialog-buttons .btn-danger:hover {
    box-shadow: 0 4px 12px var(--color-danger-ring-lg);
    transform: translateY(-1px);
}

/* Dialog styles */
.dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-overlay);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.dialog-content {
    background-color: var(--color-bg-surface);
    border-radius: 10px;
    box-shadow: 0 10px 25px var(--color-shadow);
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.dialog-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dialog-header h3 {
    font-size: 18px;
    color: var(--color-text);
    margin: 0;
}

.close-dialog-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--color-text-placeholder);
}

.dialog-body {
    padding: 20px;
}

.share-item-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.share-link-container {
    display: flex;
    gap: 10px;
}

.share-link-container input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
}
