/* Стили для страницы Web ADB */

.webadb-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* Connection Status */
.connection-status {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--secondary-color);
    animation: pulse 2s infinite;
}

.status-dot.connected {
    background: var(--success-color);
    animation: none;
}

.status-dot.error {
    background: var(--error-color);
    animation: none;
}

.status-text {
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Device Info */
.device-info {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}

.device-info h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.info-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.info-value {
    font-size: 1rem;
    color: var(--text-primary);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--border-color);
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.2s;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-content {
    display: none;
}

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

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: #f8fafc;
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-icon {
    font-size: 3rem;
}

.upload-progress {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    transition: width 0.3s;
    width: 0%;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.file-info {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
}

.file-info p {
    margin-bottom: 0.5rem;
}

/* Log Controls */
.log-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.log-output {
    background: #1e293b;
    color: #e2e8f0;
    border-radius: 8px;
    padding: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    max-height: 500px;
    overflow-y: auto;
    min-height: 200px;
}

.log-placeholder {
    color: #64748b;
    text-align: center;
    padding: 2rem;
}

.log-line {
    margin-bottom: 0.25rem;
    word-wrap: break-word;
}

.log-line.error {
    color: #f87171;
}

.log-line.warning {
    color: #fbbf24;
}

.log-line.info {
    color: #60a5fa;
}

.log-line.debug {
    color: #a78bfa;
}

/* App Controls */
.app-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.app-controls .input-text {
    flex: 1;
    min-width: 200px;
}

/* Toggle switch (system apps) */
.toggle-switch {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    user-select: none;
    cursor: pointer;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: #ffffff;
}

.toggle-switch input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.toggle-slider {
    width: 44px;
    height: 24px;
    border-radius: 999px;
    background: #cbd5e1;
    position: relative;
    transition: background 0.2s ease;
    flex: 0 0 auto;
}

.toggle-slider::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--primary-color);
}

.toggle-switch input:checked + .toggle-slider::after {
    transform: translateX(20px);
}

.toggle-label {
    font-size: 0.95rem;
    color: var(--text-primary);
    font-weight: 600;
}

.apps-list {
    display: grid;
    gap: 1rem;
}

.app-item {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.app-info {
    flex: 1;
    min-width: 200px;
}

.app-name {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.app-package {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.app-actions {
    display: flex;
    gap: 0.5rem;
}

.app-btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.placeholder-text {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Shell */
.shell-container {
    background: #1e293b;
    border-radius: 8px;
    padding: 1rem;
}

.shell-output {
    background: #0f172a;
    border-radius: 6px;
    padding: 1rem;
    min-height: 300px;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #e2e8f0;
    margin-bottom: 1rem;
}

.shell-prompt {
    color: #10b981;
    margin-right: 0.5rem;
}

.shell-line {
    margin-bottom: 0.5rem;
    word-wrap: break-word;
}

.shell-input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #0f172a;
    border-radius: 6px;
    padding: 0.75rem;
}

.shell-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    outline: none;
}

.shell-input::placeholder {
    color: #64748b;
}

.shell-input-container .shell-prompt {
    color: #10b981;
}

/* Responsive */
@media (max-width: 768px) {
    .connection-status {
        flex-direction: column;
        align-items: stretch;
    }

    .tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .tab-btn {
        white-space: nowrap;
    }

    .log-controls,
    .app-controls {
        flex-direction: column;
    }

    .app-controls .input-text,
    .app-controls .btn {
        width: 100%;
    }

    .app-item {
        flex-direction: column;
        align-items: stretch;
    }

    .app-actions {
        flex-direction: column;
    }

    .app-btn {
        width: 100%;
    }
}
