/* --- Custom Design System & Variables --- */
:root {
    /* Fonts */
    --font-main: 'Plus Jakarta Sans', sans-serif;
    --font-code: 'Fira Code', monospace;

    /* Light Theme (Default in CSS, but toggled via class) */
    --bg-app: #f4f6fa;
    --bg-sidebar: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-input: #ffffff;
    --bg-panel: #ffffff;
    --bg-toast: #ffffff;
    
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(99, 102, 241, 0.3);
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-toast: #1e293b;
    
    --primary: #6366f1;
    --primary-rgb: 99, 102, 241;
    --primary-hover: #4f46e5;
    --primary-glow: rgba(99, 102, 241, 0.15);
    
    --accent: #a855f7;
    --accent-hover: #9333ea;
    --accent-glow: rgba(168, 85, 247, 0.15);

    --success: #10b981;
    --success-bg: #ecfdf5;
    --danger: #ef4444;
    --danger-bg: #fef2f2;
    --warning: #f59e0b;
    --warning-bg: #fffbeb;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 20px -2px rgba(0,0,0,0.05), 0 2px 8px -1px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 30px -5px rgba(0,0,0,0.08), 0 4px 12px -2px rgba(0,0,0,0.05);

    --sidebar-width: 280px;
    --header-height: 70px;
    --border-radius: 12px;
    --transition-speed: 0.25s;
    --glass-blur: 12px;
    --calendar-filter: none;
}

/* --- Dark Theme Variables --- */
body.dark-theme {
    --bg-app: #090d16;
    --bg-sidebar: #0f1524;
    --bg-card: rgba(20, 27, 45, 0.6);
    --bg-input: #12192a;
    --bg-panel: #0f172a;
    --bg-toast: #0f172a;
    
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(168, 85, 247, 0.4);
    
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --text-toast: #f1f5f9;
    
    --primary: #8b5cf6;
    --primary-rgb: 139, 92, 246;
    --primary-hover: #7c3aed;
    --primary-glow: rgba(139, 92, 246, 0.25);
    
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.25);

    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.1);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.1);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.1);

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 20px -2px rgba(0,0,0,0.4), 0 2px 8px -1px rgba(0,0,0,0.3);
    --shadow-lg: 0 10px 30px -5px rgba(0,0,0,0.5), 0 4px 12px -2px rgba(0,0,0,0.4);
    --calendar-filter: invert(1);
}

/* --- Reset & Global Base --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-app);
    color: var(--text-primary);
    overflow-x: hidden;
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

a {
    color: inherit;
    text-decoration: none;
}

ul {
    list-style: none;
}

/* Custom Scrollbar */
html {
    scrollbar-width: thin;
    scrollbar-color: var(--border-color) transparent;
}
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- Common Layout Utilities --- */
.code-font {
    font-family: var(--font-code) !important;
}

.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.ml-auto { margin-left: auto; }
.w-full { width: 100%; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.hidden { display: none !important; }

/* --- App Shell Layout --- */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    transition: transform var(--transition-speed) ease, background-color var(--transition-speed);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.logo-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.logo-icon i {
    width: 18px;
    height: 18px;
}

.logo-text span {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-byline {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 0.25rem;
    letter-spacing: -0.01em;
}


.sidebar-close {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
}

/* Sidebar Search */
.sidebar-search {
    padding: 1.25rem 1.5rem 0.75rem;
}

.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-wrapper input {
    width: 100%;
    height: 40px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0 1rem 0 2.5rem;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.9rem;
    transition: all var(--transition-speed);
}

.search-wrapper input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.search-icon {
    position: absolute;
    left: 0.85rem;
    color: var(--text-muted);
    width: 16px;
    height: 16px;
    pointer-events: none;
}

/* Navigation List */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.nav-category {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 1.25rem 0.75rem 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
}

.nav-category:first-of-type {
    border-top: none;
    padding-top: 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 0.85rem;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
}

.nav-item i {
    width: 16px;
    height: 16px;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(99, 102, 241, 0.05);
}

.nav-item.active {
    color: #ffffff;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    box-shadow: 0 4px 15px var(--primary-glow);
}

.sidebar-footer {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* Theme Toggle Button */
.theme-btn {
    width: 100%;
    height: 42px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition-speed);
}

.theme-btn:hover {
    color: var(--text-primary);
    border-color: var(--primary);
    background-color: rgba(99, 102, 241, 0.05);
}

.theme-btn i {
    width: 18px;
    height: 18px;
}

/* Theme specific icons */
.theme-btn .icon-light { display: none; }
body.dark-theme .theme-btn .icon-light { display: block; }
body.dark-theme .theme-btn .icon-dark { display: none; }

/* --- Main Content Wrapper --- */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
    transition: margin-left var(--transition-speed) ease;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background-color: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 90;
    transition: background-color var(--transition-speed);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 0;
    flex: 1;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.menu-toggle i {
    width: 24px;
    height: 24px;
}

.page-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.header-right {
    display: flex;
    align-items: center;
}

.header-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: color var(--transition-speed);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.header-link:hover {
    color: var(--primary);
    background-color: rgba(99, 102, 241, 0.05);
}

.header-link i {
    width: 14px;
    height: 14px;
}

/* --- Header Dropdown --- */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all var(--transition-speed);
}

.dropdown-toggle:hover, .dropdown.open .dropdown-toggle {
    color: var(--primary);
    background-color: rgba(99, 102, 241, 0.05);
}

.header-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--border-color);
    transition: border-color var(--transition-speed);
}

.dropdown-toggle:hover .header-avatar, .dropdown.open .dropdown-toggle .header-avatar {
    border-color: var(--primary);
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background-color: var(--bg-sidebar);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--transition-speed) ease;
    z-index: 200;
    display: flex;
    flex-direction: column;
    padding: 0.5rem;
    backdrop-filter: blur(var(--glass-blur));
}

.dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all var(--transition-speed);
    white-space: nowrap;
}

.dropdown-item:hover {
    color: var(--text-primary);
    background-color: rgba(99, 102, 241, 0.05);
}

.dropdown-item svg, .dropdown-item i {
    width: 14px;
    height: 14px;
    color: var(--text-muted);
}

.dropdown-item:hover svg, .dropdown-item:hover i {
    color: var(--primary);
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Footer */
.main-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
    background-color: var(--bg-sidebar);
    transition: background-color var(--transition-speed);
}

/* --- Dashboard / Home Section --- */
.hero-section {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.08));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    text-align: center;
    backdrop-filter: blur(var(--glass-blur));
}

.hero-section h2 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-section p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.dashboard-category-title {
    font-size: 1.1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-left: 0.25rem;
    border-left: 3px solid var(--accent);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.tool-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(var(--glass-blur));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s;
}

.tool-card:hover .card-glow {
    opacity: 1;
}

.card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: rgba(99, 102, 241, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 1.25rem;
    transition: all 0.3s;
}

.card-icon i {
    width: 24px;
    height: 24px;
}

.tool-card:hover .card-icon {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.card-body h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.card-body p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.25rem;
}

.card-btn {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.2s;
    margin-top: auto;
}

.card-btn i {
    width: 14px;
    height: 14px;
}

.tool-card:hover .card-btn {
    gap: 0.75rem;
}

/* --- Section Toggles (SPA Router) --- */
.tool-section {
    display: none;
    animation: fadeIn var(--transition-speed) ease-in-out;
}

