/* ============================
   WAV → MP3 Converter - Premium Style
   ============================ */

:root {
    --bg-base: #000000;
    --bg-app: #0a0a0c;
    --bg-panel: rgba(20, 20, 25, 0.7);
    --bg-panel-hover: rgba(30, 30, 38, 0.8);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-highlight: rgba(255, 255, 255, 0.12);
    
    --text-primary: #ffffff;
    --text-secondary: #a0a0ab;
    --text-muted: #6b6b76;
    
    --accent-color: #0066ff;
    --accent-gradient: linear-gradient(135deg, #0066ff 0%, #00c3ff 100%);
    --accent-glow: rgba(0, 102, 255, 0.4);
    
    --success-color: #34c759;
    --success-gradient: linear-gradient(135deg, #34c759 0%, #30d158 100%);
    --danger-color: #ff453a;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 32px;
    
    --transition-fast: 0.15s cubic-bezier(0.2, 0.8, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* プレミアムな背景効果（アンビエントライティング） */
body::before, body::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    pointer-events: none;
}

body::before {
    top: -10vw;
    left: -10vw;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(0, 102, 255, 0.15) 0%, transparent 70%);
}

body::after {
    bottom: -10vw;
    right: -10vw;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(0, 195, 255, 0.1) 0%, transparent 70%);
}

.app-container {
    max-width: 780px;
    margin: 0 auto;
    padding: 60px 24px;
    position: relative;
    z-index: 1;
}

/* ========== GLASS PANEL BASE ========== */
.glass-panel {
    background: var(--bg-panel);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-top-color: var(--glass-highlight);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4), 
                inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

/* ========== HEADER ========== */
.app-header {
    text-align: center;
    margin-bottom: 48px;
    animation: slideDown 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

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

.logo {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}

.logo-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 12px 24px var(--accent-glow),
                inset 0 2px 4px rgba(255,255,255,0.4);
    position: relative;
}

.logo-icon::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    pointer-events: none;
}

.logo h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    /* Apple-like vibrant gradient */
    background: linear-gradient(120deg, #00c6ff 0%, #0072ff 50%, #b800ff 100%);
    color: transparent;
    -webkit-background-clip: text;
    background-clip: text;
}

.subtitle {
    font-size: 1.05rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: 0.01em;
}

/* ========== DROP ZONE ========== */
.drop-zone {
    border-radius: var(--radius-xl);
    padding: 60px 32px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-smooth);
    background: linear-gradient(180deg, rgba(30, 30, 38, 0.4) 0%, rgba(20, 20, 25, 0.8) 100%);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.drop-zone:hover,
.drop-zone.drag-over {
    border-color: rgba(0, 102, 255, 0.5);
    background: linear-gradient(180deg, rgba(30, 30, 38, 0.6) 0%, rgba(20, 20, 25, 0.9) 100%);
    box-shadow: 0 0 40px rgba(0, 102, 255, 0.15);
    transform: translateY(-2px);
}

.drop-zone-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.drop-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    margin-bottom: 24px;
    transition: all var(--transition-smooth);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.drop-zone:hover .drop-icon,
.drop-zone.drag-over .drop-icon {
    color: #fff;
    background: var(--accent-gradient);
    border-color: transparent;
    box-shadow: 0 12px 24px var(--accent-glow);
    transform: scale(1.05) translateY(-4px);
}

.drop-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.drop-subtext {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ========== BUTTONS ========== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    outline: none;
    text-decoration: none;
}

.btn-select {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    padding: 12px 28px;
    border-radius: 100px;
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.btn-select:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.02);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    transition: all var(--transition-fast);
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08);
}

.btn-sm {
    font-size: 0.8rem;
    padding: 6px 10px;
}

.btn-danger:hover {
    color: var(--danger-color);
    background: rgba(255, 69, 58, 0.15);
}

.btn-cancel {
    background: rgba(255, 69, 58, 0.1);
    color: var(--danger-color);
    border: 1px solid rgba(255, 69, 58, 0.2);
    padding: 10px 24px;
    border-radius: 100px;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.btn-cancel:hover {
    background: rgba(255, 69, 58, 0.2);
    border-color: rgba(255, 69, 58, 0.4);
    box-shadow: 0 0 16px rgba(255, 69, 58, 0.2);
    transform: scale(1.02);
}

@keyframes convertPulse {
    0% { box-shadow: 0 12px 24px var(--accent-glow), inset 0 2px 4px rgba(255, 255, 255, 0.3), 0 0 0 0 rgba(0, 102, 255, 0.4); }
    70% { box-shadow: 0 12px 24px var(--accent-glow), inset 0 2px 4px rgba(255, 255, 255, 0.3), 0 0 0 15px rgba(0, 102, 255, 0); }
    100% { box-shadow: 0 12px 24px var(--accent-glow), inset 0 2px 4px rgba(255, 255, 255, 0.3), 0 0 0 0 rgba(0, 102, 255, 0); }
}

.btn-convert {
    background: var(--accent-gradient);
    color: white;
    padding: 18px 48px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    width: 100%;
    box-shadow: 0 12px 24px var(--accent-glow),
                inset 0 2px 4px rgba(255, 255, 255, 0.3);
    position: relative;
    overflow: hidden;
    animation: convertPulse 2s infinite;
}

.btn-convert::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
    pointer-events: none;
}

