/* ==============================
   Base Layout & Theme
   ============================== */
:root {
    --primary-color: #0d6efd;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --dark-color: #212529;
    --light-color: #f8f9fa;
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: #f8f9fa;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
    min-width: 320px;
    min-height: 100vh;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

body.theme-dark {
    background: #1a1a1a !important;
    color: #f8f9fa !important;
}

body.theme-light {
    background: #f8f9fa !important;
    color: #212529 !important;
}

/* ==============================
   Header & Footer
   ============================== */
.header-section {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.theme-dark .header-section {
    background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%) !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}

.theme-selector {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-section {
    margin-top: auto;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.theme-dark .footer-section {
    border-top-color: rgba(255,255,255,0.1);
}

/* ==============================
   Hero Banner
   ============================== */
.hero-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.35);
    position: relative;
    overflow: hidden;
    animation: slideInDown 0.8s ease-out;
}

.hero-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -5%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    animation: float 8s ease-in-out infinite reverse;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-banner h1 {
    color: white;
    text-shadow: 0 4px 12px rgba(0,0,0,0.25);
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 1rem;
}

.hero-banner h1 i {
    animation: spin 2s linear infinite;
}

.hero-banner p {
    color: rgba(255,255,255,0.98);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

.feature-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.badge {
    font-size: 0.9rem;
    padding: 0.65rem 1.2rem;
    font-weight: 600;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.15);
}

.bg-primary-light {
    background-color: rgba(13, 110, 253, 0.2) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.bg-success-light {
    background-color: rgba(25, 135, 84, 0.2) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.bg-info-light {
    background-color: rgba(13, 202, 240, 0.2) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.bg-warning-light {
    background-color: rgba(255, 193, 7, 0.2) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

/* ==============================
   Alert Styling
   ============================== */
.alert {
    border: none;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
    animation: slideInUp 0.6s ease-out;
}

.alert-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.15) 0%, rgba(13, 110, 253, 0.1) 100%) !important;
    border-left: 4px solid #0dcaf0 !important;
    color: #055160 !important;
}

.theme-dark .alert-info {
    color: #cfe2ff !important;
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.2) 0%, rgba(13, 110, 253, 0.15) 100%) !important;
}

.alert-heading {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.alert .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
}

/* ==============================
   Sidebar
   ============================== */