.tool-section.active {
    display: block;
}

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

/* --- General Tool Interface UI Components --- */
.section-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.5rem;
    align-items: start;
}

.split-layout {
    grid-template-columns: 1fr 1fr;
}

.main-panel {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--shadow-md);
}

.side-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.panel-title {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
}

.panel-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Form Elements */
.form-textarea {
    width: 100%;
    height: 380px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    line-height: 1.6;
    resize: vertical;
    transition: all var(--transition-speed);
}

.form-textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-input {
    width: 100%;
    height: 42px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0 1rem;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    transition: all var(--transition-speed);
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: var(--calendar-filter);
    cursor: pointer;
}

.form-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-row {
    display: flex;
    gap: 1rem;
}

.form-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

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

.form-select {
    height: 32px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 0 0.5rem;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.85rem;
    cursor: pointer;
}

.select-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Custom Checkboxes Layout */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.85rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-primary);
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Color Picker Row */
.color-picker-wrapper {
    display: flex;
    gap: 0.5rem;
}

.form-color {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 42px;
    height: 42px;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    padding: 0;
}

.form-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.form-color::-webkit-color-swatch {
    border: none;
    border-radius: calc(var(--border-radius) - 2px);
}

.text-xs-color {
    text-transform: uppercase;
    font-family: var(--font-code);
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 42px;
    height: auto;
    padding: 0.5rem 1.25rem;
    border-radius: var(--border-radius);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px var(--primary-glow);
    filter: brightness(1.08);
}

.btn-secondary {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.btn-secondary:hover {
    border-color: var(--primary);
    background-color: rgba(99, 102, 241, 0.05);
}

.btn-sm {
    height: 32px;
    padding: 0 0.85rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.icon-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-speed);
    padding: 0;
}

.icon-action-btn.btn-sm {
    padding: 0;
}

.icon-action-btn:hover {
    color: var(--text-primary);
    border-color: var(--primary);
    background-color: rgba(99, 102, 241, 0.05);
}

.icon-action-btn i,
.icon-action-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* Action Grid Layout */
.action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.75rem;
}

/* Panel Card nested */
.panel-card {
    background-color: rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.25rem;
}

body.dark-theme .panel-card {
    background-color: rgba(255, 255, 255, 0.01);
}

.panel-card-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* Stat Cards & Side Panel contents */
.stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(var(--glass-blur));
}

.stat-card h2 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.stat-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.stat-val {
    font-family: var(--font-code);
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary);
}

/* --- JSON Formatter specific --- */
.output-container {
    width: 100%;
    height: 380px;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    overflow: auto;
}

#json-output {
    white-space: pre-wrap;
    word-break: break-all;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-primary);
}

#json-output.empty-placeholder {
    color: var(--text-muted);
}

.status-badge {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 20px;
    text-transform: uppercase;
}

.status-badge.idle { background-color: var(--border-color); color: var(--text-secondary); }
.status-badge.success { background-color: var(--success-bg); color: var(--success); }
.status-badge.error { background-color: var(--danger-bg); color: var(--danger); }

.error-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 0.85rem 1rem;
    border-radius: var(--border-radius);
    background-color: var(--danger-bg);
    color: var(--danger);
    font-size: 0.9rem;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.error-banner i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* JSON Coloring */
.json-key { color: var(--primary); }
.json-string { color: var(--success); }
.json-number { color: #f59e0b; }
.json-boolean { color: var(--accent); }
.json-null { color: var(--text-muted); }

/* --- Regex Tester specific --- */
.regex-inputs-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.35rem 0.75rem;
    gap: 0.5rem;
}

.regex-field-wrapper {
    display: flex;
    align-items: center;
}

.regex-slash {
    font-family: var(--font-code);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 1.2rem;
    padding: 0 0.25rem;
}

.pattern-wrapper {
    flex: 1;
}

.pattern-wrapper input {
    border: none;
    background: none;
    height: 36px;
    padding: 0;
}
.pattern-wrapper input:focus {
    box-shadow: none;
}

.flags-wrapper input {
    width: 60px;
    border: none;
    background: none;
    text-align: center;
    height: 36px;
    padding: 0;
}
.flags-wrapper input:focus {
    box-shadow: none;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
}

.badge-success { background-color: var(--success-bg); color: var(--success); }
.badge-danger { background-color: var(--danger-bg); color: var(--danger); }

/* Overlapping Textarea & Backdrop for Regex Match Highlighting */
.regex-editor-container {
    position: relative;
    width: 100%;
    height: 320px;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    overflow: hidden;
    background-color: var(--bg-input);
}

.regex-backdrop,
.regex-textarea {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 1rem;
    font-size: 0.95rem;
    font-family: var(--font-code);
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
    border: none;
    box-sizing: border-box;
}

.regex-backdrop {
    color: transparent;
    pointer-events: none;
    overflow: hidden;
    background-color: transparent;
}

.regex-textarea {
    color: var(--text-primary);
    background-color: transparent;
    resize: none;
    z-index: 1;
}

/* Regex Highlight match marker */
.regex-match-mark {
    background-color: rgba(99, 102, 241, 0.35);
    border-bottom: 2px solid var(--primary);
    border-radius: 2px;
}

/* Matches List */
.matches-list-wrapper {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-input);
}

.matches-list {
    display: flex;
    flex-direction: column;
}

