/* 
 * Android Intent Jump Helper - Modern Responsive Stylesheet
 */

:root {
    --primary: #10b981;
    --primary-hover: #059669;
    --primary-light: #ecfdf5;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-hover: #cbd5e1;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #10b981;
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -1px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

body {
    font-family: var(--font-sans);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 90px;
}

/* Container */
.app-container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 16px;
}

/* Header */
.app-header {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 32px;
    background: #e6fcf5;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
}

.logo-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.logo-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
}

.env-badge-group {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.env-tag {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.tag-green { background: #dcfce7; color: #15803d; }
.tag-blue { background: #dbeafe; color: #1d4ed8; }
.tag-orange { background: #ffedd5; color: #c2410c; }

.env-details-text {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
}

.env-alert {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    background: #fffbeb;
    border-left: 4px solid var(--warning);
    color: #92400e;
    font-size: 13px;
    line-height: 1.5;
}

/* Nav Tabs */
.nav-tab-bar {
    display: flex;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 4px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.nav-tab-bar::-webkit-scrollbar { display: none; }

.nav-tab {
    flex: 1;
    min-width: 130px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}

.nav-tab:hover {
    color: var(--text-primary);
    background: #f1f5f9;
}

.nav-tab.active {
    background: var(--primary);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

/* Tab Content Visibility */
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Section Header */
.section-header {
    margin-bottom: 16px;
}
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Presets Tab Styles */
.preset-filter-bar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.search-input-wrap {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: 14px;
    background: var(--bg-card);
    outline: none;
    transition: border-color 0.2s;
}

.search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: var(--text-muted);
}

.category-pill-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.category-pill-list::-webkit-scrollbar { display: none; }

.cat-pill {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.cat-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.cat-pill.active {
    background: var(--accent);
    color: #ffffff;
    border-color: var(--accent);
}

/* Preset Grid */
.preset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 16px;
}

.preset-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    padding: 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: transform 0.15s, box-shadow 0.15s;
}

.preset-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-hover);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.card-icon {
    font-size: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: #f1f5f9;
}

.card-title-group {
    flex: 1;
    overflow: hidden;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
}
.badge-scheme { background: #e0f2fe; color: #0369a1; }
.badge-intent { background: #fef3c7; color: #b45309; }

.card-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
    min-height: 34px;
}

.card-code-box {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    cursor: pointer;
    margin-bottom: 8px;
}

.card-code-box code {
    font-family: var(--font-mono);
    font-size: 11px;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-copy-mini {
    background: none;
    border: none;
    font-size: 12px;
    cursor: pointer;
    opacity: 0.6;
}
.btn-copy-mini:hover { opacity: 1; }

.card-package {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-package code {
    font-family: var(--font-mono);
    color: #475569;
}

.card-actions {
    display: flex;
    gap: 6px;
    margin-top: auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}
.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-primary);
    border-color: var(--border);
}
.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-icon {
    padding: 8px 10px;
    background: #f8fafc;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}
.btn-icon:hover {
    background: #f1f5f9;
    color: var(--text-primary);
}

.btn-jump {
    flex: 1;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 12px;
}

/* Custom Tester Card */
.test-panel {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-size: 14px;
    background: #ffffff;
    outline: none;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

textarea.form-control {
    font-family: var(--font-mono);
    font-size: 13px;
    min-height: 90px;
    resize: vertical;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 640px) {
    .form-row {
        grid-template-columns: 1fr;
    }
}

.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

.action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 700;
}

/* Intent Builder */
.builder-layout {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 20px;
}

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

.builder-box {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.tpl-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.extra-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    align-items: center;
}

.preview-box {
    display: block;
    background: #0f172a;
    color: #38bdf8;
    padding: 14px;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 12px;
    word-break: break-all;
    white-space: pre-wrap;
    max-height: 180px;
    overflow-y: auto;
}

/* Cheatsheet Guide */
.guide-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.guide-card h3 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.code-snippet {
    background: #0f172a;
    color: #e2e8f0;
    padding: 16px;
    border-radius: var(--radius-md);
    font-family: var(--font-mono);
    font-size: 12.5px;
    line-height: 1.6;
    overflow-x: auto;
    position: relative;
    margin-bottom: 14px;
}

/* History and Bookmark items */
.history-item, .bookmark-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.history-info, .bm-info {
    flex: 1;
    overflow: hidden;
}

.history-name, .bm-name {
    font-size: 14px;
    font-weight: 600;
    display: block;
    color: var(--text-primary);
}

.history-time {
    font-size: 11px;
    color: var(--text-muted);
}

.history-uri, .bm-uri {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.history-actions, .bm-actions {
    display: flex;
    gap: 6px;
}

/* Log Console */
.log-console-wrap {
    background: #0f172a;
    border-radius: var(--radius-lg);
    padding: 16px;
    margin-top: 24px;
    color: #e2e8f0;
    box-shadow: var(--shadow-md);
}

.log-console-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #1e293b;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

.log-console-title {
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #38bdf8;
}

.log-container {
    max-height: 220px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 12px;
}

.log-line {
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    line-height: 1.4;
}

.log-time {
    color: #64748b;
    margin-right: 6px;
}

.log-badge {
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 700;
    margin-right: 6px;
}
.badge-jump { background: #3b82f6; color: #fff; }
.badge-success { background: #10b981; color: #fff; }
.badge-warn { background: #f59e0b; color: #fff; }
.badge-error { background: #ef4444; color: #fff; }
.badge-fallback { background: #8b5cf6; color: #fff; }

.log-detail {
    background: rgba(0,0,0,0.3);
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 4px;
    font-size: 11px;
    color: #94a3b8;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 16px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.15s ease-out;
}

.modal-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 460px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-muted);
    cursor: pointer;
}

.qr-code-box {
    display: flex;
    justify-content: center;
    margin: 16px 0;
    min-height: 220px;
    align-items: center;
}

/* Toast */
.app-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(60px);
    background: #1e293b;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2000;
}

.app-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-warning { background: #d97706; }
.toast-info { background: #1e293b; }

.empty-state {
    text-align: center;
    padding: 36px 16px;
    color: var(--text-muted);
    font-size: 14px;
}
.empty-state small {
    display: block;
    margin-top: 6px;
    font-size: 12px;
}

.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

/* Quick Settings Shortcut Bar */
.quick-settings-panel {
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    border: 1px solid #bbf7d0;
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.qs-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.qs-title {
    font-size: 15px;
    font-weight: 700;
    color: #166534;
    display: flex;
    align-items: center;
    gap: 6px;
}

.qs-tip {
    font-size: 12px;
    color: #1e3a8a;
    background: rgba(255, 255, 255, 0.7);
    padding: 4px 10px;
    border-radius: 20px;
}

.qs-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-qs {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-primary);
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.btn-qs:hover {
    border-color: var(--primary);
    color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-qs-highlight {
    background: #10b981;
    color: #ffffff;
    border-color: #10b981;
}

.btn-qs-highlight:hover {
    background: #059669;
    color: #ffffff;
}