.btn-convert:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 32px var(--accent-glow),
                inset 0 2px 4px rgba(255, 255, 255, 0.4);
    filter: brightness(1.1);
}

.btn-convert:active {
    transform: translateY(1px);
    box-shadow: 0 8px 16px var(--accent-glow);
}

.btn-convert:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    filter: grayscale(0.5);
    box-shadow: none;
    animation: none;
}

/* ========== TOOLTIP ========== */
.info-tooltip {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: help;
    transition: color var(--transition-fast);
}

.info-tooltip:hover {
    color: var(--accent-color);
}

.tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: 250px;
    background: rgba(15, 15, 20, 0.95);
    color: var(--text-primary);
    text-align: left;
    border-radius: var(--radius-md);
    padding: 16px;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    right: -10px;
    font-size: 0.85rem;
    line-height: 1.6;
    border: 1px solid var(--glass-border);
    box-shadow: 0 12px 32px rgba(0,0,0,0.6);
    transition: all var(--transition-fast);
    transform: translateY(10px);
    backdrop-filter: blur(10px);
    font-weight: 400;
    pointer-events: none;
}

.info-tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

/* ========== FILE LIST ========== */
.file-list-container {
    margin-top: 32px;
    animation: fadeUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

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

.file-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}

.file-list-header h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
}

.file-list {
    padding: 12px;
    min-height: 60px;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: grab;
    transition: all var(--transition-fast);
    border: 1px solid transparent;
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateX(4px);
}

.file-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
    background: rgba(0, 102, 255, 0.1);
}

.file-item.drag-over-item {
    border-color: var(--accent-color);
    background: rgba(0, 102, 255, 0.05);
}

.file-item-drag {
    color: var(--text-muted);
    cursor: grab;
    display: flex;
    align-items: center;
}

.file-item-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.1);
}

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

.file-item-name {
    font-size: 0.95rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-primary);
}

.file-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.file-item-remove {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}

.file-item-remove:hover {
    background: rgba(255, 69, 58, 0.2);
    color: var(--danger-color);
    transform: scale(1.1);
}

.file-summary {
    padding: 16px 24px;
    border-top: 1px solid var(--glass-border);
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.2);
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
}

/* ========== SETTINGS ========== */
.settings-container {
    margin-top: 24px;
    padding: 24px;
    animation: fadeUp 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.settings-container h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 20px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.setting-item label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.setting-item select,
.setting-item input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all var(--transition-smooth);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
}

.setting-item select:focus,
.setting-item input:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5),
                0 0 0 4px rgba(0, 102, 255, 0.2);
}

.setting-item select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a0a0ab' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.setting-item select option {
    background: #1a1a24;
    color: white;
}

/* ========== CONVERT SECTION ========== */
.convert-section {
    margin-top: 32px;
    animation: fadeUp 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

/* ========== PROGRESS ========== */
.progress-container {
    margin-top: 24px;
    padding: 32px;
    text-align: center;
    animation: fadeUp 0.5s ease both;
}

.progress-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
}

#progressText {
    font-size: 1.1rem;
    font-weight: 500;
}

#progressPercent {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1;
}

.progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 100px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.05);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 100px;
    transition: width 0.2s ease-out;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 1s infinite linear;
}

/* ========== RESULT ========== */
.result-container {
    margin-top: 24px;
    padding: 48px 32px;
    text-align: center;
    animation: fadeUp 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    border: 1px solid rgba(52, 199, 89, 0.3);
    background: radial-gradient(circle at top, rgba(52, 199, 89, 0.1) 0%, rgba(20, 20, 25, 0.8) 100%);
}

.result-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    box-shadow: 0 12px 24px rgba(52, 199, 89, 0.3),
                inset 0 2px 4px rgba(255规,255,255,0.4);
    animation: successPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.result-icon svg {
    width: 40px;
    height: 40px;
}

@keyframes successPop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.result-text {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.result-detail {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    padding: 12px 24px;
    background: rgba(0,0,0,0.3);
    border-radius: 100px;
    display: inline-block;
    border: 1px solid rgba(255,255,255,0.05);
}

.btn-download {
    background: var(--text-primary);
    color: var(--bg-base);
    padding: 16px 40px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 100px;
    box-shadow: 0 8px 16px rgba(255,255,255,0.1);
}

.btn-download:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 12px 24px rgba(255,255,255,0.2);
    background: #f0f0f0;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 600px) {
    .app-container {
        padding: 32px 16px;
    }

    .logo h1 {
        font-size: 1.8rem;
    }

    .drop-zone {
        padding: 40px 20px;
    }

    .file-item {
        padding: 12px;
        gap: 12px;
    }

    .result-container, 
    .progress-container,
    .settings-container {
        padding: 24px 16px;
    }
}