.empty-list-placeholder {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.match-item {
    border-bottom: 1px solid var(--border-color);
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
}

.match-item:last-child {
    border-bottom: none;
}

.match-item-header {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.match-item-val {
    font-family: var(--font-code);
    background-color: rgba(99, 102, 241, 0.08);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    color: var(--text-primary);
    word-break: break-all;
    display: inline-block;
    margin-top: 0.25rem;
}

.group-caps {
    margin-top: 0.35rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--border-color);
}

.group-cap-item {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* --- Markdown Editor specific --- */
.markdown-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem;
}

.toolbar-btn {
    height: 32px;
    min-width: 32px;
    padding: 0 0.5rem;
    border-radius: 6px;
    border: none;
    background: none;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 700;
    font-size: 0.85rem;
    transition: all var(--transition-speed);
}

.toolbar-btn:hover {
    color: var(--text-primary);
    background-color: rgba(99, 102, 241, 0.05);
}

.toolbar-btn i {
    width: 16px;
    height: 16px;
}

.toolbar-text {
    font-size: 0.8rem;
    font-weight: 800;
}

.toolbar-divider {
    width: 1px;
    height: 20px;
    background-color: var(--border-color);
    margin: 0 0.25rem;
}

.markdown-textarea {
    height: 480px;
}

.markdown-preview {
    height: 480px;
    overflow-y: auto;
    padding: 1rem;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

/* Markdown preview body styles (GitHub-like Markdown style) */
.markdown-body {
    font-size: 0.95rem;
    line-height: 1.6;
    word-wrap: break-word;
}

.markdown-body h1, .markdown-body h2, .markdown-body h3 {
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.markdown-body h1 { font-size: 1.5rem; border-bottom: 1px solid var(--border-color); padding-bottom: 0.3rem; }
.markdown-body h2 { font-size: 1.25rem; }
.markdown-body h3 { font-size: 1.1rem; }

.markdown-body p { margin-bottom: 0.85rem; color: var(--text-secondary); }

.markdown-body ul, .markdown-body ol {
    margin-bottom: 0.85rem;
    padding-left: 1.5rem;
}
.markdown-body ul { list-style-type: disc; }
.markdown-body ol { list-style-type: decimal; }

.markdown-body li { margin-top: 0.25rem; color: var(--text-secondary); }

.markdown-body code {
    font-family: var(--font-code);
    font-size: 0.85rem;
    padding: 0.2rem 0.4rem;
    background-color: var(--border-color);
    border-radius: 4px;
    color: var(--primary);
}

.markdown-body pre {
    background-color: var(--bg-app);
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow: auto;
    margin-bottom: 0.85rem;
}

.markdown-body pre code {
    background: none;
    padding: 0;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.markdown-body blockquote {
    padding: 0 1rem;
    color: var(--text-muted);
    border-left: 4px solid var(--primary);
    margin-bottom: 0.85rem;
}

/* --- QR Code Generator specific --- */
.qr-preview-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    width: 100%;
}

.qr-canvas-wrapper {
    background-color: #ffffff;
    padding: 1rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-canvas-wrapper canvas {
    max-width: 100%;
    height: auto !important;
}

/* --- QR Code Generator logo styling --- */
.qr-logo-upload-wrapper {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.qr-logo-preview-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background-color: var(--bg-card);
}

.qr-logo-preview-thumb {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    object-fit: contain;
    background: #f3f4f6;
    border: 1px solid var(--border-color);
    padding: 2px;
}

.qr-logo-name {
    font-size: 0.8rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
}


.form-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background-color: var(--border-color);
    outline: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: var(--primary);
    cursor: pointer;
    transition: transform 0.1s;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* --- New UI elements for Password Generator --- */
.pw-strength-bg {
    width: 100%;
    height: 8px;
    background-color: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.5rem;
}

.pw-strength-fill {
    height: 100%;
    width: 0%;
    transition: width var(--transition-speed), background-color var(--transition-speed);
}

/* --- New UI elements for Meta Tag Previews --- */
.meta-tabs {
    display: flex;
    gap: 0.25rem;
    background-color: var(--bg-input);
    padding: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
}

.meta-tab-btn {
    flex: 1;
    height: 34px;
    border-radius: 8px;
    border: none;
    background: none;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-speed);
}

.meta-tab-btn.active {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.meta-preview-box {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.meta-preview-item {
    display: none;
    animation: fadeIn var(--transition-speed) ease-in-out;
}

.meta-preview-item.active {
    display: block;
}

/* Google Search Mockup styles */
#meta-preview-google {
    font-family: Arial, sans-serif;
    text-align: left;
}

.google-url {
    font-size: 0.85rem;
    color: #dadce0;
    display: block;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

body:not(.dark-theme) .google-url {
    color: #202124;
}

.google-title {
    font-size: 1.25rem;
    font-weight: 400;
    color: #8ab4f8;
    line-height: 1.3;
    margin-bottom: 0.35rem;
    cursor: pointer;
}

.google-title:hover {
    text-decoration: underline;
}

body:not(.dark-theme) .google-title {
    color: #1a0dab;
}

.google-desc {
    font-size: 0.9rem;
    color: #bdc1c6;
    line-height: 1.5;
    word-break: break-word;
}

body:not(.dark-theme) .google-desc {
    color: #4d5156;
}

/* Facebook post mockup styles */
#meta-preview-facebook {
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    overflow: hidden;
    background-color: #18191a;
    font-family: Segoe UI, Helvetica, Arial, sans-serif;
}

body:not(.dark-theme) #meta-preview-facebook {
    background-color: #ffffff;
    border-color: #e5e5e5;
}

.fb-preview-img-wrapper {
    width: 100%;
    height: 180px;
    background-color: #242526;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

body:not(.dark-theme) .fb-preview-img-wrapper {
    background-color: #f0f2f5;
}

.fb-preview-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fb-preview-info {
    padding: 0.75rem 1rem;
    text-align: left;
}

.fb-url {
    font-size: 0.75rem;
    color: #b0b3b8;
    text-transform: uppercase;
}

body:not(.dark-theme) .fb-url {
    color: #65676b;
}

.fb-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e4e6eb;
    margin: 0.25rem 0;
    line-height: 1.3;
}

body:not(.dark-theme) .fb-title {
    color: #050505;
}

.fb-desc {
    font-size: 0.85rem;
    color: #b0b3b8;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body:not(.dark-theme) .fb-desc {
    color: #65676b;
}

/* Twitter Card mockup styles */
#meta-preview-twitter {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    overflow: hidden;
    background-color: #000000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body:not(.dark-theme) #meta-preview-twitter {
    background-color: #ffffff;
    border-color: #e1e8ed;
}

.twitter-preview-img-wrapper {
    width: 100%;
    height: 160px;
    background-color: #15181c;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

body:not(.dark-theme) .twitter-preview-img-wrapper {
    background-color: #f5f8fa;
}

.twitter-preview-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.twitter-preview-info {
    padding: 0.75rem 1rem;
    text-align: left;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

body:not(.dark-theme) .twitter-preview-info {
    border-top-color: #e1e8ed;
}

.twitter-url {
    font-size: 0.8rem;
    color: #8899a6;
}

body:not(.dark-theme) .twitter-url {
    color: #5b7083;
}

.twitter-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    margin: 0.2rem 0;
    line-height: 1.3;
}

body:not(.dark-theme) .twitter-title {
    color: #0f1419;
}

.twitter-desc {
    font-size: 0.85rem;
    color: #8899a6;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

body:not(.dark-theme) .twitter-desc {
    color: #5b7083;
}

/* --- Toast Container & Flyout Toasts --- */
.toast-container {
    position: fixed;
    bottom: 6rem; /* Shifted up to clear space for the bug report button */
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
}

.toast {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.25rem;
    background-color: var(--bg-toast);
    color: var(--text-toast);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    min-width: 250px;
    max-width: 400px;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast i {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.toast-success i { color: var(--success); }
.toast-error i { color: var(--danger); }
.toast-info i { color: var(--primary); }

.toast-msg {
    font-size: 0.85rem;
    font-weight: 600;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.toast.fade-out {
    animation: fadeOut var(--transition-speed) forwards;
}

@keyframes fadeOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* --- Tool SEO Info Styles --- */
.tool-seo-section {
    border-top: 1px solid var(--border-color);
    padding-top: 2rem;
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

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

.seo-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(var(--glass-blur));
    transition: all 0.3s ease;
}

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

.seo-card h2 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.seo-card h2 i {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.seo-card p, .seo-card li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.seo-card ol {
    padding-left: 1.25rem;
}

.seo-card ol li {
    margin-bottom: 0.5rem;
}

.seo-card pre {
    background-color: var(--bg-input);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-family: var(--font-code);
    font-size: 0.85rem;
    overflow-x: auto;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    margin-top: 0.5rem;
}

.seo-faq-wrapper {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(var(--glass-blur));
}

.seo-faq-wrapper h2 {
    font-size: 1.2rem;
    font-weight: 800;
    margin-bottom: 1.25rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.75rem;
}

.seo-faq-wrapper h2 i {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.faq-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.faq-item {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background-color: var(--bg-input);
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-item[open] {
    border-color: var(--border-hover);
    box-shadow: var(--shadow-sm);
}

.faq-question {
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    list-style: none;
}

.faq-question::-webkit-details-marker {
    display: none;
}

.faq-question i, .faq-question svg {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-item[open] .faq-question i, .faq-item[open] .faq-question svg {
    transform: rotate(180deg);
    color: var(--primary);
}

.faq-answer {
    padding: 0 1.25rem 1.25rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

/* --- Responsive Adjustments --- */
@media (max-width: 1024px) {
    .section-layout {
        grid-template-columns: 1fr;
    }
    .split-layout {
        grid-template-columns: 1fr;
    }
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-close {
        display: block;
    }
    .main-wrapper {
        margin-left: 0;
    }
    .menu-toggle {
        display: block;
    }
}

@media (max-width: 640px), (max-width: 960px) and (orientation: landscape) {
    .content-area {
        padding: 1rem;
    }
    .top-header {
        padding: 0 1rem;
    }
    .hero-section {
        padding: 2rem 1rem;
    }
    .hero-section h2 {
        font-size: 1.5rem;
    }
    .hero-section p {
        font-size: 0.95rem;
    }
    .form-row {
        flex-direction: column;
        gap: 0.75rem;
    }
    .action-grid {
        grid-template-columns: 1fr 1fr;
    }
    .toast-container {
        left: 1rem;
        right: 1rem;
        bottom: 5.5rem; /* Shifted up to clear space for the bug report button */
    }
    .toast {
        width: 100%;
        max-width: 100%;
    }
    .dropdown-toggle span, .dropdown-toggle i, .dropdown-toggle svg {
        display: none;
    }
    .page-title {
        font-size: 1.05rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100vw - 180px);
    }
    .lang-switcher {
        margin-right: 0.5rem;
    }
    .footer-separator {
        display: none;
    }
    .footer-desc {
        display: block;
        margin-top: 0.25rem;
    }
}

/* Landscape Mobile Specific Optimizations */
@media (max-width: 960px) and (max-height: 500px) and (orientation: landscape) {
    :root {
        --header-height: 52px;
    }
    .sidebar-search {
        padding: 0.5rem 1rem 0.5rem;
    }
    .sidebar-footer {
        padding: 0.5rem 1rem;
    }
    .theme-btn {
        height: 36px;
    }
    .logo-icon {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }
    .logo-icon i {
        width: 14px;
        height: 14px;
    }
    .logo {
        font-size: 1.1rem;
    }
}

/* Language Switcher Styling */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
}

.lang-btn {
    color: var(--text-secondary);
    padding: 0.3rem 0.5rem;
    border-radius: 6px;
    transition: all var(--transition-speed);
}

.lang-btn:hover {
    color: var(--primary);
    background-color: rgba(99, 102, 241, 0.05);
}

.lang-btn.active {
    color: var(--primary);
    background-color: rgba(99, 102, 241, 0.1);
    font-weight: 700;
}

.lang-separator {
    color: var(--border-color);
    font-weight: 400;
}

/* ==========================================================================
   21. IMAGE COMPRESSOR STYLES
   ========================================================================== */
.upload-drop-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 2.5rem 1.5rem;
    text-align: center;
    background: rgba(var(--primary-rgb), 0.02);
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-drop-zone:hover, .upload-drop-zone.dragover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.05);
}

.upload-icon {
    width: 48px;
    height: 48px;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    transition: color var(--transition-speed);
}

.upload-drop-zone:hover .upload-icon, .upload-drop-zone.dragover .upload-icon {
    color: var(--primary);
}

.upload-text {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.preview-placeholder {
    height: 250px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.preview-placeholder-icon {
    width: 64px;
    height: 64px;
    opacity: 0.3;
}

.img-compare-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.img-compare-box {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.img-box-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.preview-img-wrapper {
    width: 100%;
    height: 200px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1e293b; /* Dark bg for checkerboard contrast */
    background-image: linear-gradient(45deg, #334155 25%, transparent 25%), 
                      linear-gradient(-45deg, #334155 25%, transparent 25%), 
                      linear-gradient(45deg, transparent 75%, #334155 75%), 
                      linear-gradient(-45deg, transparent 75%, #334155 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.preview-img-wrapper img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.img-size-lbl {
    font-size: 0.90rem;
    font-weight: 700;
    color: var(--text-primary);
}

.img-stats-savings {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.saving-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.saving-badge span {
    font-size: 1.5rem;
    font-weight: 800;
}

.saving-badge small {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   22. COLOR CONVERTER & PALETTE STYLES
   ========================================================================== */
.contrast-result-box {
    transition: all var(--transition-speed);
    text-shadow: none;
    box-shadow: var(--shadow-sm);
}

.palette-swatch-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.palette-swatch-item {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-card);
    transition: transform var(--transition-speed);
}

.palette-swatch-item:hover {
    transform: translateX(4px);
}

.swatch-color-bar {
    width: 60px;
    height: 50px;
    flex-shrink: 0;
}

.swatch-info {
    flex-grow: 1;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.swatch-hex {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.swatch-copy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color var(--transition-speed);
    padding: 0.5rem;
}

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

/* Grid helpers */
.grid {
    display: grid;
}
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
}
.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
}
.gap-2 {
    gap: 0.5rem;
}
.gap-3 {
    gap: 0.75rem;
}
@media (max-width: 768px) {
    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }
}

/* Readonly Input & Textarea Adaptations for Theme Consistency */
.readonly-input,
.form-input[readonly],
.form-textarea[readonly] {
    background-color: var(--bg-app) !important;
    color: var(--text-secondary) !important;
    cursor: default;
    border-color: var(--border-color) !important;
}

/* --- PDF Converter & Tabbed Layout Styling --- */
.tabs-container {
    display: none !important;
}
.pdf-mobile-trigger-container {
    display: block;
    width: 100%;
}
.pdf-mobile-trigger-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.85rem 1.25rem;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed) ease;
}
.pdf-mobile-trigger-btn:hover {
    border-color: var(--primary);
    background-color: var(--bg-input);
}
.active-tab-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.active-tab-info i {
    color: var(--primary);
    width: 20px;
    height: 20px;
}
.trigger-chevron {
    color: var(--text-secondary);
    transition: transform var(--transition-speed) ease;
}
.pdf-mobile-trigger-btn.active .trigger-chevron {
    transform: rotate(180deg);
}

/* Modal Overlay & Bottom Sheet Drawer */
.pdf-mobile-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s ease, opacity 0.3s ease;
}
.pdf-mobile-modal.open {
    visibility: visible;
    opacity: 1;
}
.pdf-mobile-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
}
.pdf-mobile-modal-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    background-color: var(--bg-sidebar);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    z-index: 1001;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.pdf-mobile-modal.open .pdf-mobile-modal-content {
    transform: translateY(0);
}
.pdf-mobile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}
.pdf-mobile-modal-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}
.pdf-mobile-modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color var(--transition-speed);
}
.pdf-mobile-modal-close:hover {
    background-color: var(--bg-input);
    color: var(--text-primary);
}
.pdf-mobile-modal-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    max-height: 60vh;
    overflow-y: auto;
}
.pdf-modal-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem 1.25rem;
    cursor: pointer;
    font-family: var(--font-main);
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: all var(--transition-speed) ease;
}
.pdf-modal-item:hover, .pdf-modal-item.active {
    border-color: var(--primary);
    background-color: var(--primary-glow);
    color: var(--primary);
}
.pdf-modal-item i {
    width: 18px;
    height: 18px;
}
.item-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.item-chevron {
    color: var(--text-secondary);
    transition: transform var(--transition-speed);
}
.pdf-modal-item:hover .item-chevron {
    color: var(--primary);
    transform: translateX(3px);
}

@media (min-width: 993px) {
    .pdf-mobile-modal {
        align-items: center;
    }
    .pdf-mobile-modal-content {
        border-radius: 20px;
        transform: scale(0.95) translateY(-20px);
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    }
    .pdf-mobile-modal.open .pdf-mobile-modal-content {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}
.tabs {
    display: flex;
    gap: 0.25rem;
    background-color: var(--bg-input);
    padding: 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    width: max-content;
}
.tab-btn {
    flex: 0 0 auto;
    height: 40px;
    padding: 0 1.25rem;
    border-radius: 8px;
    border: none;
    background: none;
    font-family: var(--font-main);
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}
.tab-btn.active {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* Drag-Drop Zone Dragging State */
.upload-drop-zone.highlight {
    border-color: var(--primary) !important;
    background-color: var(--primary-glow) !important;
    box-shadow: 0 0 12px var(--primary-glow);
}

/* Selected Image List Container */
.pdf-image-list-container {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    min-height: 300px;
    max-height: 480px;
    overflow-y: auto;
}
.pdf-image-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.pdf-image-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    transition: transform var(--transition-speed), border-color var(--transition-speed);
}
.pdf-image-item:hover {
    border-color: var(--border-hover);
}
.pdf-image-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}
.pdf-image-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.pdf-image-name {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pdf-image-size {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.pdf-image-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.pdf-image-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-input);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-speed);
}
.pdf-image-actions button:hover:not(:disabled) {
    background-color: var(--border-color);
    color: var(--text-primary);
}
.pdf-image-actions button.btn-delete:hover {
    background-color: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Spin Animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}
.animate-spin {
    animation: spin 1.2s linear infinite;
    display: inline-block;
}

/* PDF Overview Grid & Cards */
.pdf-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.pdf-overview-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    backdrop-filter: blur(var(--glass-blur));
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pdf-overview-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pdf-overview-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-lg);
}

.pdf-overview-card:hover::before {
    opacity: 1;
}

.pdf-overview-card .card-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: rgba(99, 102, 241, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    margin-bottom: 1.25rem;
    transition: all 0.3s;
}

.pdf-overview-card:hover .card-icon {
    background-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.pdf-overview-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.pdf-overview-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

.pdf-overview-card .card-btn {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    transition: transform 0.2s;
}

.pdf-overview-card:hover .card-btn {
    color: var(--primary-dark);
}

.pdf-overview-card:hover .card-btn i {
    transform: translateX(4px);
}

.pdf-overview-card .card-btn i {
    transition: transform 0.2s;
}

/* Mobile layout bug fix for horizontal scroll / overflow */
@media (max-width: 640px) {
    .top-header {
        padding: 0 0.5rem;
    }
    .header-left {
        gap: 8px;
    }
    .header-right {
        gap: 8px;
    }
    .lang-switcher {
        margin-right: 0 !important;
    }
    .lang-btn {
        padding: 2px 6px;
    }
    .page-title {
        max-width: calc(100vw - 210px) !important;
    }
}

/* ==========================================================================
   PDF EDITOR FEATURE STYLES
   ========================================================================== */
.pdf-editor-workspace {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    margin-top: 1.5rem;
}

.pdf-editor-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border-color);
    z-index: 10;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 4px;
}

.toolbar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
}

