/**
 * Audio Splitter - Tool Specific Styles
 * Base styles come from /src/styles/layouts/tool-layout.css
 */

/* ==================== FILE INFO CARD ==================== */
.file-info-card {
    margin-bottom: var(--space-4);
}

.file-info {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.file-info__icon {
    flex-shrink: 0;
    color: var(--color-text-muted);
}

.file-info__details {
    flex: 1;
    min-width: 0;
}

.file-info__name {
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-info__duration {
    font-size: var(--text-sm);
    font-family: var(--font-mono);
    color: var(--color-text-muted);
    margin: var(--space-1) 0 0;
}

/* ==================== WAVEFORM SECTION ==================== */
.waveform-section {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

/* Waveform */
.waveform-container {
    position: relative;
    height: 100px;
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
}

#waveform {
    width: 100%;
    height: 100%;
}

/* Playhead */
.waveform-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background: #ef4444;
    pointer-events: none;
    z-index: 10;
    transition: left 0.05s linear;
}

.waveform-playhead::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
}

.waveform-playhead::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 10px;
    background: #ef4444;
    border-radius: 50%;
}

/* Dragging state */
.waveform-container.dragging {
    cursor: grabbing;
}

.waveform-container.dragging .waveform-playhead {
    transition: none;
}

.split-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.split-marker {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(255, 255, 255, 0.4);
}

.split-marker::after {
    content: attr(data-index);
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    font-family: var(--font-mono);
}

/* Waveform Legend */
.waveform-legend {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-2) 0;
}

.waveform-legend__item {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.waveform-legend__line {
    width: 16px;
    height: 3px;
    border-radius: 2px;
}

.waveform-legend__line--red {
    background: #ef4444;
}

.waveform-legend__line--white {
    background: rgba(255, 255, 255, 0.4);
}

.waveform-legend__text {
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

/* Playback Controls */
.playback-controls {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
}

.playback-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-elevated);
    border: 1px solid var(--color-border-default);
    border-radius: 50%;
    color: var(--color-text-primary);
    transition: all var(--transition-fast);
}

.playback-btn:hover {
    background: var(--color-interactive-muted);
    border-color: var(--color-border-emphasis);
}

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

/* Time Display */
.playback-time {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
    font-family: var(--font-mono);
}

.playback-time__current {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: var(--font-bold);
    color: #ef4444;
    letter-spacing: -0.02em;
}

.playback-time__separator {
    font-size: var(--text-lg);
    color: var(--color-text-muted);
}

.playback-time__total {
    font-size: var(--text-lg);
    color: var(--color-text-secondary);
}

/* File Icon */
.file-icon {
    color: var(--color-text-muted);
    flex-shrink: 0;
}

/* Progress Section */
.progress-section {
    padding: var(--space-4);
    background: var(--color-bg-surface);
    border: 1px solid var(--color-border-default);
    border-radius: var(--radius-lg);
    animation: fadeIn 0.2s ease;
}

.progress-header {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-3);
}

.progress-label {
    flex: 1;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
}

.progress-value {
    font-size: var(--text-sm);
    font-family: var(--font-mono);
    color: var(--color-text-secondary);
}

.progress-section .progress-bar {
    height: 4px;
    background: var(--color-bg-overlay);
    border-radius: 2px;
    overflow: hidden;
}

.progress-section .progress-fill {
    height: 100%;
    background: var(--color-text-primary);
    width: 0%;
    transition: width 0.15s ease;
}

.progress-detail {
    margin-top: var(--space-2);
    font-size: var(--text-xs);
    color: var(--color-text-muted);
}

.progress-detail:empty {
    display: none;
}

/* Upload Content Centering */
.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

/* Upload Loading State */
.drop-zone.loading {
    pointer-events: none;
}

.drop-zone.loading .upload-content {
    opacity: 0;
}

.upload-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-4);
}

/* Privacy Notice Override for Tool Pages */
.privacy-notice {
    max-width: 800px;
}

/* Tool Content */
.tool-content {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeIn 0.3s ease;
}

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

/* ==================== OPTIONS CARD ==================== */
.options-card {
    margin-bottom: var(--space-4);
}

/* ==================== FORM ELEMENTS ==================== */
.form-group {
    margin-bottom: var(--space-4);
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-text-primary);
    margin-bottom: var(--space-2);
}

.form-helper {
    display: block;
    font-size: var(--text-xs);
    color: var(--color-text-muted);
    margin-top: var(--space-2);
}

/* ==================== INPUT STEPPER ==================== */
.input-stepper {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    max-width: 200px;
}

.input-stepper__btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg-tertiary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    color: var(--color-text-primary);
    font-size: var(--text-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.input-stepper__btn:hover {
    background: var(--color-bg-hover);
    border-color: var(--color-border-light);
}

.input-stepper__btn:active {
    transform: scale(0.95);
}

.input-stepper__input {
    width: 80px;
    text-align: center;
    font-family: var(--font-mono);
}

/* ==================== BUTTON VARIATIONS ==================== */
.btn--lg {
    padding: var(--space-4) var(--space-6);
    font-size: var(--text-base);
}

.btn--full {
    width: 100%;
}

.btn--icon {
    padding: var(--space-2);
}

/* ==================== HIDDEN STATE ==================== */
.drop-zone__input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
}

/* ==================== UTILITY CLASSES ==================== */
.font-medium { font-weight: var(--font-medium); }
.text-md { font-size: var(--text-md); }
.mono { font-family: var(--font-mono); }
.mb-4 { margin-bottom: var(--space-4); }
.mt-4 { margin-top: var(--space-4); }
.m-0 { margin: 0; }