.sidebar {
    min-height: 100vh;
    box-shadow: 2px 0 12px rgba(0,0,0,0.15);
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 16.666667%;
    max-width: 280px;
    min-width: 180px;
    height: 100vh;
    background: linear-gradient(180deg, #1e2125 0%, #212529 50%, #1a1d20 100%);
    border-right: 1px solid #343a40;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid #343a40;
    background: linear-gradient(180deg, #2d3136 0%, #212529 100%);
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.25rem;
}

.sidebar-header p {
    margin: 0;
    font-size: 0.8rem;
    opacity: 0.8;
}

.sidebar-sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.sidebar-sticky::-webkit-scrollbar {
    width: 6px;
}

.sidebar-sticky::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-sticky::-webkit-scrollbar-thumb {
    background: #495057;
    border-radius: 3px;
}

.sidebar-sticky::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}

#sidebarSearch {
    background: linear-gradient(135deg, #343a40 0%, #2d3136 100%);
    border: 1px solid #495057;
    color: #f8f9fa;
    font-size: 0.9rem;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

#sidebarSearch::placeholder {
    color: #999;
}

#sidebarSearch:focus {
    background: linear-gradient(135deg, #404550 0%, #383e48 100%);
    border-color: #0d6efd;
    color: #f8f9fa;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

.accordion-item {
    border: none;
    background: transparent;
    margin-bottom: 0.5rem;
}

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

.accordion-button {
    padding: 0.9rem 1.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    background: linear-gradient(135deg, #2d3136 0%, #262a2f 100%);
    color: #ffffff;
    border: 1px solid #495057;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 0.25rem;
}

.accordion-button:hover {
    background: linear-gradient(135deg, #404550 0%, #3a3f4a 100%);
    border-color: #0d6efd;
    color: #0dcaf0;
    transform: translateX(4px);
    text-shadow: 0 0 8px rgba(13, 202, 240, 0.3);
}

.accordion-button:not(.collapsed) {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

.accordion-button:not(.collapsed):hover {
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.35);
}

.accordion-button:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.accordion-body {
    padding: 0.5rem 0;
    background: transparent;
}

.nav-link {
    padding: 0.65rem 1.5rem;
    font-size: 0.9rem;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    color: #ffffff !important;
    border-radius: 6px;
    margin: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-link i {
    color: #0d6efd;
    font-weight: 600;
}

.nav-link:hover,
.nav-link.hover-highlight {
    background: linear-gradient(135deg, #343a40 0%, #2d3136 100%);
    border-left-color: #0dcaf0;
    color: #ffffff !important;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(13, 202, 240, 0.15);
}

.nav-link:hover i {
    transform: scale(1.2);
    color: #0dcaf0;
}

.nav-link.active {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
    border-left-color: #0dcaf0;
    color: white !important;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
    font-weight: 600;
}

.nav-link.active i {
    color: white;
}

/* ==============================
   Mobile Header
   ============================== */
/* Mobile Header Overrides */
.mobile-header {
    background: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border-color) !important;
    padding: 0.75rem 1.25rem !important;
}

.mobile-header h5 {
    color: var(--text-primary) !important;
    font-weight: 700 !important;
}

.mobile-header .btn-dark {
    background: var(--bg-surface-hover) !important;
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.mobile-header .btn-dark i {
    color: var(--text-primary) !important;
}

/* ==============================
   Main Content
   ============================== */
main {
    margin-left: 0;
    padding: 20px !important;
    min-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    flex: 1;
    transition: margin-left 0.3s ease;
}

@media (min-width: 768px) {
    main {
        margin-left: 16.666667%;
    }
    .sidebar {
        display: flex !important;
    }
}

@media (min-width: 992px) {
    main {
        margin-left: 16.666667%;
    }
    .sidebar {
        display: flex !important;
    }
}

.utility-section {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

.theme-dark .utility-section {
    background: #23272b !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3) !important;
}

/* ==============================
   Result Box (Critical)
   ============================== */
.result-box {
    position: relative;
    padding: 15px;
    margin: 20px 0;
    border: 2px solid #dee2e6;
    border-radius: var(--border-radius);
    background: #f8f9fa;
    color: #222;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    white-space: pre-wrap;
    overflow: visible;
    transition: var(--transition);
}

.result-box:hover {
    border-color: #0d6efd;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

.result-box.success {
    border-color: #198754;
    background: #f0f9f6;
}

.result-box.error {
    border-color: #dc3545;
    background: #fdf6f7;
}

.result-box.warning {
    border-color: #ffc107;
    background: #fffbf0;
}

.result-box > * { 
    margin-bottom: 12px; 
}

.result-box > *:last-child { 
    margin-bottom: 0; 
}

/* Dark mode */
.theme-dark .result-box {
    background: #2d3748 !important;
    border-color: #404a54 !important;
    color: #f8f9fa !important;
}

.theme-dark .result-box:hover {
    border-color: #0d6efd !important;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25) !important;
}

.theme-dark .result-box.success {
    border-color: #198754 !important;
    background: #1a3a2a !important;
}

.theme-dark .result-box.error {
    border-color: #dc3545 !important;
    background: #3a1a1f !important;
}

/* ==============================
   Code & Pre
   ============================== */
.result-box pre,
.result-box code,
.hljs,
pre.hljs,
#pojoCode,
#xmlCode {
    white-space: pre !important;
    word-break: normal !important;
    overflow-x: auto !important;
    overflow-wrap: normal !important;
    display: block !important;
    margin: 0;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Fira Mono','Consolas','Menlo','Monaco','Courier New',monospace !important;
    font-size: 0.95rem;
    line-height: 1.6;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.theme-dark .result-box pre,
.theme-dark pre {
    background: #2d3748 !important;
    border-color: #4a5568 !important;
    color: #e2e8f0 !important;
}

/* ==============================
   Copy Button
   ============================== */
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 50px;
    cursor: pointer;
    opacity: 0;
    transition: var(--transition);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.copy-btn:hover {
    background: linear-gradient(135deg, #157347 0%, #126038 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    opacity: 1;
}

.copy-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.result-box:hover .copy-btn { 
    opacity: 1; 
}

/* ==============================
   Forms & Inputs
   ============================== */
.form-control,
.form-select {
    border-radius: 6px;
    border: 2px solid #ced4da;
    padding: 10px 12px;
    font-size: 1rem;
    background: #fff;
    transition: var(--transition);
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: none;
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    font-family: 'Fira Mono','Consolas','Menlo','Monaco','Courier New',monospace;
}

textarea.form-control:focus {
    background: #f8ffff;
}

.form-label {
    font-weight: 500;
    color: #333;
    margin-bottom: 0.5rem;
}

.theme-dark .form-control,
.theme-dark .form-select {
    background: #23272b !important;
    color: #f8f9fa !important;
    border-color: #404a54 !important;
}

.theme-dark .form-label {
    color: #e2e8f0 !important;
}

/* ==============================
   Buttons
   ============================== */
.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.6rem 1.2rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: #fff;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #0b5ed7 0%, #0a58ca 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, #198754 0%, #157347 100%);
    color: #fff;
}

.btn-success:hover {
    background: linear-gradient(135deg, #157347 0%, #126038 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #000;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #fd7e14 0%, #f76707 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
    color: #fff;
}

.btn-info {
    background: linear-gradient(135deg, #0dcaf0 0%, #31d0c1 100%);
    color: #000;
}

.btn-outline-primary {
    border: 2px solid #0d6efd;
    color: #0d6efd;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #0d6efd;
    color: white;
}

.btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ==============================
   Loading & Animations
   ============================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 3px solid rgba(13, 110, 253, 0.2);
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ==============================
   History Panel
   ============================== */
.history-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.theme-dark .history-item {
    background: #23272b !important;
    border-color: #404a54 !important;
}

.history-item:hover {
    border-color: #0d6efd;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
    transform: translateX(4px);
}

.history-item-time {
    font-size: 0.8rem;
    color: #999;
}

.history-item-content {
    font-family: 'Fira Mono','Consolas','Menlo','Monaco','Courier New',monospace;
    font-size: 0.85rem;
    max-height: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-all;
}

.history-item-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.history-item-actions button {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* ==============================
   Alerts & Tooltips
   ============================== */
.alert {
    border-radius: var(--border-radius);
    border: 1px solid;
    padding: 1rem;
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

.alert-info {
    background: #cfe2ff;
    border-color: #b6d4fe;
    color: #084298;
}

.theme-dark .alert-info {
    background: #1a3a52 !important;
    border-color: #2d5f7f !important;
    color: #6ea8ff !important;
}

.alert-success {
    background: #d1e7dd;
    border-color: #badbcc;
    color: #0f5132;
}

.alert-warning {
    background: #fff3cd;
    border-color: #ffecb5;
    color: #664d03;
}

.alert-danger {
    background: #f8d7da;
    border-color: #f5c2c7;
    color: #842029;
}

/* ==============================
   Responsive Fixes
   ============================== */
@media (max-width: 767.98px) {
    .sidebar {
        display: none !important;
        width: 0 !important;
        min-width: 0 !important;
        max-width: 0 !important;
    }
    main {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px !important;
    }
    .utility-section {
        padding: 1.5rem 1rem;
    }
    .result-box { 
        padding: 12px; 
        margin: 15px 0; 
    }
    pre { 
        padding: 12px; 
        font-size: 0.85rem; 
    }
    .copy-btn { 
        padding: 8px 12px; 
        font-size: 0.8rem; 
        min-width: 60px; 
    }
    .button-group {
        gap: 0.3rem;
    }
    .btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
        min-height: 44px; /* Better touch target */
        touch-action: manipulation; /* Prevent double-tap zoom */
    }
    .hero-banner {
        padding: 2rem 1rem;
    }
    .hero-banner h1 {
        font-size: 1.75rem;
    }
    .feature-badges {
        justify-content: center;
    }
    /* Better touch targets for mobile */
    .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    .form-control,
    .form-select {
        min-height: 44px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    /* Improved mobile spacing */
    .utility-section {
        margin-bottom: 1.5rem;
    }
    .button-group {
        flex-direction: column;
    }
    .button-group .btn {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .theme-selector {
        flex-direction: column;
        align-items: flex-start;
    }
    .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px; /* Better touch target */
    }
    .button-group {
        flex-direction: column;
    }
    /* Improve mobile header */
    .mobile-header {
        padding: 0.75rem 1rem;
    }
    /* Better mobile text sizes */
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    /* Improve mobile result boxes */
    .result-box {
        font-size: 0.9rem;
        word-break: break-word;
    }
}

/* ==============================
   Breadcrumb Navigation
   ============================== */
#breadcrumb-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

#breadcrumb-nav span {
    display: inline-block;
}

/* ==============================
   Utility Badge
   ============================== */
.utility-badge {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ==============================
   Drag & Drop
   ============================== */
.dragover {
    border: 2px dashed #0d6efd;
    background: rgba(13, 110, 253, 0.05);
}

/* ==============================
   Utility Descriptions
   ============================== */
.utility-description {
    background: #e7f3ff;
    border-left: 4px solid #0d6efd;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.theme-dark .utility-description {
    background: #1a3a52 !important;
    border-left-color: #0d6efd !important;
    color: #6ea8ff !important;
}

/* ==============================
   Tabs for Split View
   ============================== */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
}

.nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: #666;
    font-weight: 500;
}

.nav-tabs .nav-link:hover {
    border-bottom-color: #0d6efd;
    color: #0d6efd;
}

.nav-tabs .nav-link.active {
    border-bottom-color: #0d6efd;
    color: #0d6efd;
    background: transparent;
}

/* ==============================
   Keyboard Shortcuts
   ============================== */
kbd {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    display: inline-block;
    min-width: 2.5rem;
    text-align: center;
    white-space: nowrap;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    vertical-align: middle;
    margin: 0 0.2rem;
}

kbd:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.theme-dark kbd {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%) !important;
    color: white !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(13, 202, 240, 0.3) !important;
}

.theme-dark kbd:hover {
    box-shadow: 0 6px 16px rgba(13, 202, 240, 0.4) !important;
}

.shortcuts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.shortcut-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
    transition: all 0.3s ease;
}

.shortcut-item:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
    background: #eff6ff;
}

.theme-dark .shortcut-item {
    background: #2d2d2d;
    border-left-color: #6ea8ff;
}

.theme-dark .shortcut-item:hover {
    background: #3a3a3a;
    box-shadow: 0 4px 12px rgba(110, 168, 255, 0.2);
}

.shortcut-key {
    flex-shrink: 0;
    min-width: 80px;
}

.shortcut-key kbd {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.shortcut-desc {
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.4;
}

.theme-dark .shortcut-desc {
    color: #b0b0b0;
}

/* Modal Shortcuts Grid */
.shortcuts-modal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
}

.shortcut-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e7f1ff 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    text-align: center;
}

.shortcut-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.15);
    border-color: #0d6efd;
}

.theme-dark .shortcut-card {
    background: linear-gradient(135deg, #2d2d2d 0%, #3a3a4a 100%);
    border-color: #444;
}

.theme-dark .shortcut-card:hover {
    border-color: #6ea8ff;
    box-shadow: 0 8px 20px rgba(110, 168, 255, 0.2);
}

.shortcut-key-large {
    display: flex;
    align-items: center;
    justify-content: center;
}

.shortcut-key-large kbd {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    font-size: 1.1rem;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.3);
    min-width: auto;
}

.shortcut-action {
    color: #495057;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.5;
}

.theme-dark .shortcut-action {
    color: #b0b0b0;
}

/* ==============================
   FAQ Steps Styling
   ============================== */
.faq-steps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0;
}

.step-item {
    display: flex;
    gap: 1.2rem;
    align-items: flex-start;
    padding: 1rem 1.2rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.step-item:hover {
    background: #eff6ff;
    border-left-color: #0d6efd;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.1);
}

.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

.step-content {
    flex: 1;
    margin: 0;
}

.step-content p {
    margin: 0;
    color: #212529;
    line-height: 1.6;
    font-size: 0.95rem;
    font-weight: 500;
}

.step-content kbd {
    margin: 0 0.3rem;
}

.theme-dark .step-item {
    background: #2d3136;
    color: #e0e0e0;
    border-left-color: transparent;
}

.theme-dark .step-item:hover {
    background: #343a40;
    border-left-color: #0dcaf0;
    box-shadow: 0 4px 12px rgba(13, 202, 240, 0.2);
}

.theme-dark .step-content p {
    color: #ffffff;
    font-weight: 500;
}

/* ==============================
   FAQ Content Boxes
   ============================== */
.faq-content-box {
    padding: 1rem 0;
    line-height: 1.7;
}

.faq-content-box p {
    margin-bottom: 0.75rem;
    color: #212529;
    font-weight: 500;
    line-height: 1.7;
}

.faq-content-box kbd {
    margin: 0 0.25rem;
}

.theme-dark .faq-content-box p {
    color: #ffffff;
    font-weight: 500;
}

.theme-options {
    list-style: none;
    padding: 1rem 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.theme-options li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.95rem;
    border-left: 3px solid #0d6efd;
    color: #212529;
    font-weight: 500;
}

.theme-dark .theme-options li {
    background: #2d3136;
    border-left-color: #0dcaf0;
    color: #ffffff;
    font-weight: 500;
}

.option-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    min-width: 60px;
    text-align: center;
}

.option-badge.light {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    box-shadow: 0 2px 6px rgba(255, 152, 0, 0.2);
}

.option-badge.dark {
    background: linear-gradient(135deg, #495057 0%, #212529 100%);
    box-shadow: 0 2px 6px rgba(33, 37, 41, 0.2);
}

.option-badge.system {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.2);
}

.option-badge.system {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
    box-shadow: 0 2px 6px rgba(13, 110, 253, 0.2);
}

/* Feature Highlights */
.feature-highlight {
    display: flex;
    align-items: center;
    padding: 1rem 1.2rem;
    background: linear-gradient(135deg, #e7f1ff 0%, #f0e7ff 100%);
    border-left: 4px solid #0d6efd;
    border-radius: 8px;
    font-weight: 500;
    color: #0d3b66;
    gap: 0.5rem;
}

.feature-highlight.success {
    background: linear-gradient(135deg, #d1ffe7 0%, #e1ffe7 100%);
    border-left-color: #198754;
    color: #0b5345;
}

.theme-dark .feature-highlight {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.2) 0%, rgba(102, 126, 234, 0.2) 100%);
    color: #6ea8ff;
}

.theme-dark .feature-highlight.success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.2) 0%, rgba(25, 135, 84, 0.15) 100%);
    color: #6dda8e;
}