.toolbar-btn:hover {
    background: var(--bg-app);
    color: var(--text-primary);
    transform: translateY(-1px);
}

.toolbar-btn.active {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary);
}

.properties-group {
    gap: 16px;
}

.property-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.control-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    user-select: none;
}

/* Color Swatches */
.color-picker-swatches {
    display: flex;
    align-items: center;
    gap: 6px;
}

.color-swatch {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--bg-sidebar);
    box-shadow: 0 0 0 1px var(--border-color);
    cursor: pointer;
    padding: 0;
    transition: all var(--transition-speed) ease;
}

.color-swatch:hover {
    transform: scale(1.15);
}

.color-swatch.active {
    box-shadow: 0 0 0 2px var(--primary);
    transform: scale(1.1);
}

.custom-color-input {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: none;
    cursor: pointer;
    padding: 0;
}

/* Range Inputs */
.size-input-wrapper,
.opacity-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-range {
    -webkit-appearance: none;
    appearance: none;
    width: 80px;
    height: 5px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    transition: transform var(--transition-speed) ease;
}

.custom-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.size-val-badge {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-app);
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 32px;
    text-align: center;
}

/* Work Area */
.editor-work-area {
    display: flex;
    height: 600px;
    background: var(--bg-app);
    overflow: hidden;
}

