.tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: var(--z-tooltip, 400);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    transform: translate(10px, 10px);
    
    /* Constraints */
    max-width: 240px;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    word-wrap: break-word;
}
.tooltip.hidden { display: none; }

/* Audio Players Hidden Container */
.audio-players-hidden {
    position: fixed;
    top: -9999px;
    left: -9999px;
}

/* Audio Equalizer Animation */
.audio-equalizer {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    width: 20px;
    height: 20px;
}

.audio-equalizer span {
    width: 3px;
    background-color: rgba(255, 255, 255, 0.5);
    animation: equalizer 1s ease-in-out infinite;
}

.audio-equalizer span:nth-child(1) { height: 60%; animation-delay: 0s; }
.audio-equalizer span:nth-child(2) { height: 30%; animation-delay: 0.2s; }
.audio-equalizer span:nth-child(3) { height: 50%; animation-delay: 0.4s; }

@keyframes equalizer {
    0%, 100% { height: 30%; }
    50% { height: 100%; }
}

/* Saved Countdowns Dropdown */
.saved-countdowns-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    width: 320px;
    background: rgba(20, 20, 20, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    z-index: var(--z-dropdown, 100);
    margin-top: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Settings Dropdown Menu */
.settings-dropdown-menu {
    width: 280px;
    right: 0;
    left: auto;
}

/* Dropdown Wrappers */
.settings-wrapper,
.saved-countdowns-wrapper {
    position: relative;
    display: inline-block;
}

.saved-countdowns-dropdown.hidden {
    display: none;
}

.saved-countdowns-header {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.);
}

.saved-countdowns-header h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-main);
    margin: 8px 0;
}

.saved-countdowns-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 300px;
    overflow-y: auto;
}

.saved-countdown-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
    cursor: pointer;
}

.saved-countdown-item:last-child {
    border-bottom: none;
}

.saved-countdown-item:hover {
    background: rgba(255,255,255,0.05);
}

.preset-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow: hidden;
}

.preset-name {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preset-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.delete-preset {
    background: none;
    border: none;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.delete-preset:hover {
    opacity: 1;
    background: rgba(255, 50, 50, 0.25);
}

.btn-save-current {
    font-size: 0.9rem;
    padding: 8px 12px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.1s;
}

.btn-save-current:hover {
    opacity: 0.9;
}

.btn-save-current.hidden {
    display: none;
}

/* --- Global Buttons --- */

.btn-primary {
    background: #ffffffee;
    border: none;
    color: #000000;
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

.btn-primary:focus-visible {
    outline: 2px solid var(--text-color);
    outline-offset: 2px;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

.btn-secondary:focus-visible {
    outline: 2px solid var(--text-color);
    outline-offset: 2px;
}

/* Small variant */
.btn-primary.small, .btn-secondary.small {
    padding: 6px 12px;
    font-size: 12px;
}

/* Settings Dropdown Styles */
.settings-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 300px;
    overflow-y: auto;
}

.settings-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
    cursor: pointer;
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item:hover {
    background: rgba(255,255,255,0.05);
}

.settings-item.danger:hover {
    background: rgba(255, 50, 50, 0.1);
    border-left: 2px solid #ff4444;
}

.btn-danger-secondary {
    background: var(--danger-bg, rgba(255, 50, 50, 0.1));
    border: 1px solid var(--danger-border, rgba(255, 50, 50, 0.3));
    color: var(--danger-color, #ff4444);
    cursor: pointer;
    font-family: var(--font-main);
    font-size: 14px;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 500;
    transition: all var(--transition-normal, 0.2s);
}

.btn-danger-secondary:hover {
    background: rgba(255, 50, 50, 0.2);
    border-color: rgba(255, 50, 50, 0.5);
    color: var(--danger-color, #ff4444);
}

/* Undo Notification Container */
.undo-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: var(--z-notification, 500);
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
}

/* Undo Notification Item */
.undo-notification {
    pointer-events: auto;
    background: var(--notification-bg, #1a1a1a);
    border: 1px solid var(--notification-border, #333);
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    min-width: 300px;
    position: relative;
    overflow: hidden;
    
    /* Animation */
    transform: translateX(-50px);
    opacity: 0;
    animation: undoSlideIn var(--transition-slow, 0.3s) var(--ease-out-expo, cubic-bezier(0.2, 0.8, 0.2, 1)) forwards;
}

.undo-notification.hiding {
    animation: undoSlideOut 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes undoSlideIn {
    to { transform: translateX(0); opacity: 1; }
}

@keyframes undoSlideOut {
    to { transform: translateX(-50px); opacity: 0; }
}

.undo-text {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-main);
}

.btn-undo {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-undo:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.undo-progress-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--danger-color, #ff4444);
    width: 100%;
    transform-origin: left;
}

.settings-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-name {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
}

.settings-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}
