/* Ringtone Maker Styles - Replaced Tailwind */

/* Variables */
:root {
    --primary-color: #42b983;
    --primary-hover: #3aa876;
    --secondary-color: #3b82f6;
    --text-color: #374151;
    --bg-color: #f9fafb;
    --border-color: #e5e7eb;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
}

/* Container */
.maker-container {
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    overflow: hidden;
    margin-bottom: 30px;
}

/* Header */
.maker-header {
    background: linear-gradient(135deg, #42b983 0%, #349b6d 100%);
    padding: 24px;
    text-align: center;
    color: #fff;
}

.maker-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.maker-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

/* Content */
.maker-content {
    padding: 24px;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.15);
}

.btn-primary {
    background: linear-gradient(to right, #3b82f6, #2563eb);
}

.btn-primary:hover {
    background: linear-gradient(to right, #2563eb, #1d4ed8);
}

.btn-success {
    background: linear-gradient(to right, #10b981, #059669);
}

.btn-success:hover {
    background: linear-gradient(to right, #059669, #047857);
}

.btn-purple {
    background: linear-gradient(to right, #8b5cf6, #7c3aed);
}

.btn-purple:hover {
    background: linear-gradient(to right, #7c3aed, #6d28d9);
}

.btn-pink {
    background: linear-gradient(to right, #ec4899, #db2777);
}

.btn-pink:hover {
    background: linear-gradient(to right, #db2777, #be185d);
}

/* URL Input */
.url-input-container {
    margin-bottom: 20px;
}

.input-group {
    display: flex;
    gap: 10px;
}

.form-control {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
    width: 100%;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-load {
    flex: 0 0 auto;
    padding: 10px 24px;
}

/* Info Card */
.info-card {
    background-color: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-color);
}

/* Waveform */
.waveform-container {
    margin-bottom: 24px;
}

.waveform-box {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    background-color: #fff;
    min-height: 128px;
}

/* Control Bar */
.control-bar {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 16px;
}

.btn-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.btn-play {
    width: 56px;
    height: 56px;
    font-size: 20px;
    background-color: var(--primary-color);
}

.btn-play:hover {
    background-color: var(--primary-hover);
    transform: scale(1.05);
}

.btn-stop {
    width: 48px;
    height: 48px;
    font-size: 16px;
    background-color: #4b5563;
}

.btn-stop:hover {
    background-color: #374151;
    transform: scale(1.05);
}

/* Selection Info */
.selection-info {
    background-color: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    margin-top: 16px;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.label {
    color: #6b7280;
}

.value {
    font-weight: 600;
}

.text-primary { color: var(--secondary-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }

/* Settings */
.fade-settings {
    margin-bottom: 24px;
}

.section-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.setting-item {
    background-color: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
}

.setting-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #4b5563;
    margin-bottom: 8px;
}

/* Export Buttons */
.export-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 30px;
}

/* Instructions */
.instructions-card {
    background-color: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    padding: 16px;
}

.card-title {
    font-weight: 600;
    color: #92400e;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}

.card-list {
    list-style-type: disc;
    list-style-position: inside;
    font-size: 14px;
    color: #b45309;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Utilities */
.hidden { display: none !important; }
.mr-1 { margin-right: 4px; }
.mr-2 { margin-right: 8px; }

/* Responsive */
@media (max-width: 640px) {
    .button-group {
        flex-direction: column;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
    }
    
    .settings-grid {
        grid-template-columns: 1fr;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .maker-header {
        padding: 16px;
    }
    
    .maker-title {
        font-size: 20px;
    }
}

/* WaveSurfer Shadow DOM Styles (Overwrites) */
#waveform ::part(region-handle) {
    background-color: var(--primary-color) !important;
}

#waveform ::part(region-handle):hover {
    background-color: var(--primary-hover) !important;
    box-shadow: 0 0 8px rgba(66, 185, 131, 0.6) !important;
}

#waveform ::part(region-content) {
    background-color: rgba(66, 185, 131, 0.2) !important;
}

/* Loading State Styles */
.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 128px;
}

.loading-content {
    text-align: center;
}

.spinner {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid rgba(59, 130, 246, 0.1);
    border-left-color: var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: #6b7280;
    font-size: 14px;
}

/* Audio Info Styles */
.audio-detail {
    display: flex;
    align-items: center;
    gap: 12px;
}

.audio-cover {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    object-fit: cover;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.audio-meta {
    flex: 1;
    min-width: 0;
}

.audio-title {
    display: block;
    color: var(--text-color);
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-decoration: none;
    margin-bottom: 4px;
}

.audio-title:hover {
    color: var(--secondary-color);
}

.audio-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
}

.audio-simple-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.file-name-wrapper {
    color: var(--text-color);
    display: flex;
    align-items: center;
}

.icon-audio {
    color: var(--secondary-color);
    margin-right: 6px;
}

.file-name {
    font-weight: 500;
}

.duration-wrapper {
    color: #6b7280;
}