.editor-sidebar {
    display: flex;
    flex-direction: column;
    background: var(--bg-sidebar);
    transition: width var(--transition-speed) ease;
}

.thumbnails-sidebar {
    width: 160px;
    border-right: 1px solid var(--border-color);
}

.comments-sidebar {
    width: 280px;
    border-left: 1px solid var(--border-color);
}

.sidebar-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h4 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.thumbnails-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
}

.comments-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Thumbnails */
.thumbnail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    width: 100%;
}

.thumbnail-wrapper {
    position: relative;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-speed) ease;
}

.thumbnail-item:hover .thumbnail-wrapper {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.thumbnail-item.active .thumbnail-wrapper {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px var(--primary-glow);
}

.thumbnail-wrapper canvas {
    display: block;
    width: 100%;
    height: auto;
}

.thumbnail-page-num {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Viewport / PDF Pages view */
.editor-viewport {
    flex: 1;
    overflow: auto;
    padding: 24px;
    display: flex;
    justify-content: center;
    background: #141c2c; /* Contrasting dark bg for white pages */
}

body.dark-theme .editor-viewport {
    background: #090d16;
}

.viewport-canvas-wrapper {
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
}

.pdf-page-container {
    position: relative;
    background: #ffffff;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    overflow: visible; /* Need overflow visible for floating text inputs */
}

.pdf-page-container canvas.canvas-bg {
    display: block;
    max-width: 100%;
    height: auto;
}

.pdf-page-container canvas.canvas-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
}

/* Floating interactive text input for editing text directly on pdf */
.pdf-text-input-field {
    position: absolute;
    z-index: 100;
    border: 1px dashed var(--primary);
    background: rgba(255, 255, 255, 0.95);
    color: #000000;
    font-family: var(--font-main);
    font-weight: 500;
    outline: none;
    padding: 2px 6px;
    border-radius: 4px;
    box-shadow: var(--shadow-md);
    overflow: hidden;
    resize: none;
    line-height: 1.2;
}

/* Selection overlay indicator box */
.pdf-selection-box {
    position: absolute;
    border: 1px dashed var(--primary);
    background: rgba(var(--primary-rgb), 0.15);
    z-index: 5;
    pointer-events: none;
}

/* Comment marker / sticky notes on page */
.comment-marker {
    position: absolute;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #eab308;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 6;
    box-shadow: var(--shadow-md);
    transform: translate(-50%, -50%);
    transition: transform var(--transition-speed) cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.comment-marker:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: var(--shadow-lg);
}

.comment-marker.active {
    background: var(--primary);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.3);
}

