/* ============================================
   OUDIFY — Practice Tools Page Styles
   ============================================ */

.tools-page {
    max-width: var(--content-max-width);
}

/* --- Tool Section (shared) --- */
.tool-section {
    padding: var(--space-6);
    margin-bottom: var(--space-6);
    border-radius: var(--radius-lg);
}

.tool-section__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.tool-section__title {
    font-size: var(--text-lg);
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.tool-section__desc {
    font-size: var(--text-sm);
    color: var(--text-muted);
    margin-bottom: var(--space-5);
}

.tool-status {
    font-size: var(--text-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
}

.tool-status.active {
    color: var(--success);
    background: rgba(74, 222, 128, 0.08);
    border-color: rgba(74, 222, 128, 0.2);
}

/* --- Drone Perde Grid --- */
.drone-perde-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: var(--space-2);
    margin-bottom: var(--space-5);
}

.drone-perde-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: var(--space-3) var(--space-2);
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.drone-perde-btn:hover {
    background: rgba(212, 165, 116, 0.08);
    border-color: var(--border-glass-accent);
}

.drone-perde-btn.active {
    background: rgba(212, 165, 116, 0.12);
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

.drone-perde-btn__name {
    font-family: var(--font-display);
    font-size: var(--text-sm);
    font-weight: 500;
    font-style: italic;
}

.drone-perde-btn__freq {
    font-family: var(--font-mono);
    font-size: 9px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* --- Drone Controls --- */
.drone-controls {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    flex-wrap: wrap;
}

.drone-toggle,
.usul-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: var(--text-sm);
}

.drone-volume {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex: 1;
    min-width: 120px;
}

.range-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 8px var(--accent-glow);
}

.range-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
}

/* --- Usul Searchable Dropdown --- */
.usul-search-wrap {
    position: relative;
    margin-bottom: var(--space-5);
}

.usul-search-selected {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    font-size: var(--text-base);
    transition: border-color 0.15s;
}

.usul-search-selected:hover {
    border-color: var(--border-glass-accent);
}

.usul-search-selected__name {
    font-family: var(--font-display);
    font-weight: 600;
    font-style: italic;
    flex: 1;
    text-align: left;
}

.usul-search-selected__time {
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.usul-search-chevron {
    opacity: 0.4;
    transition: transform 0.2s;
}

.usul-search-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 20;
    background: var(--bg-card, rgba(25, 25, 30, 0.98));
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.usul-search-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: none;
    border-bottom: 1px solid var(--border-glass);
    background: transparent;
    color: var(--text-primary);
    font-size: var(--text-sm);
    font-family: inherit;
    outline: none;
}

.usul-search-input::placeholder {
    color: var(--text-muted);
}

.usul-search-list {
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.usul-search-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-2) var(--space-4);
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: inherit;
    font-size: var(--text-sm);
    transition: background 0.1s;
    text-align: left;
}

.usul-search-item:hover {
    background: rgba(201, 168, 76, 0.06);
    color: var(--text-primary);
}

.usul-search-item--active {
    background: rgba(201, 168, 76, 0.1);
    color: var(--accent-primary);
}

.usul-search-item__name {
    flex: 1;
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 500;
}

.usul-search-item__time {
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-muted);
}

/* --- Usul Pattern Display --- */
.usul-pattern-display {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin-bottom: var(--space-4);
    padding: var(--space-4);
    background: rgba(0, 0, 0, 0.15);
    border-radius: var(--radius-md);
}

.usul-beat {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    font-size: var(--text-xs);
    font-weight: 600;
    transition: all 0.1s ease;
    border: 1px solid transparent;
}

.usul-beat.dum {
    background: rgba(212, 165, 116, 0.12);
    border-color: rgba(212, 165, 116, 0.2);
    color: var(--accent-primary);
}

.usul-beat.tek {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.08);
    color: var(--text-secondary);
}

.usul-beat.rest {
    color: var(--text-muted);
    opacity: 0.4;
}

/* Active beat highlight */
.usul-beat.active {
    transform: scale(1.15);
    box-shadow: 0 0 16px rgba(74, 222, 128, 0.3);
}

.usul-beat.active.dum {
    background: rgba(74, 222, 128, 0.2);
    border-color: rgba(74, 222, 128, 0.5);
    color: var(--success);
}

.usul-beat.active.tek {
    background: rgba(74, 222, 128, 0.12);
    border-color: rgba(74, 222, 128, 0.3);
    color: var(--success);
}

.usul-beat.active.rest {
    opacity: 0.8;
    border-color: rgba(74, 222, 128, 0.15);
}

.usul-desc {
    font-size: var(--text-xs);
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: var(--space-5);
}

/* --- Usul Controls --- */
.usul-controls {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    flex-wrap: wrap;
}

.bpm-control {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.bpm-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.bpm-btn:hover {
    background: rgba(212, 165, 116, 0.12);
    border-color: var(--border-glass-accent);
}

.bpm-value {
    font-family: var(--font-mono);
    font-size: var(--text-2xl);
    font-weight: 700;
    color: var(--accent-primary);
    min-width: 48px;
    text-align: center;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .drone-perde-grid {
        grid-template-columns: repeat(3, 1fr);
    }


    .drone-controls,
    .usul-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .bpm-control {
        justify-content: center;
    }
}

/* ============================================
   VOCAL TRAINER GAMIFICATION & UX Overrides
   ============================================ */

.vocal-results-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    background: var(--bg-card);
    border: 1px solid var(--border-glass-accent);
    border-radius: var(--radius-xl);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    text-align: center;
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    width: 100%;
}

@keyframes scaleIn {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.vocal-pulse-glow {
    animation: textPulseGlow 0.4s alternate infinite !important;
}

@keyframes textPulseGlow {
    0% {
        text-shadow: 0 0 10px rgba(74, 222, 128, 0.5);
        color: var(--success);
    }

    100% {
        text-shadow: 0 0 20px rgba(74, 222, 128, 1);
        color: #fff;
    }
}

.vocal-dizi__perde--active {
    box-shadow: 0 0 0 1px var(--accent-primary);
    animation: pulseBorder 2s infinite;
}

@keyframes pulseBorder {
    0% {
        box-shadow: 0 0 0 0 rgba(212, 165, 116, 0.4);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(212, 165, 116, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(212, 165, 116, 0);
    }
}

.vocal-dizi__perde--done {
    opacity: 0.8 !important;
    color: var(--success) !important;
}