/* Island Media Server - Стили */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    padding: 40px;
}

h1 {
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

h1 a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

h1 a:hover {
    color: #667eea;
}

/* Вкладки */
.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 12px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
}

.tab-btn.disabled {
    cursor: not-allowed;
    color: #ccc;
    opacity: 0.5;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Формы */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="file"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Кнопки */
.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.btn-group .btn {
    flex: 1;
}

.logout-btn {
    background: #ff6b6b;
    color: white;
}

.logout-btn:hover {
    background: #ff5252;
}

.small-btn {
    padding: 4px 8px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-left: 10px;
    font-size: 12px;
}

.small-btn-primary { background: #667eea; }
.small-btn-warning { background: #ffa500; }

.btn-remove {
    padding: 4px 8px;
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Сообщения */
.message {
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: none !important;
    visibility: hidden;
    opacity: 0;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block !important;
    visibility: visible;
    opacity: 1;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block !important;
    visibility: visible;
    opacity: 1;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block !important;
    visibility: visible;
    opacity: 1;
}

/* Авторизация */
.auth-info {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.auth-success {
    background: #e8f5e9;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #51cf66;
}

.auth-success p {
    color: #2e7d32;
    margin: 0;
    font-weight: 600;
}

.token-code {
    display: block;
    background: #f5f5f5;
    padding: 12px;
    border-radius: 4px;
    margin: 10px 0;
    word-break: break-all;
    font-size: 12px;
    border: 1px solid #ddd;
}

.registration-disabled {
    display: none;
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #f5c6cb;
}

.password-hint {
    color: #999;
    display: block;
    margin-top: 5px;
}

.password-strength {
    margin-top: 8px;
    height: 4px;
    background: #eee;
    border-radius: 2px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0%;
    background: #ccc;
    transition: all 0.3s ease;
}

.password-strength.weak .password-strength-bar {
    width: 33%;
    background: #ff6b6b;
}

.password-strength.medium .password-strength-bar {
    width: 66%;
    background: #ffa500;
}

.password-strength.strong .password-strength-bar {
    width: 100%;
    background: #51cf66;
}

.text-center {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.link {
    color: #667eea;
    text-decoration: none;
}

/* Загрузка файлов */
.upload-area {
    border: 2px dashed #667eea;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-area:hover {
    border-color: #764ba2;
    background: rgba(102, 126, 234, 0.05);
}

.upload-area.dragover {
    border-color: #764ba2;
    background: rgba(102, 126, 234, 0.1);
}

.upload-area p {
    color: #666;
    margin-bottom: 10px;
}

.upload-area small {
    color: #999;
}

.file-input-hidden {
    display: none;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: #eee;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.upload-progress {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.upload-progress-text {
    margin-bottom: 10px;
}

/* Коллекции */
.collection-form {
    display: none;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.collection-form h3 {
    margin-bottom: 15px;
}

.collection-view {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.collection-view h3 {
    margin-bottom: 15px;
}

.collection-item {
    padding: 10px;
    background: white;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-list-item {
    padding: 10px;
    background: white;
    border-radius: 4px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.media-list {
    display: none;
}

.media-list.active {
    display: block;
}

.media-item {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 15px;
}

.media-info {
    flex: 1;
}

.media-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.media-meta {
    font-size: 12px;
    color: #999;
}

.media-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.action-btn {
    padding: 8px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: #764ba2;
}

.action-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.action-btn.danger {
    background: #ff6b6b;
}

.action-btn.danger:hover {
    background: #ff5252;
}

.empty-state {
    text-align: center;
    color: #999;
    padding: 40px 20px;
}

/* Статусы */
.status-badge {
    font-size: 12px;
    margin-left: 10px;
}

.status-processing { color: #ffa500; }
.status-failed { color: #ff6b6b; }
.status-completed { color: #51cf66; }

.conversion-hint {
    color: #ffa500;
    font-size: 11px;
    margin-top: 3px;
}

/* Сортировка */
.sortable-list {
    min-height: 50px;
}

.sortable-item {
    cursor: move;
    user-select: none;
}

.sortable-item .drag-handle {
    margin-right: 10px;
    color: #999;
    cursor: grab;
}

.sortable-item .item-name {
    flex: 1;
}

/* Адаптивность */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 20px;
        border-radius: 10px;
    }

    h1 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .tabs {
        flex-wrap: wrap;
        gap: 5px;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 14px;
        flex: 1;
        min-width: 100px;
    }

    .media-item {
        flex-direction: column;
        gap: 10px;
    }

    .media-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .action-btn {
        flex: 1;
        min-width: 80px;
    }
}
