/* ============================================
   DEBUGLY - Unified Stylesheet
   ============================================ */

/* ============================================
   1. DESIGN TOKENS
   ============================================ */

:root {
    /* Typography System */
    --font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-family-mono: "SF Mono", "Consolas", "Monaco", "Liberation Mono", "Courier New", monospace;
    
    /* Spacing Scale */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 0.75rem;
    --space-lg: 1rem;
    --space-xl: 1.5rem;
    --space-2xl: 2rem;
    
    /* Border Radius Scale */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;
    
    /* Animation Timing */
    --transition-fast: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* Elevation System */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-focus: 0 0 0 3px rgba(0, 122, 255, 0.1);
    --shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.15);
    
    /* Light Theme Colors (Default) */
    --background-color: #f6f6f6;
    --container-background: #ffffff;
    --text-color: #1d1d1f;
    --text-color-secondary: #6e6e73;
    --text-color-tertiary: #8e8e93;
    --border-color: #e5e5e5;
    --accent-color: #007aff;
    --accent-secondary: #0056cc;
    --highlight-bg: #fef7e0;
    --exception-color: #d93025;
    --input-bg: #fafafa;
    --hover-bg: rgba(0, 0, 0, 0.02);
    --frame-hover-bg: #f0f0f0;
    --actions-bg: #e9e9e9;
    --analysis-bg: #f0f4f8;
    --analysis-border: #d0d7de;
    --summary-bg: #ffffff;
    --summary-border: #e1e8ed;
    --action-hover-bg: rgba(0, 0, 0, 0.1);
    
    /* Blog-specific colors (Light) */
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #8e8e93;
    --surface-secondary: #ffffff;
    --surface-tertiary: #f6f6f6;
    --accent-primary: #007aff;
}

/* Dark Theme Override */
[data-theme="dark"] {
    --background-color: #1a1a1a;
    --container-background: #2d2d2d;
    --text-color: #ffffff;
    --text-color-secondary: #a0a0a0;
    --text-color-tertiary: #6e6e73;
    --border-color: #404040;
    --accent-color: #0a84ff;
    --accent-secondary: #0056cc;
    --highlight-bg: #3d2f00;
    --exception-color: #ff453a;
    --input-bg: #1e1e1e;
    --hover-bg: rgba(255, 255, 255, 0.05);
    --frame-hover-bg: #3a3a3a;
    --actions-bg: #404040;
    --analysis-bg: #262626;
    --analysis-border: #404040;
    --summary-bg: #2d2d2d;
    --summary-border: #404040;
    --action-hover-bg: rgba(255, 255, 255, 0.1);
    
    /* Blog-specific colors (Dark) */
    --text-primary: #ffffff;
    --surface-secondary: #2d2d2d;
    --surface-tertiary: #3a3a3a;
    --accent-primary: #0a84ff;
}

/* System Dark Mode Preference */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --background-color: #1a1a1a;
        --container-background: #2d2d2d;
        --text-color: #ffffff;
        --text-color-secondary: #a0a0a0;
        --text-color-tertiary: #6e6e73;
        --border-color: #404040;
        --accent-color: #0a84ff;
        --accent-secondary: #0056cc;
        --highlight-bg: #3d2f00;
        --exception-color: #ff453a;
        --input-bg: #1e1e1e;
        --hover-bg: rgba(255, 255, 255, 0.05);
        --frame-hover-bg: #3a3a3a;
        --actions-bg: #404040;
        --analysis-bg: #262626;
        --analysis-border: #404040;
        --summary-bg: #2d2d2d;
        --summary-border: #404040;
        --action-hover-bg: rgba(255, 255, 255, 0.1);
        
        /* Blog-specific colors (Dark) */
        --text-primary: #ffffff;
        --surface-secondary: #2d2d2d;
        --surface-tertiary: #3a3a3a;
        --accent-primary: #0a84ff;
    }
}

/* ============================================
   2. BASE STYLES
   ============================================ */

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-sans);
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

/* ============================================
   3. LAYOUT COMPONENTS
   ============================================ */

.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.content-grid {
    display: flex;
    flex-grow: 1;
}