/* Format List */
.format-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.format-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* Feature List */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.feature-list li {
    display: flex;
    align-items: center;
    padding: 0.6rem 0.8rem;
    background: #f8f9fa;
    border-radius: 6px;
    color: #495057;
    font-size: 0.95rem;
    border-left: 3px solid #198754;
}

.theme-dark .feature-list li {
    background: #2d2d2d;
    color: #b0b0b0;
    border-left-color: #6dda8e;
}

.feature-list i {
    color: #198754;
    font-weight: 600;
}

.theme-dark .feature-list i {
    color: #6dda8e;
}

/* Security Banner */
.security-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #d1ffe7 0%, #c8e6c9 100%);
    border-radius: 12px;
    border: 2px solid #198754;
}

.security-banner i {
    font-size: 2rem;
    color: #198754;
    flex-shrink: 0;
}

.security-banner strong {
    color: #0b5345;
    font-size: 1.1rem;
}

.security-banner p {
    color: #1b5e20;
    margin-bottom: 0 !important;
}

.theme-dark .security-banner {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.2) 0%, rgba(25, 135, 84, 0.15) 100%);
    border-color: #6dda8e;
}

.theme-dark .security-banner i,
.theme-dark .security-banner strong,
.theme-dark .security-banner p {
    color: #6dda8e;
}

