/* Component-specific styles */

/* Material Design 2 Slider */
.md-slider {
    position: relative;
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    z-index: 1;
}

.md-slider-track {
    position: absolute;
    width: 100%;
    height: 4px;
    background: var(--md-sys-color-surface-container-highest);
    border-radius: 2px;
    overflow: visible;
}

.md-slider-fill {
    position: absolute;
    height: 100%;
    background: var(--md-sys-color-primary);
    border-radius: 2px;
    transition: width 0.1s ease;
}

.md-slider-thumb {
    position: absolute;
    width: 20px;
    height: 20px;
    background: var(--md-sys-color-primary);
    border-radius: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: var(--md-sys-elevation-2);
    transition: box-shadow 0.2s ease;
    z-index: 3;
}

.md-slider-hover {
    position: absolute;
    width: 48px;
    height: 48px;
    background: var(--md-sys-color-primary);
    opacity: 0;
    border-radius: 50%;
    top: 50%;
    left: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 2;
}

.md-slider:hover .md-slider-hover,
.md-slider:active .md-slider-hover {
    opacity: 0.12;
}

.md-slider:active .md-slider-hover {
    opacity: 0.24;
}

.md-slider:active .md-slider-thumb {
    box-shadow: var(--md-sys-elevation-3);
}

.md-slider input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    z-index: 4;
}

/* Play Button */
.play-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--md-sys-color-primary);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--md-sys-elevation-3);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.play-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--md-sys-elevation-4);
}

.play-btn:active {
    transform: scale(0.95);
}

.play-btn.playing {
    background: var(--md-sys-color-error);
}

.play-btn-icon {
    font-size: 1.5rem;
    color: var(--md-sys-color-on-primary);
    z-index: 2;
    position: relative;
}

.play-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.play-btn:active::before {
    width: 100px;
    height: 100px;
}

/* Ripple Effect */
@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    backdrop-filter: blur(0px);
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, backdrop-filter 0.3s ease;
}

.modal.show {
    display: flex;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--md-sys-color-surface);
    padding: 32px;
    border-radius: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--md-sys-elevation-5);
    opacity: 0;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show .modal-content {
    opacity: 1;
    transform: scale(1) translateY(0);
}

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

.modal-title {
    font-size: 1.5rem;
    color: var(--md-sys-color-primary);
}

.modal-close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.modal-close:hover {
    background: var(--md-sys-color-surface-container-high);
    transform: rotate(90deg);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes swipeHint {
    0%, 100% { transform: translateX(-50%); }
    50% { transform: translateX(-50%) translateX(10px); }
}

/* Loading Spinner */
.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--md-sys-color-surface-container);
    border-top-color: var(--md-sys-color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: rgba(29, 27, 32, 0.95); /* More solid background */
    color: rgba(255, 255, 255, 0.95); /* Clear white text */
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), var(--md-sys-elevation-3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 2000;
    pointer-events: none;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--md-sys-elevation-3);
    transition: all 0.3s ease;
    z-index: 100;
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: var(--md-sys-elevation-4);
}

.fab-icon {
    font-size: 1.5rem;
}

/* Input Fields */
.md-input {
    position: relative;
    margin-bottom: 20px;
}

.md-input input {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: 4px;
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.md-input input:focus {
    outline: none;
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 3px rgba(187, 134, 252, 0.12);
}

.md-input label {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--md-sys-color-on-surface-variant);
    font-size: 1rem;
    pointer-events: none;
    transition: all 0.2s ease;
    background: var(--md-sys-color-surface);
    padding: 0 4px;
}

.md-input input:focus + label,
.md-input input:not(:placeholder-shown) + label {
    top: 0;
    font-size: 0.75rem;
    color: var(--md-sys-color-primary);
}

/* Checkbox */
.md-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin-bottom: 12px;
}

.md-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.md-checkbox-box {
    width: 18px;
    height: 18px;
    border: 2px solid var(--md-sys-color-on-surface-variant);
    border-radius: 2px;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s ease;
}

.md-checkbox input:checked ~ .md-checkbox-box {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
}

.md-checkbox-checkmark {
    position: absolute;
    top: 2px;
    left: 5px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
}

.md-checkbox input:checked ~ .md-checkbox-box .md-checkbox-checkmark {
    transform: rotate(45deg) scale(1);
}

/* Modal exit animations */
.modal-content.modal-confirm-exit {
    animation: modalConfirmExit 0.2s ease forwards;
}

@keyframes modalConfirmExit {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.9);
        opacity: 0;
    }
}

.modal-content.modal-compact {
    max-width: 400px;
    padding: 20px;
}

.modal-header {
    margin-bottom: 16px;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--md-sys-color-on-surface);
    margin: 0;
}

.modal-body {
    margin-bottom: 20px;
}

.modal-message {
    font-size: 1rem;
    color: var(--md-sys-color-on-surface);
    margin: 0 0 8px 0;
}

.modal-submessage {
    font-size: 0.875rem;
    color: var(--md-sys-color-on-surface-variant);
    margin: 0;
    font-weight: 500;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

/* Material Design Buttons */
.md-button {
    padding: 10px 24px;
    border-radius: 20px;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: 'Roboto', sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

/* Ripple effect on button press */
.md-button:active {
    transform: scale(0.98);
}

.md-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    transform: translate(-50%, -50%);
    transition: width 0.4s ease, height 0.4s ease;
}

.md-button:active::after {
    width: 200px;
    height: 200px;
}

.md-button-text {
    background: transparent;
    color: var(--md-sys-color-primary);
}

.md-button-text:hover {
    background: rgba(187, 134, 252, 0.08);
}

.md-button-filled {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
    box-shadow: var(--md-sys-elevation-2);
}

.md-button-filled:hover {
    box-shadow: var(--md-sys-elevation-3);
}

.md-button-error {
    background: var(--md-sys-color-error);
    color: var(--md-sys-color-on-error);
}

.md-button-error:hover {
    background: #ef5350;
    box-shadow: var(--md-sys-elevation-3);
}