.panel {
    padding: var(--space-xl);
    overflow-y: auto;
}

/* Trace Analyzer specific layout */
.trace-analyzer-page .app-wrapper {
    height: 100vh;
}

.trace-analyzer-page .content-grid {
    overflow: hidden;
}

.trace-analyzer-page .panel {
    height: 100%;
}

.input-panel {
    width: 40%;
    background-color: var(--container-background);
    border-right: 1px solid var(--border-color);
    position: relative;
}

.output-panel {
    width: 60%;
}

.resizer {
    width: 5px;
    background-color: var(--border-color);
    cursor: col-resize;
    flex-shrink: 0;
    transition: background-color var(--transition-fast);
}

.resizer:hover {
    background-color: var(--accent-color);
}

/* ============================================
   4. TYPOGRAPHY
   ============================================ */

h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: var(--space-lg);
    color: var(--text-color-secondary);
}

/* ============================================
   5. COMPONENTS
   ============================================ */

/* === Input Panel Components === */
.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-lg);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.input-header h2 {
    margin-bottom: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.action-buttons {
    display: flex;
    gap: var(--space-sm);
}

.action-button {
    font-size: 0.8rem;
}

/* === Button Components === */
.btn-base {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-family: var(--font-family-sans);
    font-weight: 500;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background-color: var(--container-background);
    color: var(--text-color);
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    user-select: none;
}

.btn-base:hover {
    background-color: var(--hover-bg);
    border-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-base:focus {
    outline: none;
    box-shadow: var(--shadow-focus);
}

.btn-base svg {
    width: 14px;
    height: 14px;
    stroke: var(--text-color-secondary);
    transition: stroke var(--transition-fast);
}

.btn-base:hover svg {
    stroke: var(--accent-color);
}

/* === Form Components === */
#stackTraceInput {
    width: 100%;
    height: calc(100% - 80px);
    padding: var(--space-lg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    font-family: var(--font-family-mono);
    font-size: 0.9rem;
    line-height: 1.4;
    box-sizing: border-box;
    background-color: var(--input-bg);
    color: var(--text-color);
    resize: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

#stackTraceInput:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: var(--shadow-focus);
}

/* === Language Selector === */
.language-selector {
    display: flex;
    gap: var(--space-xs);
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xs);
}

.language-chip {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    padding: var(--space-xs) var(--space-md);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
    color: var(--text-color-secondary);
    user-select: none;
}

.language-chip:hover {
    background-color: var(--hover-bg);
    color: var(--text-color);
}

.language-chip.selected {
    background-color: var(--accent-color);
    color: white;
    font-weight: 600;
}

.language-chip.selected:hover {
    background-color: var(--accent-color);
    opacity: 0.9;
}

.language-chip[data-language="auto"] span::after {
    content: '';
}

.language-chip[data-language="auto"].detected::after {
    content: ' (' attr(data-detected) ')';
    font-weight: normal;
    opacity: 0.8;
}

/* === Stack Trace Components === */
#output {
    font-size: 0.8rem;
}

.placeholder-notice {
    margin-bottom: var(--space-lg);
    padding: var(--space-md) var(--space-lg);
    background-color: var(--analysis-bg);
    border: 1px solid var(--analysis-border);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
}

.placeholder-notice p {
    margin: 0;
    color: var(--text-color-secondary);
}

.placeholder-example {
    opacity: 0.8;
    position: relative;
    z-index: 1;
}

.placeholder-example::before {
    content: "EXAMPLE";
    position: absolute;
    top: -15px;
    right: var(--space-lg);
    background-color: var(--accent-color);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 10;
}

.stack-trace-tree .stack-trace-block {
    margin-bottom: var(--space-lg);
}

.exception-header {
    font-family: var(--font-family-mono);
    cursor: pointer;
    padding: var(--space-sm) 0;
    display: flex;
    align-items: flex-start;
    transition: background-color var(--transition-fast);
    border-radius: var(--radius-sm);
}

.exception-header:hover {
    background-color: var(--hover-bg);
}

.exception-header .icon {
    width: 16px;
    height: 16px;
    transition: transform var(--transition-fast);
    margin-right: var(--space-sm);
    margin-top: var(--space-xs);
}