/* Security Features */
.security-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.security-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem;
    background: #f8f9fa;
    border-radius: 8px;
    color: #495057;
    font-size: 0.95rem;
}

.security-item i {
    color: #198754;
    font-weight: 600;
    flex-shrink: 0;
}

.theme-dark .security-item {
    background: #2d2d2d;
    color: #b0b0b0;
}

.theme-dark .security-item i {
    color: #6dda8e;
}

/* ==============================
   FAQ Accordion Items
   ============================== */
.accordion-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.75rem;
    transition: all 0.3s ease;
}

.accordion-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.accordion-button {
    font-weight: 500;
    color: #212529;
    padding: 1.2rem;
    transition: all 0.3s ease;
}

.accordion-button:not(.collapsed) {
    background-color: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
    box-shadow: none;
}

.accordion-button:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
}

.accordion-body {
    padding: 1.5rem;
    line-height: 1.7;
}

.accordion-body ol,
.accordion-body ul {
    margin-bottom: 0;
}

.accordion-body li {
    margin-bottom: 0.5rem;
}

/* ==============================
   Security & Privacy Center
   ============================== */
.security-center-banner {
    margin-bottom: 2rem;
}

.security-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e7f1ff 100%);
    border: 2px solid #0d6efd;
    border-radius: 12px;
    padding: 1.75rem;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.security-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, transparent 100%);
    pointer-events: none;
}