.comment-marker svg {
    width: 12px;
    height: 12px;
    pointer-events: none;
}

/* Comment details sidebar card */
.comment-card {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-speed) ease;
}

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

.comment-card.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 1px var(--primary);
    background: var(--bg-card);
}

.comment-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 6px;
}

.comment-card-page {
    background: var(--bg-app);
    padding: 1px 5px;
    border-radius: 3px;
}

.comment-card-body {
    font-size: 12px;
    color: var(--text-primary);
    line-height: 1.4;
    word-break: break-word;
}

.comment-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 6px;
    border-top: 1px solid var(--border-color);
    padding-top: 6px;
}

.comment-card-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 10px;
    font-weight: 500;
    padding: 2px 4px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.comment-card-btn:hover {
    color: var(--danger);
}

/* Footer save bar */
.editor-action-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: var(--bg-sidebar);
    border-top: 1px solid var(--border-color);
    z-index: 10;
}

/* Responsive Media Queries */
@media (max-width: 991px) {
    .editor-sidebar.thumbnails-sidebar {
        display: none; /* Hide thumbnails on smaller screens */
    }
}

@media (max-width: 768px) {
    .pdf-editor-workspace {
        margin-top: 1rem;
    }
    
    .pdf-editor-toolbar {
        padding: 8px 12px;
        gap: 8px;
    }
    
    .editor-work-area {
        height: 480px;
        flex-direction: column;
    }
    
    .editor-sidebar.comments-sidebar {
        width: 100%;
        height: 160px;
        border-left: none;
        border-top: 1px solid var(--border-color);
    }
    
    .editor-viewport {
        padding: 12px;
    }
    
    .properties-group {
        width: 100%;
        justify-content: space-between;
        margin-top: 4px;
        border-top: 1px solid var(--border-color);
        padding-top: 8px;
    }
}

/* --- Bug Report Floating Button --- */
.bug-report-btn {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3.25rem;
    height: 3.25rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #ffffff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3), var(--shadow-lg);
    cursor: pointer;
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease, color 0.2s ease;
    text-decoration: none;
}

body.dark-theme .bug-report-btn {
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4), var(--shadow-lg);
}

.bug-report-btn:hover {
    transform: scale(1.1) translateY(-3px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5), var(--shadow-lg);
    color: #ffffff !important;
}

body.dark-theme .bug-report-btn:hover {
    box-shadow: 0 8px 30px rgba(139, 92, 246, 0.6), var(--shadow-lg);
}

.bug-report-btn:active {
    transform: scale(0.95) translateY(0);
}

.bug-report-btn i {
    width: 1.5rem;
    height: 1.5rem;
    transition: transform 0.3s ease;
}

.bug-report-btn:hover i {
    transform: rotate(15deg);
}

/* Premium Tooltip */
.bug-report-btn::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 4rem;
    right: 0;
    background: var(--bg-panel);
    color: var(--text-primary);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    pointer-events: none;
}

.bug-report-btn:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Responsive adjustment for bug report button */
@media (max-width: 640px), (max-width: 960px) and (orientation: landscape) {
    .bug-report-btn {
        bottom: 1rem;
        right: 1rem;
        width: 3rem;
        height: 3rem;
    }
    
    .bug-report-btn::before {
        display: none; /* Hide tooltip on small screens/touch devices */
    }
}

/* Cookie Consent */
.cookie-consent-container {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column-reverse; /* Keep icon at bottom, popup opens above */
    align-items: flex-start;
}

.cookie-icon-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-card); /* Theme compatible */
    border: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: all 0.2s ease;
}

.cookie-icon-btn:hover {
    transform: scale(1.05);
}

.cookie-popup {
    background-color: var(--bg-panel); /* Theme compatible */
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 380px;
    padding: 24px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 16px; /* Space between popup and icon */
    display: none; /* Hidden by default */
    color: var(--text-primary);
    font-family: inherit;
}

.cookie-popup.show {
    display: block;
    animation: slideUpFade 0.3s ease forwards;
}

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

.cookie-popup-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.cookie-popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
}

.cookie-popup-body {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.cookie-popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.cookie-btn {
    padding: 10px 20px;
    border-radius: 24px; /* pill shape */
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    outline: none;
    font-family: inherit;
}

.cookie-btn-outline {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.cookie-btn-outline:hover {
    background-color: var(--border-color);
}

.cookie-btn-primary {
    background-color: var(--primary);
    color: #ffffff;
    font-weight: 600;
}

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

/* Hide container class */
.cookie-consent-container.hidden {
    display: none;
}

/* --- DNS Lookup & Network Diagnostics Styling --- */
.dns-hero-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5rem 1rem;
    background-image: radial-gradient(circle at 50% 30%, rgba(139, 92, 246, 0.08) 0%, transparent 60%);
    min-height: 70vh;
}

.dns-hero-content {
    max-width: 800px;
    width: 100%;
    text-align: center;
}

.dns-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    color: var(--primary);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 6px 14px;
    border-radius: 50px;
    margin-bottom: 2rem;
}

.pulse-dot {
    width: 8px;
    height: 8px;
    background-color: var(--success);
    border-radius: 50%;
    display: inline-block;
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    animation: pulse 1.6s infinite;
}

.pulse-dot.red {
    background-color: var(--danger);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
}

@keyframes pulse {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 8px rgba(52, 211, 153, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
    }
}

.dns-hero-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.25rem;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--primary) 70%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.dns-hero-desc {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 2.5rem;
    max-width: 650px;
    margin-left: auto;
    margin-right: auto;
}

.dns-search-box-wrapper {
    position: relative;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 6px;
    box-shadow: var(--shadow-md), 0 0 0 2px rgba(139, 92, 246, 0.03);
    transition: all var(--transition-speed);
}

.dns-search-box-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: var(--shadow-lg), 0 0 0 4px var(--primary-glow);
}

.dns-search-box-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.dns-search-input {
    width: 100%;
    background: transparent;
    border: none;
    padding: 14px 16px 14px 50px;
    color: var(--text-primary);
    font-size: 1.05rem;
    font-family: inherit;
}

.dns-search-btn {
    background: var(--primary);
    color: #ffffff;
    border: none;
    border-radius: calc(var(--border-radius) - 4px);
    padding: 0 24px;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: background-color var(--transition-speed);
}

.dns-search-btn:hover {
    background: var(--primary-hover);
}

.dns-quick-tags {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.dns-quick-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

.dns-tag-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.dns-tag-btn i {
    width: 12px;
    height: 12px;
    color: var(--primary);
}

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

.dns-hero-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dns-footer-stat {
    display: flex;
    align-items: center;
    gap: 8px;
}

.dns-footer-label {
    color: var(--text-muted);
}

.dns-footer-value {
    color: var(--text-primary);
    font-weight: 700;
}

.dns-footer-stat i {
    width: 16px;
    height: 16px;
}

.dns-footer-separator {
    color: var(--border-color);
}

/* Results Layout */
.dns-results-layout {
    animation: fadeIn 0.4s ease;
}

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

.dns-results-header {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: var(--border-radius);
}

.dns-results-search-wrapper {
    display: flex;
    gap: 8px;
    max-width: 400px;
    width: 100%;
}

.dns-target-badge {
    background: var(--primary-glow);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
}

.dns-split-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}