.exception-copy-btn {
    background: none;
    border: none;
    padding: var(--space-xs);
    display: none;
    margin-left: var(--space-sm);
    border-radius: var(--radius-sm);
}

.exception-copy-btn:hover {
    background-color: var(--action-hover-bg);
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

.exception-header:hover .exception-copy-btn {
    display: flex;
}

.exception-content {
    flex: 1;
}

.exception-text {
    margin-bottom: var(--space-sm);
}

.stack-trace-block.collapsed > .exception-header .icon {
    transform: rotate(-90deg);
}

.exception-prefix {
    color: var(--text-color-secondary);
    font-weight: 600;
}

.exception-package {
    color: var(--exception-color);
    font-weight: normal;
}

.exception-name {
    color: var(--exception-color);
    font-weight: 600;
}

.exception-message {
    margin-left: var(--space-sm);
}

.stack-frame-container {
    padding-left: 24px;
    overflow: hidden;
}

.stack-trace-block.collapsed .stack-frame-container > *:not(:first-child) {
    display: none;
}

.stack-frame {
    font-family: var(--font-family-mono);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    margin-bottom: 2px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    white-space: nowrap;
    position: relative;
    transition: background-color var(--transition-fast);
}

.stack-frame:hover {
    background-color: var(--frame-hover-bg);
}

.stack-frame.project-code {
    background-color: var(--highlight-bg);
    font-weight: 500;
}

.stack-frame-details {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.package {
    color: var(--text-color-secondary);
}

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

.method {
    color: var(--accent-color);
}

.source-info {
    margin-left: var(--space-sm);
    color: var(--text-color-secondary);
}

.line-number {
    font-weight: 600;
}

.native-method {
    font-style: italic;
    color: var(--accent-color);
}

.summary-line {
    font-style: italic;
    color: var(--text-color-secondary);
    padding: var(--space-sm) var(--space-md);
}

.actions-toolbar {
    display: none;
    position: absolute;
    right: var(--space-sm);
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--actions-bg);
    border-radius: var(--radius-sm);
    padding: var(--space-xs);
    box-shadow: var(--shadow-sm);
}

.stack-frame:hover .actions-toolbar {
    display: flex;
}

.action-btn {
    background: none;
    border: none;
    padding: var(--space-xs);
}

.action-btn:hover {
    background-color: var(--action-hover-bg);
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

/* === Analysis Section === */
#analysis-output {
    margin-bottom: var(--space-2xl);
    padding: var(--space-xl);
    background-color: var(--analysis-bg);
    border-radius: var(--radius-lg);
    border: 1px solid var(--analysis-border);
}

#analysis-output h2 {
    margin-top: 0;
    color: var(--accent-color);
}

#analysis-output ul {
    padding-left: 20px;
    margin-bottom: 0;
}

#analysis-output a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: text-decoration var(--transition-fast);
}

#analysis-output a:hover {
    text-decoration: underline;
}

/* === Search Components === */
.search-chips {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.search-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    font-size: 0.75rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-xl);
    transition: all var(--transition-fast);
    font-family: var(--font-family-sans);
}

.search-chip svg {
    width: 12px;
    height: 12px;
}

.google-chip {
    background-color: #4285f4;
    color: white !important;
}