.security-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(13, 110, 253, 0.2);
    border-color: #0dcaf0;
}

.security-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
}

.security-card h5 {
    color: #0d6efd;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.security-card p {
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.6;
}

.theme-dark .security-card {
    background: linear-gradient(135deg, #2d3136 0%, #232830 100%);
    border-color: #0dcaf0;
    color: #e0e0e0;
}

.theme-dark .security-card h5 {
    color: #0dcaf0;
}

.theme-dark .security-card p {
    color: #b0b0b0;
}

.theme-dark .security-card:hover {
    box-shadow: 0 8px 24px rgba(13, 202, 240, 0.2);
}

/* Privacy Content Styling */
.privacy-content {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 8px;
    line-height: 1.8;
}

.theme-dark .privacy-content {
    background: #1a1d20;
    color: #e0e0e0;
}

.privacy-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.privacy-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e0e0e0;
    color: #212529;
    font-size: 0.95rem;
}

.privacy-list li:last-child {
    border-bottom: none;
}

.theme-dark .privacy-list li {
    border-bottom-color: #444;
    color: #b0b0b0;
}

.privacy-list strong {
    color: #0d6efd;
    font-weight: 600;
}

.theme-dark .privacy-list strong {
    color: #0dcaf0;
}

.privacy-list li i {
    min-width: 1.2rem;
}

