/* ============================================
   common.css — Общие стили для всего проекта
   ============================================ */

/* ---------- Сброс ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: #f5f7fa;
    min-height: 100vh;
}

/* ---------- Кнопки ---------- */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: #667eea;
    color: white;
}
.btn-primary:hover {
    background: #5a6fd6;
    transform: translateY(-1px);
}

.btn-success {
    background: #4CAF50;
    color: white;
}
.btn-success:hover {
    background: #388E3C;
    transform: translateY(-1px);
}

.btn-danger {
    background: #f44336;
    color: white;
}
.btn-danger:hover {
    background: #d32f2f;
    transform: translateY(-1px);
}

.btn-warning {
    background: #ff9800;
    color: white;
}
.btn-warning:hover {
    background: #f57c00;
    transform: translateY(-1px);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12px;
}

.btn-outline {
    background: transparent;
    border: 2px solid #ddd;
    color: #555;
}
.btn-outline:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

/* ---------- Модальные окна ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}
.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal .modal-header h3 {
    color: #333;
}
.modal .modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0 5px;
}
.modal .modal-close:hover {
    color: #333;
}

/* ---------- Формы ---------- */
.form-group {
    margin-bottom: 15px;
}
.form-group label {
    display: block;
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
    font-size: 14px;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: border-color 0.3s;
    outline: none;
    font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #667eea;
}
.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

/* ---------- Drop Zone ---------- */
.drop-zone {
    border: 3px dashed #ddd;
    border-radius: 10px;
    padding: 30px;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s;
    cursor: pointer;
    margin: 10px 0;
}
.drop-zone.dragover {
    border-color: #667eea;
    background: #f0f2ff;
}
.drop-zone .icon {
    font-size: 48px;
    display: block;
    margin-bottom: 10px;
}
.drop-zone .text {
    color: #888;
    font-size: 14px;
}
.drop-zone .text strong {
    color: #333;
}

/* ---------- Сообщения (Toasts) ---------- */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    animation: slideIn 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.toast.success {
    background: #4CAF50;
}
.toast.error {
    background: #f44336;
}
.toast.info {
    background: #2196F3;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ---------- Пустые состояния ---------- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}
.empty-state .icon {
    font-size: 64px;
    display: block;
    margin-bottom: 15px;
}
.empty-state h3 {
    color: #555;
    margin-bottom: 10px;
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-size: 18px;
}

/* ---------- Адаптивность ---------- */
@media (max-width: 600px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .modal {
        padding: 20px;
        margin: 10px;
    }
    .toast {
        bottom: 15px;
        right: 15px;
        left: 15px;
        padding: 12px 18px;
        font-size: 14px;
    }
}

/* ---------- Модалка для плеера ---------- */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}
.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal {
    background: white;
    border-radius: 16px;
    padding: 30px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.modal .modal-header h3 {
    color: #333;
    margin: 0;
}
.modal .modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    padding: 0 5px;
    line-height: 1;
}
.modal .modal-close:hover {
    color: #333;
}