.google-chip:hover {
    background-color: #3367d6;
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.perplexity-chip {
    background-color: #21808d;
    color: white !important;
}

.perplexity-chip:hover {
    background-color: #175b64;
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

/* === Summary Components === */
.exception-summary {
    margin: var(--space-lg) 0;
    padding: var(--space-lg);
    background-color: var(--summary-bg);
    border-radius: var(--radius-md);
    border: 1px solid var(--summary-border);
}

.summary-item {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}

.exception-info {
    margin-bottom: var(--space-sm);
    font-family: var(--font-family-mono);
    font-size: 0.9rem;
}

.exception-info strong {
    color: var(--text-color);
}

.exception-main {
    margin-bottom: var(--space-xs);
}

.summary-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.message-text {
    color: var(--text-color);
    font-family: var(--font-family-mono);
}

/* === Copy Frame Button === */
.copy-frame-btn {
    font-size: 0.75rem;
    margin-top: var(--space-sm);
}

.copy-frame-btn svg {
    width: 12px;
    height: 12px;
}

/* === Frame Info === */
.frame-info {
    margin-top: var(--space-sm);
    margin-left: var(--space-lg);
    font-family: var(--font-family-mono);
    font-size: 0.8rem;
    color: var(--text-color-secondary);
    line-height: 1.4;
}

.frame-info .frame-location {
    display: block;
    margin-bottom: var(--space-xs);
}

.frame-info .source-info {
    color: var(--text-color-secondary);
    opacity: 0.8;
}

/* === Python-specific Styles === */
.file-path {
    font-family: var(--font-family-mono);
    font-size: 0.7rem;
    color: var(--text-color-secondary);
    margin-top: var(--space-xs);
    opacity: 0.7;
}

.code-context {
    font-family: var(--font-family-mono);
    font-size: 0.8rem;
    color: var(--text-color);
    background-color: var(--highlight-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--space-xs) var(--space-sm);
    margin-top: var(--space-xs);
    white-space: pre-wrap;
    overflow-x: auto;
}

/* === Language Detection Indicator === */
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.output-header h2 {
    margin: 0;
}

.language-indicator {
    margin-left: auto;
}

.input-header .language-indicator {
    margin: 0;
}

.language-badge {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 5;
}

.language-badge.unknown {
    background-color: var(--text-color-secondary);
}

.language-badge.placeholder-example {
    opacity: 0.6;
}

/* ============================================
   6. BLOG-SPECIFIC STYLES
   ============================================ */

/* === Blog Styles === */

.blog-post-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.blog-post {
    background: var(--surface-secondary);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.post-header {
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    display: block;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.post-category {
    background: var(--accent-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-weight: 500;
    font-size: 0.8rem;
}

.post-header h1 {
    margin: 0 0 1rem 0;
    font-size: 2.5rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.post-excerpt {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--surface-tertiary);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

.post-content {
    padding: 2rem;
    line-height: 1.7;
}

.post-content h2 {
    margin: 2rem 0 1rem 0;
    font-size: 1.8rem;
    color: var(--text-primary);
}

.post-content h3 {
    margin: 1.5rem 0 1rem 0;
    font-size: 1.4rem;
    color: var(--text-primary);
}

.post-content p {
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.post-content ul, .post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-content li {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.post-content pre {
    background: var(--surface-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

.post-content code {
    background: var(--surface-tertiary);
    color: var(--text-primary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
}

.post-content pre code {
    background: none;
    padding: 0;
}

.post-content blockquote {
    border-left: 4px solid var(--accent-primary);
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    background: var(--surface-tertiary);
    border-radius: 0 8px 8px 0;
}

.post-content blockquote p {
    margin: 0;
    font-style: italic;
}

.post-footer {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--surface-tertiary);
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.post-navigation .btn-base {
    flex: 1;
    text-align: center;
    text-decoration: none;
}

/* === Blog Listing Styles === */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* Sticky header for blog pages */
.sticky-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: var(--background-color);
}

.blog-header {
    text-align: center;
    margin-bottom: 3rem;
}

.blog-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.blog-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.blog-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
    align-items: start;
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.blog-post-card {
    background: var(--surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.blog-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-primary);
}

.blog-post-card h2 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
    line-height: 1.4;
}

.blog-post-card h2 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-post-card h2 a:hover {
    color: var(--accent-primary);
}

.blog-post-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.post-meta time {
    color: var(--text-secondary);
}

.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-section {
    background: var(--surface-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.sidebar-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.category-list {
    list-style: none;
    padding: 0;
}

.category-list li {
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-list a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.category-list a:hover,
.category-list a.active {
    color: var(--accent-primary);
}

.count {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-link {
    background: var(--surface-tertiary);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid var(--border-color);
    transition: all 0.2s ease;
}

.tag-link:hover {
    background: var(--accent-primary);
    color: white;
    border-color: var(--accent-primary);
}

.cta-button {
    background: var(--accent-primary) !important;
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    text-align: center;
    display: inline-block;
    transition: all 0.2s ease;
}

.cta-button:hover {
    background: var(--accent-secondary) !important;
    transform: translateY(-1px);
}

.loading-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.error-message h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* ============================================
   7. RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    /* Mobile Layout Variables */
    :root {
        --header-height: 50px;
        --input-height: 35vh;
        --output-height: 65vh;
    }
    
    /* Content Grid Mobile */
    .content-grid {
        flex-direction: column;
    }
    
    /* Trace Analyzer Mobile specific */
    .trace-analyzer-page .app-wrapper {
        height: 100vh;
        overflow: hidden;
    }
    
    .trace-analyzer-page .content-grid {
        height: calc(100vh - var(--header-height) - 20px);
    }
    
    /* Panel Mobile Layout */
    .input-panel {
        width: 100%;
        border-right: none;
        padding: var(--space-md) var(--space-md) var(--space-lg) var(--space-md);
    }
    
    .output-panel {
        width: 100%;
        padding: var(--space-md);
    }
    
    /* Trace Analyzer specific panel layout */
    .trace-analyzer-page .input-panel {
        height: var(--input-height);
        border-bottom: 1px solid var(--border-color);
        flex-shrink: 0;
        overflow: hidden;
    }
    
    .trace-analyzer-page .output-panel {
        height: var(--output-height);
        overflow-y: auto;
        flex-grow: 1;
    }
    
    /* Remove resizer on mobile */
    .resizer {
        display: none;
    }
    
    /* Input header adjustments */
    .input-header {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-xs);
        margin-bottom: var(--space-sm);
    }
    
    .input-header h2 {
        text-align: center;
        margin-bottom: var(--space-xs);
    }
    
    .header-right {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    /* Language selector adjustments */
    .language-selector {
        justify-content: center;
    }
    
    .language-chip {
        padding: var(--space-sm) var(--space-md);
        font-size: 0.8rem;
    }
    
    /* Action buttons stack on mobile */
    .action-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .action-button {
        font-size: 0.75rem;
        padding: var(--space-xs) var(--space-sm);
    }
    
    .action-button svg {
        width: 12px;
        height: 12px;
    }
    
    /* Textarea adjustments */
    #stackTraceInput {
        height: calc(100% - 90px);
        font-size: 0.8rem;
        padding: var(--space-lg);
        max-height: none;
        min-height: 120px;
    }
    
    /* Analysis section adjustments */
    #analysis-output {
        padding: var(--space-md);
        margin-bottom: var(--space-lg);
    }
    
    #analysis-output h2 {
        font-size: 1.1rem;
        margin-bottom: var(--space-md);
    }
    
    /* Exception summary responsive */
    .exception-summary {
        padding: var(--space-md);
    }
    
    .summary-item {
        margin-bottom: var(--space-md);
        padding-bottom: var(--space-md);
    }
    
    .exception-info {
        font-size: 0.8rem;
        word-break: break-word;
    }
    
    /* Search chips stack on mobile */
    .search-chips {
        flex-direction: column;
        gap: var(--space-xs);
    }
    
    .search-chip {
        justify-content: center;
        padding: var(--space-sm);
        font-size: 0.7rem;
    }
    
    /* Output section adjustments */
    .output-header {
        margin-bottom: var(--space-sm);
    }
    
    .output-header h2 {
        font-size: 1.1rem;
    }
    
    /* Stack trace adjustments for mobile */
    .stack-trace-tree {
        font-size: 0.75rem;
    }
    
    .exception-header {
        padding: var(--space-sm);
        flex-wrap: wrap;
    }
    
    .exception-content {
        min-width: 0;
    }
    
    .exception-text {
        word-break: break-word;
        line-height: 1.3;
    }
    
    .stack-frame {
        padding: var(--space-xs) var(--space-sm);
        flex-direction: column;
        align-items: flex-start;
        white-space: normal;
        word-break: break-word;
    }
    
    .stack-frame-details {
        white-space: normal;
        word-break: break-word;
        width: 100%;
        margin-bottom: var(--space-xs);
    }
    
    .actions-toolbar {
        position: static;
        transform: none;
        margin-top: var(--space-xs);
        align-self: flex-end;
    }
    
    .stack-frame:hover .actions-toolbar {
        display: flex;
    }
    
    /* Frame info adjustments */
    .frame-info {
        margin-left: 0;
        font-size: 0.7rem;
    }
    
    /* Code context responsive */
    .code-context {
        font-size: 0.7rem;
        padding: var(--space-xs);
        overflow-x: auto;
        max-width: 100%;
    }
    
    /* Copy buttons adjustments */
    .copy-frame-btn {
        font-size: 0.7rem;
        padding: var(--space-xs) var(--space-sm);
    }
    
    /* Exception copy button always visible on mobile */
    .exception-copy-btn {
        display: flex !important;
    }
    
    /* === Blog Mobile Styles === */
    .blog-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .blog-container {
        padding: 1rem;
    }
    
    .blog-header h1 {
        font-size: 2rem;
    }
    
    .blog-header p {
        font-size: 1rem;
    }
    
    /* Blog Post Mobile */
    .blog-post-container {
        padding: 0.5rem;
        margin: 0;
        max-width: 100%;
    }
    
    .blog-post {
        border-radius: 0;
        margin: 0;
    }
    
    .post-header {
        padding: 1rem;
    }
    
    .post-header h1 {
        font-size: 1.75rem;
        line-height: 1.2;
        margin-bottom: 0.75rem;
    }
    
    .post-excerpt {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    .post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
        margin-bottom: 1rem;
    }
    
    .post-tags {
        margin-top: 0.5rem;
    }
    
    .tag {
        font-size: 0.75rem;
        padding: 0.2rem 0.6rem;
    }
    
    .post-content {
        padding: 1rem;
    }
    
    .post-content h2 {
        font-size: 1.5rem;
        margin: 1.5rem 0 0.75rem 0;
    }
    
    .post-content h3 {
        font-size: 1.25rem;
        margin: 1.25rem 0 0.75rem 0;
    }
    
    .post-content p {
        margin-bottom: 1rem;
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .post-content pre {
        font-size: 0.8rem;
        padding: 1rem;
        margin: 1rem 0;
        overflow-x: auto;
        border-radius: 6px;
        word-wrap: break-word;
        white-space: pre-wrap;
        overflow-wrap: break-word;
    }
    
    .post-content code {
        font-size: 0.8rem;
        padding: 0.15rem 0.3rem;
    }
    
    .post-content ul, .post-content ol {
        padding-left: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .post-content li {
        font-size: 0.95rem;
        margin-bottom: 0.4rem;
    }
    
    .post-content blockquote {
        margin: 1rem 0;
        padding: 0.75rem 1rem;
        border-radius: 0 6px 6px 0;
    }
    
    .post-footer {
        padding: 1rem;
    }
    
    .post-navigation {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .post-navigation .btn-base {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Better spacing for mobile readability */
    .post-content {
        line-height: 1.6;
    }
}

/* === Small Mobile Screens === */
@media (max-width: 480px) {
    /* Small Screen Layout Variables */
    :root {
        --input-height: 45vh;
        --output-height: 55vh;
    }
    
    /* Ultra Compact Layout */
    header {
        padding: var(--space-sm) var(--space-md);
    }
    
    .input-panel {
        padding: var(--space-sm) var(--space-sm) var(--space-md) var(--space-sm);
    }
    
    .output-panel {
        padding: var(--space-sm);
    }
    
    #stackTraceInput {
        font-size: 0.75rem;
        padding: var(--space-md);
        height: calc(100% - 70px);
        min-height: 100px;
    }
    
    .language-chip {
        padding: var(--space-xs) var(--space-sm);
        font-size: 0.75rem;
    }
    
    .action-button {
        font-size: 0.7rem;
        padding: var(--space-xs);
    }
    
    .action-button span {
        display: none;
    }
    
    #analysis-output {
        padding: var(--space-sm);
    }
    
    .stack-trace-tree {
        font-size: 0.7rem;
    }
    
    .exception-info {
        font-size: 0.75rem;
    }
    
    .search-chip {
        font-size: 0.65rem;
    }
}