/**
 * LocalSend Transfer - 样式文件
 * WebRTC 点对点传输版本
 */

.localsend-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.localsend-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.localsend-header h2 {
    margin: 0;
    color: #333;
    font-size: 24px;
    font-weight: 700;
}

.device-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.device-name {
    font-weight: 600;
    color: #555;
}

.device-status {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ccc;
    display: inline-block;
}

.device-status.online {
    background: #4caf50;
    box-shadow: 0 0 8px #4caf50;
    animation: pulse 2s infinite;
}

.connection-type {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
    background: rgba(102, 126, 234, 0.1);
    padding: 4px 8px;
    border-radius: 4px;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 标签页 */
.localsend-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 4px;
}

.tab-btn {
    flex: 1;
    padding: 14px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    border-radius: 10px;
}

.tab-btn:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.tab-btn.active {
    color: #667eea;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tab-content {
    display: none;
    padding: 25px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tab-content.active {
    display: block;
}

/* 按钮 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}

.btn-secondary {
    background: #f5f5f5;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e8e8e8;
}

/* 文件选择 */
.file-selector {
    margin-bottom: 25px;
}

.file-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.file-item:hover {
    background: #e9ecef;
}

.file-item.received {
    background: #e8f5e9;
    border-color: #c8e6c9;
}

.file-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    margin: 0 15px;
    color: #666;
    font-size: 13px;
    white-space: nowrap;
}

.file-remove-btn {
    background: #ff5252;
    color: #fff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.file-remove-btn:hover {
    background: #ff1744;
    transform: scale(1.1);
}

/* 设备发现 */
.device-discovery {
    margin-bottom: 25px;
}

.device-discovery h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.devices-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.device-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.device-item:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: translateX(4px);
}

.device-item.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.device-icon {
    font-size: 32px;
    margin-right: 15px;
}

.device-details {
    flex: 1;
}

.device-details .device-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    display: block;
}

.device-type {
    font-size: 12px;
    color: #667eea;
    font-weight: 500;
}

.device-select-btn {
    padding: 8px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.device-select-btn:hover {
    transform: scale(1.05);
}

.no-devices {
    padding: 40px;
    text-align: center;
    color: #999;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 10px;
}

/* 传输操作 */
.transfer-actions {
    margin-top: 20px;
    text-align: center;
}

/* 进度条 */
.progress-container {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e0e0e0;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    width: 0%;
    border-radius: 5px;
}

.progress-text {
    text-align: center;
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

/* 接收设置 */
.receive-settings {
    margin-bottom: 25px;
}

.receive-settings h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.receive-settings label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.receive-settings input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #667eea;
}

.receive-status {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    color: #666;
    margin-top: 15px;
    font-weight: 500;
}

.receive-status.active {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    color: #667eea;
}

/* 传入文件 */
.incoming-transfer {
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(76, 175, 80, 0.1) 0%, rgba(129, 199, 132, 0.1) 100%);
    border-radius: 10px;
    border: 2px solid #4caf50;
}

.incoming-transfer h3 {
    margin: 0 0 15px 0;
    color: #2e7d32;
    font-size: 16px;
    font-weight: 600;
}

.incoming-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

/* 已接收文件 */
.received-files {
    margin-top: 25px;
}

.received-files h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.files-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* 传输日志 */
.transfer-log {
    margin-top: 20px;
    padding: 15px;
    background: #1a1a2e;
    border-radius: 10px;
    max-height: 200px;
    overflow-y: auto;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
}

.log-entry {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.log-entry:last-child {
    border-bottom: none;
}

.log-entry.log-info {
    color: #64b5f6;
}

.log-entry.log-success {
    color: #81c784;
}

.log-entry.log-error {
    color: #e57373;
}

.log-entry.log-warning {
    color: #ffb74d;
}

/* 响应式 */
@media (max-width: 768px) {
    .localsend-container {
        padding: 15px;
        border-radius: 12px;
    }

    .localsend-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .tab-btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    .device-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .device-select-btn {
        width: 100%;
    }

    .incoming-actions {
        flex-direction: column;
    }

    .incoming-actions .btn {
        width: 100%;
    }
}

/* 滚动条样式 */
.transfer-log::-webkit-scrollbar {
    width: 6px;
}

.transfer-log::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.transfer-log::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.transfer-log::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* 实时调试控制台 */
.debug-console {
    margin-top: 20px;
    background: #000;
    border: 2px solid #00ff00;
    border-radius: 10px;
    overflow: hidden;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.debug-console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: #1a1a1a;
    border-bottom: 1px solid #00ff00;
    color: #00ff00;
    font-weight: 600;
    font-size: 14px;
}

.debug-clear-btn {
    padding: 4px 12px;
    background: transparent;
    color: #00ff00;
    border: 1px solid #00ff00;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.debug-clear-btn:hover {
    background: #00ff00;
    color: #000;
}

.debug-console-content {
    height: 150px;
    overflow-y: auto;
    padding: 10px;
    color: #00ff00;
    font-size: 11px;
    line-height: 1.6;
}

.debug-log-entry {
    padding: 2px 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.debug-log-entry.warn {
    color: #ffcc00;
}

.debug-log-entry.error {
    color: #ff3333;
}

.debug-log-entry.success {
    color: #00ffcc;
}

.debug-console-content::-webkit-scrollbar {
    width: 8px;
}

.debug-console-content::-webkit-scrollbar-track {
    background: #0a0a0a;
}

.debug-console-content::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}

.debug-console-content::-webkit-scrollbar-thumb:hover {
    background: #00cc00;
}
