:root {
    --primary-color: #4361ee;
    --primary-dark: #3a56d4;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --text-color: #2b2d42;
    --light-text: #8d99ae;
    --bg-color: #f8f9fa;
    --card-color: #ffffff;
    --border-color: #e9ecef;
    --success-color: #4cc9f0;
    --error-color: #f72585;
    --warning-color: #f8961e;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 8px 15px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.app-container {
    display: grid;
    grid-template-rows: auto 1fr;
    min-height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.app-nav {
    display: flex;
    gap: 25px;
}

.nav-link {
    text-decoration: none;
    color: var(--light-text);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
}

.app-main {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 30px;
    padding-bottom: 40px;
}

.converter-card, .preview-card {
    background-color: var(--card-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.converter-card:hover, .preview-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.card-header {
    padding: 18px 25px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-actions {
    display: flex;
    gap: 10px;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--light-text);
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.icon-btn:hover {
    background-color: var(--bg-color);
    color: var(--primary-color);
}

.card-body {
    padding: 25px;
}

.input-group, .slider-group {
    margin-bottom: 20px;
}

.input-group label, .slider-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    background-color: var(--card-color);
    transition: border-color 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' 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 10px center;
    background-size: 16px;
}

.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.slider-group {
    position: relative;
}

.value-badge {
    background-color: var(--bg-color);
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: auto;
}

.form-slider {
    width: 100%;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-color);
    border-radius: 3px;
    margin-top: 10px;
}

.form-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
}

.form-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

.text-editor {
    margin-top: 30px;
    position: relative;
}

.text-editor textarea {
    width: 100%;
    height: 200px;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    resize: none;
    transition: border-color 0.2s;
}

.text-editor textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(67, 97, 238, 0.2);
}

.text-counter {
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 0.8rem;
    color: var(--light-text);
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 10px;
}

.card-footer {
    padding: 20px 25px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.player-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.control-btn.primary {
    background-color: var(--primary-color);
    color: white;
}

.control-btn.primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-1px);
}

.control-btn.secondary {
    background-color: var(--bg-color);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
}

.control-btn.secondary:hover {
    background-color: #e9ecef;
}

.control-btn.download {
    background-color: var(--accent-color);
    color: white;
}

.control-btn.download:hover {
    background-color: #3d86d6;
    transform: translateY(-1px);
}

.preview-card .card-body {
    height: calc(100% - 60px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.waveform-placeholder {
    text-align: center;
    width: 100%;
}

.waveform-animation {
    width: 100%;
    height: 100px;
    background: linear-gradient(90deg, var(--bg-color) 0%, var(--border-color) 50%, var(--bg-color) 100%);
    background-size: 200% 100%;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    animation: shimmer 2s infinite linear;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.preview-text {
    color: var(--light-text);
    font-size: 0.9rem;
}

.notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: var(--primary-color);
    color: white;
    padding: 15px 25px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
    display: none;
    z-index: 1000;
    animation: slideIn 0.3s forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.notification.hide {
    animation: slideOut 0.3s forwards;
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.notification.success {
    background-color: var(--success-color);
}

.notification.error {
    background-color: var(--error-color);
}

.notification.warning {
    background-color: var(--warning-color);
}

@media (max-width: 768px) {
    .app-main {
        grid-template-columns: 1fr;
    }
    
    .app-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .app-nav {
        width: 100%;
        justify-content: space-around;
    }
}

@media (max-width: 480px) {
    .card-footer {
        flex-direction: column;
        gap: 15px;
    }
    
    .player-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .control-btn.primary, .control-btn.download {
        width: 100%;
        justify-content: center;
    }
}