/* Web Downloader Styles */

.text-gradient-teal {
    background: var(--grad-teal);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: calc(var(--nav-height) + 2rem) 2rem 4rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    transition: var(--transition-smooth);
}

.back-link:hover {
    color: var(--accent-indigo);
    transform: translateX(-4px);
}

.back-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    transform: rotate(180deg);
}

.tool-grid-layout {
    display: grid;
    grid-template-columns: 1fr 1.8fr;
    gap: 2rem;
    margin-top: 1.5rem;
}

.tool-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Right panel - prevent overflow */
#panel-preview {
    overflow: hidden;
    min-width: 0;
}

@media (max-width: 992px) {
    .tool-grid-layout { grid-template-columns: 1fr; }
}

/* URL Input */
.url-input-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.url-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    padding: 0.7rem 1rem;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.25s ease;
}

.url-input:focus {
    border-color: var(--accent-indigo);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.url-input::placeholder { color: var(--text-muted); }

/* Status */
.status-area { margin-top: 0.75rem; }

.status-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    background: rgba(99, 102, 241, 0.08);
    border: 1px solid rgba(99, 102, 241, 0.15);
    border-radius: 8px;
    font-size: 0.82rem;
    color: #a5b4fc;
}

.status-bar.error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

.status-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(99, 102, 241, 0.2);
    border-top-color: var(--accent-indigo);
    border-radius: 50%;
    animation: statusSpin 0.6s linear infinite;
    flex-shrink: 0;
}

@keyframes statusSpin { to { transform: rotate(360deg); } }

/* File info */
#file-info {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-sm);
    padding: 0.5rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--border-radius-sm);
}

.stat-lbl { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; white-space: nowrap; }
.stat-val { font-size: 0.8rem; color: var(--text-primary); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Resource list */
.settings-group { margin-top: 1.25rem; }

.settings-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.resource-list {
    margin-top: 0.5rem;
    max-height: 180px;
    overflow-y: auto;
}

.resource-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: default;
}

.resource-item:hover { background: rgba(255, 255, 255, 0.03); }

.resource-icon { width: 12px; height: 12px; flex-shrink: 0; }
.resource-icon.html { color: #e44d26; }
.resource-icon.css { color: #264de4; }
.resource-icon.js { color: #f7df1e; }

.resource-url { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resource-size { color: var(--text-muted); font-size: 0.7rem; flex-shrink: 0; }

/* Code preview */
.code-wrapper { margin-top: 0.5rem; }

.code-toolbar { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; }

.code-tabs { display: flex; gap: 0.25rem; }

.code-tab {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.code-tab:hover { background: rgba(255, 255, 255, 0.06); color: var(--text-primary); }
.code-tab.active { background: rgba(99, 102, 241, 0.12); border-color: var(--accent-indigo); color: var(--accent-indigo); }

.code-scroll {
    overflow: auto;
    max-height: 55vh;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--border-radius-sm);
}

.code-pre {
    margin: 0;
    padding: 1rem;
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    min-width: 0;
}

.code-content { color: #e2e8f0; white-space: pre; word-break: normal; tab-size: 4; min-width: 0; }

.code-tab .badge-count {
    font-size: 0.65rem;
    padding: 0.1rem 0.35rem;
    background: rgba(255, 255, 255, 0.08);
}

/* Buttons */
.panel-footer-actions { display: flex; gap: 0.75rem; margin-top: 1.25rem; }

.btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary {
    background: var(--grad-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-secondary);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-secondary:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary); }

/* Panel */
.panel-header { margin-bottom: 1rem; }

.panel-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.panel-title svg { width: 20px; height: 20px; flex-shrink: 0; }

.no-image-placeholder { text-align: center; padding: 3rem 1rem; color: var(--text-muted); }
.no-image-placeholder p { font-size: 0.9rem; }

.badge-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 100px;
    margin-left: 0.3rem;
    white-space: nowrap;
}

/* Mobile */
@media (max-width: 768px) {
    .tool-container {
        padding: calc(var(--nav-height) + 1rem) 1rem 3rem !important;
    }
    .tool-panel { padding: 1rem !important; }
    .url-input-row { flex-direction: column; }
    .btn { justify-content: center; }
    .panel-footer-actions { flex-direction: column !important; width: 100%; }
    .code-scroll { max-height: 40vh; }
    .code-pre { font-size: 0.7rem; padding: 0.75rem; }
    .code-tab { font-size: 0.7rem; padding: 0.25rem 0.5rem; }
    .resource-list { max-height: 120px; }
}