/* Security Features Grid */
.security-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.security-feature-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0d6efd;
    transition: all 0.3s ease;
}

.security-feature-item:hover {
    background: #eff6ff;
    transform: translateX(8px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.1);
}

.theme-dark .security-feature-item {
    background: #2d3136;
    border-left-color: #0dcaf0;
}

.theme-dark .security-feature-item:hover {
    background: #343a40;
}

.security-feature-icon {
    font-size: 1.5rem;
    min-width: 2rem;
    text-align: center;
}

.security-feature-text {
    flex: 1;
}

.security-feature-text h6 {
    margin: 0 0 0.25rem 0;
    font-weight: 600;
    color: #212529;
}

.theme-dark .security-feature-text h6 {
    color: #ffffff;
}

.security-feature-text p {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
}

.theme-dark .security-feature-text p {
    color: #b0b0b0;
}

/* Privacy Badge */
.privacy-badge {
    display: inline-block;
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    box-shadow: 0 2px 8px rgba(25, 135, 84, 0.2);
}

.privacy-badge.verified {
    background: linear-gradient(135deg, #0d6efd 0%, #0dcaf0 100%);
}

.theme-dark .accordion-item {
    border-color: #444;
    background-color: #2d2d2d;
}

.theme-dark .accordion-button {
    color: #e0e0e0;
    background-color: #2d2d2d;
}

.theme-dark .accordion-button:not(.collapsed) {
    background-color: rgba(13, 110, 253, 0.2);
    color: #6ea8ff;
}

/* ==============================
   Animations
   ============================== */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

/* ==============================
   Loading States
   ============================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* ==============================
   Enhanced Accessibility
   ============================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #0d6efd;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10001;
}

.skip-link:focus {
    top: 0;
}

/* Focus visible improvements */
*:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
    border-radius: 4px;
}