/* Inner Sidebar */
.dns-inner-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
}

.dns-inner-sidebar-title {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 12px;
    padding-left: 8px;
}

.dns-inner-nav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dns-inner-nav-item {
    width: 100%;
    background: transparent;
    border: none;
    border-radius: 8px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.dns-inner-nav-item i {
    width: 18px;
    height: 18px;
    transition: transform var(--transition-speed);
}

.dns-inner-nav-item:hover {
    background: rgba(var(--primary-rgb), 0.05);
    color: var(--text-primary);
}

.dns-inner-nav-item:hover i {
    transform: scale(1.05);
}

.dns-inner-nav-item.active {
    background: var(--primary);
    color: #ffffff;
}

.dns-inner-nav-item.active i {
    color: #ffffff;
}

/* Content Panels */
.dns-inner-content-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px;
    min-height: 500px;
    position: relative;
    min-width: 0;
}

.dns-tab-content-pane {
    display: none;
}

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

/* Loading Overlay */
.dns-tab-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(var(--primary-rgb), 0.02);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 16px;
    z-index: 10;
    border-radius: var(--border-radius);
}

.dns-loader-spinner {
    width: 44px;
    height: 44px;
    border: 3px solid rgba(var(--primary-rgb), 0.15);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: dns-spin 1s linear infinite;
}

@keyframes dns-spin {
    to { transform: rotate(360deg); }
}

#dns-loading-status-text {
    color: var(--text-secondary);
    font-weight: 600;
}

/* DNS Records Pane */
.dns-records-filter-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

@media (max-width: 768px) {
    .dns-records-filter-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .dns-records-filter-tabs::-webkit-scrollbar {
        display: none;
    }
    .dns-filter-btn {
        flex-shrink: 0;
    }
}

.dns-filter-btn {
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.dns-filter-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.dns-filter-btn.active {
    background: var(--primary-glow);
    border-color: var(--primary);
    color: var(--primary);
}

.table-responsive {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    margin-top: 1rem !important;
}

.dns-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.dns-table th, .dns-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.dns-table td {
    word-break: break-all !important;
    white-space: normal !important;
}

.dns-table td:last-child {
    max-width: 280px !important;
}

.dns-table th {
    font-weight: 700;
    color: var(--text-secondary);
}

.dns-type-badge {
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
    display: inline-block;
}

.dns-val-col {
    word-break: break-all;
    max-width: 400px;
}

/* WHOIS / PING Output */
.dns-whois-output, .dns-ping-output {
    background: #060913;
    color: #a5b4fc;
    padding: 20px;
    border-radius: 12px;
    overflow: auto;
    max-height: 480px;
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.5;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* SSL Info Pane */
.dns-ssl-banner {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border-radius: 12px;
}

.dns-ssl-banner.valid {
    background: rgba(52, 211, 153, 0.08);
    border: 1px solid rgba(52, 211, 153, 0.15);
    color: var(--success);
}

.dns-ssl-banner.invalid {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.dns-ssl-banner i {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.dns-ssl-banner-text h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.dns-ssl-banner-text span {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.dns-ssl-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .dns-ssl-grid {
        grid-template-columns: 1fr;
    }
}

.dns-ssl-item {
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dns-ssl-item.full-width {
    grid-column: 1 / -1;
}

.dns-ssl-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.dns-ssl-value {
    font-size: 0.95rem;
    font-weight: 600;
    word-break: break-all;
}

.dns-ssl-value-san {
    font-size: 0.85rem;
    line-height: 1.4;
    white-space: pre-wrap;
    color: var(--text-secondary);
}


/* Ping Diagnostics Pane */
.dns-ping-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 16px;
    align-items: end;
}

@media (max-width: 768px) {
    .dns-ping-actions {
        grid-template-columns: 1fr;
    }
}

.dns-ping-input-col {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dns-ping-buttons-col {
    display: flex;
    gap: 8px;
}

.dns-ping-output-wrapper {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    overflow: hidden;
    margin-top: 16px;
}

.dns-ping-output-header {
    background: #0f1322;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dns-shell-title {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 600;
}

.dns-shell-copy-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
}

.dns-shell-copy-btn:hover {
    color: #ffffff;
}

.dns-shell-copy-btn i {
    width: 14px;
    height: 14px;
}

/* IP Geolocation Pane */
.dns-ip-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 768px) {
    .dns-ip-grid {
        grid-template-columns: 1fr;
    }
}

.dns-ip-item {
    background: var(--bg-app);
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dns-ip-item.full-width {
    grid-column: 1 / -1;
}

.dns-ip-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
}

.dns-ip-value {
    font-size: 0.95rem;
    font-weight: 600;
}

.dns-ip-map-title {
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dns-ip-map-title i {
    width: 18px;
    height: 18px;
    color: var(--primary);
}

.dns-map-frame-wrapper {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

/* Mobile Trigger Elements (Desktop Hidden) */
.dns-mobile-nav-trigger-wrapper {
    display: none;
}
.dns-mobile-sidebar-header {
    display: none;
}
.dns-mobile-sidebar-card {
    display: block;
    width: 100%;
}

/* ==========================================
   DNS & NETWORK DIAGNOSTICS MOBILE OPTIMIZATIONS
   ========================================== */
@media (max-width: 992px) {
    .dns-split-container {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
    
    /* Convert the sidebar container to a fullscreen modal backdrop */
    .dns-inner-sidebar {
        display: none !important;
    }
    
    .dns-inner-sidebar.open {
        display: flex !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background-color: rgba(6, 9, 22, 0.8) !important;
        backdrop-filter: blur(8px) !important;
        z-index: 99999 !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 20px !important;
        margin: 0 !important;
        box-sizing: border-box !important;
    }
    
    /* The modal popup box */
    .dns-inner-sidebar.open .dns-mobile-sidebar-card {
        background: var(--bg-card) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: 16px !important;
        width: 100% !important;
        max-width: 340px !important;
        padding: 20px !important;
        box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5) !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        box-sizing: border-box !important;
        animation: modalFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }
    
    @keyframes modalFadeIn {
        from { opacity: 0; transform: scale(0.95) translateY(10px); }
        to { opacity: 1; transform: scale(1) translateY(0); }
    }
    
    .dns-mobile-sidebar-header {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        border-bottom: 1px solid var(--border-color) !important;
        padding-bottom: 12px !important;
        margin: 0 !important;
    }
    
    .dns-mobile-sidebar-header h4 {
        font-size: 1.05rem !important;
        font-weight: 700 !important;
        color: var(--text-primary) !important;
        margin: 0 !important;
        letter-spacing: 0.5px !important;
    }
    
    .dns-mobile-sidebar-close-btn {
        background: transparent !important;
        border: none !important;
        color: var(--text-muted) !important;
        cursor: pointer !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 32px !important;
        height: 32px !important;
        border-radius: 50% !important;
        transition: background-color 0.2s, color 0.2s !important;
    }
    
    .dns-mobile-sidebar-close-btn:hover {
        background: rgba(255, 255, 255, 0.08) !important;
        color: var(--text-primary) !important;
    }
    
    .dns-inner-sidebar-title {
        display: none !important;
    }
    
    /* Keep list vertical inside the popup */
    .dns-inner-nav-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        padding: 0 !important;
        margin: 0 !important;
        list-style: none !important;
        overflow: visible !important;
    }
    
    .dns-inner-nav-list li {
        list-style: none !important;
        width: 100% !important;
        flex-shrink: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .dns-inner-nav-item {
        width: 100% !important;
        white-space: nowrap !important;
        padding: 10px 14px !important;
        font-size: 0.95rem !important;
        display: flex !important;
        align-items: center !important;
        gap: 12px !important;
    }

    .dns-inner-content-panel {
        padding: 14px !important;
    }
    
    .dns-mobile-nav-trigger-wrapper {
        display: block !important;
    }
}

@media (max-width: 768px) {
    .dns-results-header {
        display: grid !important;
        grid-template-areas: 
            "back target"
            "search search" !important;
        grid-template-columns: auto 1fr !important;
        gap: 12px !important;
        padding: 12px !important;
        border-radius: 12px !important;
    }
    
    #dns-btn-back-to-search {
        grid-area: back !important;
        justify-self: start !important;
        padding: 6px 12px !important;
        font-size: 0.85rem !important;
        height: auto !important;
    }
    
    .dns-current-target-info {
        grid-area: target !important;
        justify-self: end !important;
        margin-left: 0 !important;
        align-self: center !important;
        font-size: 0.85rem !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
    }
    
    .dns-target-badge {
        max-width: 150px !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }
    
    .dns-results-search-wrapper {
        grid-area: search !important;
        max-width: none !important;
        width: 100% !important;
    }
    
    /* Prevent input overflow in flex wrapper on mobile */
    .dns-results-search-wrapper input {
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    /* Keep table cells readable by forcing minimum scrollable width instead of squeeze */
    .dns-table {
        min-width: 650px !important;
    }

    .dns-table th, 
    .dns-table td {
        padding: 8px 10px !important;
        font-size: 0.8rem !important;
    }
    
    /* Center align the filter tabs on mobile */
    .dns-records-filter-tabs {
        justify-content: flex-start !important;
        gap: 4px !important;
    }
    
    .dns-filter-btn {
        padding: 5px 10px !important;
        font-size: 0.75rem !important;
    }

    /* Main Screen Search Box Stack on Mobile */
    .dns-search-box-wrapper {
        flex-direction: column !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        gap: 12px !important;
        padding: 0 !important;
    }
    
    .dns-search-input {
        width: 100% !important;
        background: var(--bg-input) !important;
        border: 1px solid var(--border-color) !important;
        border-radius: var(--border-radius) !important;
        padding: 0 16px 0 44px !important;
        height: 50px !important;
        font-size: 1rem !important;
        box-sizing: border-box !important;
    }
    
    .dns-search-box-icon {
        left: 16px !important;
        top: 25px !important;
        transform: translateY(-50%) !important;
    }
    
    .dns-search-btn {
        width: 100% !important;
        height: 48px !important;
        justify-content: center !important;
        border-radius: var(--border-radius) !important;
        padding: 0 !important;
    }
}

/* --- Expanded DNS & Network Tools Styles --- */

/* Whois visual summary cards */
.dns-whois-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}
.dns-whois-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.dns-whois-card-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.dns-whois-card-value {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    word-break: break-all;
}

/* Ping Live Stats Dashboard */
.dns-ping-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.dns-ping-stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dns-stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 700;
}
.dns-stat-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
}

/* Ping Chart */
.dns-ping-chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 16px;
}
.dns-ping-chart-header {
    margin-bottom: 12px;
}
.dns-chart-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.dns-chart-title i {
    width: 14px;
    height: 14px;
}

/* Table inline action buttons */
.dns-val-col {
    position: relative;
    padding-right: 80px !important;
}
.dns-record-actions {
    display: inline-flex;
    gap: 4px;
    margin-left: 8px;
    vertical-align: middle;
    opacity: 0.3;
    transition: opacity var(--transition-speed);
}
tr:hover .dns-record-actions {
    opacity: 1;
}
.dns-mini-action-btn {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    border: none;
    border-radius: 4px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition-speed), color var(--transition-speed);
}
.dns-mini-action-btn:hover {
    background: var(--primary);
    color: #ffffff;
}
.dns-mini-action-btn i {
    width: 12px;
    height: 12px;
}