.btn:focus-visible,
.form-control:focus-visible,
.form-select:focus-visible {
    outline: 3px solid #0d6efd;
    outline-offset: 2px;
}

/* ==============================
   Enhanced Tooltips
   ============================== */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 12px;
    background: #212529;
    color: white;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #212529;
    z-index: 1000;
    margin-bottom: 2px;
}

.theme-dark [data-tooltip]:hover::after {
    background: #0dcaf0;
    color: #212529;
}

.theme-dark [data-tooltip]:hover::before {
    border-top-color: #0dcaf0;
}

/* ==============================
   Enhanced Error Messages
   ============================== */
.error-message {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c2c7 100%);
    border: 2px solid #dc3545;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInUp 0.3s ease-out;
}

.error-message i {
    font-size: 1.5rem;
    color: #dc3545;
    flex-shrink: 0;
}

.theme-dark .error-message {
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.2) 0%, rgba(220, 53, 69, 0.15) 100%);
    border-color: #dc3545;
    color: #f8d7da;
}

.success-message {
    background: linear-gradient(135deg, #d1e7dd 0%, #badbcc 100%);
    border: 2px solid #198754;
    border-radius: 8px;
    padding: 1rem;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInUp 0.3s ease-out;
}

.success-message i {
    font-size: 1.5rem;
    color: #198754;
    flex-shrink: 0;
}

.theme-dark .success-message {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.2) 0%, rgba(25, 135, 84, 0.15) 100%);
    border-color: #198754;
    color: #d1e7dd;
}

/* ==============================
   File Upload Enhancement
   ============================== */
.file-upload-area {
    border: 2px dashed #0d6efd;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    background: rgba(13, 110, 253, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    background: rgba(13, 110, 253, 0.1);
    border-color: #0b5ed7;
}

.file-upload-area.dragover {
    background: rgba(13, 110, 253, 0.15);
    border-color: #0a58ca;
    transform: scale(1.02);
}

.file-upload-area i {
    font-size: 3rem;
    color: #0d6efd;
    margin-bottom: 1rem;
    display: block;
}

.theme-dark .file-upload-area {
    background: rgba(13, 110, 253, 0.1);
    border-color: #0dcaf0;
}

.theme-dark .file-upload-area:hover {
    background: rgba(13, 202, 240, 0.15);
    border-color: #0dcaf0;
}

.theme-dark .file-upload-area i {
    color: #0dcaf0;
}

/* ==============================
   Enhanced Input States
   ============================== */
.form-control:invalid,
.form-select:invalid {
    border-color: #dc3545;
}

.form-control:valid:not(:placeholder-shown),
.form-select:valid:not(:placeholder-shown) {
    border-color: #198754;
}

.form-control:focus:invalid {
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

.form-control:focus:valid {
    box-shadow: 0 0 0 0.2rem rgba(25, 135, 84, 0.25);
}

/* ==============================
   Smooth Transitions
   ============================== */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.btn, .form-control, .form-select, .nav-link {
    transition: all 0.2s ease;
}

/* ==============================
   Print Styles
   ============================== */
@media print {
    .sidebar,
    .mobile-header,
    .footer-section,
    .header-section,
    .button-group {
        display: none;
    }
    .result-box {
        page-break-inside: avoid;
    }
}