/* IP country flag */
.dns-ip-flag {
    width: 16px;
    height: 12px;
    object-fit: cover;
    border-radius: 2px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 6px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

/* Security badges */
.dns-sec-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 4px;
    margin-right: 4px;
}
.dns-sec-badge.vpn {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}
.dns-sec-badge.proxy {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}
.dns-sec-badge.tor {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
}
.dns-sec-badge.hosting {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}
.dns-sec-badge.safe {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
}

@media (max-width: 992px) {
    .dns-whois-summary-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .dns-whois-summary-grid {
        grid-template-columns: 1fr;
    }
    .dns-ping-stats-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Reliability & Turkey Access Styles --- */
.dns-security-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
}
.dns-security-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
}
.dns-security-header-title i {
    width: 22px;
    height: 22px;
}
.dns-security-list {
    display: flex;
    flex-direction: column;
}
.dns-security-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}
.dns-security-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.dns-security-row:first-child {
    padding-top: 0;
}
.dns-security-label-col {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}
.dns-sec-label-icon {
    width: 18px;
    height: 18px;
}
.dns-security-value-col {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    font-size: 0.95rem;
}
.dns-sec-status {
    font-weight: 600;
}
.dns-sec-status.safe-text, .dns-sec-status-long.safe-text {
    color: var(--success);
}
.dns-sec-status.unsafe-text, .dns-sec-status-long.unsafe-text {
    color: var(--danger);
}
.dns-sec-action-link {
    border: 1px solid var(--primary);
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    transition: background var(--transition-speed), color var(--transition-speed);
}
.dns-sec-action-link:hover {
    background: var(--primary);
    color: #ffffff;
}

@media (max-width: 576px) {
    .dns-security-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .dns-security-value-col {
        width: 100%;
        justify-content: space-between;
    }
}

/* --- Nameserver Info Card Styles --- */
.dns-ns-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--primary);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
}
.dns-ns-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 14px;
    margin-bottom: 20px;
}
.dns-ns-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}
.dns-ns-header-left i {
    width: 22px;
    height: 22px;
}
.dns-ns-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 600;
}
.dns-ns-header-right i {
    width: 16px;
    height: 16px;
}
.dns-ns-badge {
    background: var(--bg-body);
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
}
.dns-ns-table {
    width: 100%;
    border-collapse: collapse;
}
.dns-ns-table th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}
.dns-ns-table td {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.95rem;
    vertical-align: top;
}
.dns-ns-table tr:last-child td {
    border-bottom: none;
    padding-bottom: 0;
}
.dns-ns-host-cell {
    font-weight: 600;
    color: var(--text-primary);
}
.dns-ns-ip-cell {
    font-family: var(--font-code);
    color: var(--primary);
    font-weight: 600;
    line-height: 1.6;
}
.dns-ns-ip-line {
    display: block;
}
.dns-ns-footer-banner {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    padding: 14px 18px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.dns-ns-footer-banner i {
    color: var(--primary);
    flex-shrink: 0;
    margin-top: 2px;
    width: 16px;
    height: 16px;
}

@media (max-width: 576px) {
    .dns-ns-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .dns-ns-header-right {
        align-self: flex-end;
    }
}
