/*
Theme Name: HTML Beautifier & Minifier
Theme URI: https://htmlbeautifier.org/
Author: Admin
Author URI: https://htmlbeautifier.org/
Description: Modern minimalist HTML beautifier WordPress theme
Version: 2.0
License: GPL v2 or later
Text Domain: htmlbeautifier
*/

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

:root {
    /* Core Palette */
    --bg-primary: #0F172E;
    --bg-secondary: #1A2847;
    --bg-tertiary: #242F45;
    --bg-surface: #FFFFFF;
    --bg-surface-alt: #F8F9FA;
    
    /* Accent */
    --accent: #4F46E5;
    --accent-hover: #4338CA;
    --accent-light: #EEF2FF;
    
    /* Text */
    --text-primary: #0F172E;
    --text-secondary: #52525B;
    --text-tertiary: #A1A1AA;
    --text-inverse: #FFFFFF;
    
    /* Borders & Dividers */
    --border-light: #E4E4E7;
    --border-medium: #D4D4D8;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    /* Spacing & Radius */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    /* Transitions */
    --transition: 200ms ease-out;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    background: var(--bg-surface);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    -webkit-tap-highlight-color: transparent;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
}

.app-wrapper {
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 1rem;
}

@media (min-width: 1024px) {
    .app-wrapper {
        padding: 0 2rem;
    }
}

/* ============================================
   NAVIGATION
   ============================================ */
.navbar {
    background: var(--bg-surface);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    position: relative;
    z-index: 1000;
    min-height: 64px;
}

@media (min-width: 768px) {
    .navbar {
        padding: 0.75rem 2rem;
    }
}

.navbar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}

.navbar-logo img {
    max-height: 32px;
    width: auto;
}

.navbar-logo span {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

/* Hamburger */
.nav-hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.nav-hamburger:hover {
    background: var(--bg-surface-alt);
}

.nav-hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 1px;
    transition: var(--transition);
}

.nav-hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(4px, 4px);
}

.nav-hamburger.active span:nth-child(2) {
    opacity: 0;
}

.nav-hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(4px, -4px);
}

@media (min-width: 1024px) {
    .nav-hamburger {
        display: none;
    }
}

.nav-links-wrapper {
    display: none;
    width: 100%;
    flex-direction: column;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-light);
    margin-top: 0.5rem;
}

.nav-links-wrapper.active {
    display: flex;
}

@media (min-width: 1024px) {
    .nav-links-wrapper {
        display: flex !important;
        width: auto;
        flex-direction: row;
        padding-top: 0;
        border-top: none;
        margin-top: 0;
        align-items: center;
        gap: 0.25rem;
    }
}

.nav-links {
    display: flex;
    flex-direction: column;
    list-style: none;
    gap: 0;
    width: 100%;
}

@media (min-width: 1024px) {
    .nav-links {
        flex-direction: row;
        align-items: center;
        gap: 0.25rem;
        width: auto;
    }
}

.nav-links > li {
    position: relative;
    width: 100%;
}

@media (min-width: 1024px) {
    .nav-links > li {
        width: auto;
    }
}

.nav-links > li > a {
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-primary);
    padding: 0.625rem 1rem;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    transition: var(--transition);
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    width: 100%;
}

@media (min-width: 1024px) {
    .nav-links > li > a {
        width: auto;
        justify-content: center;
    }
}

.nav-links > li > a:hover,
.nav-links > li > a.active {
    background: var(--accent-light);
    color: var(--accent);
}

.nav-links > li > a .arrow {
    font-size: 0.65rem;
    transition: var(--transition);
    display: inline-block;
    flex-shrink: 0;
}

.nav-links > li > a .arrow.open {
    transform: rotate(180deg);
}

/* Dropdown */
.dropdown-menu {
    display: none;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    padding: 0.5rem 0;
    list-style: none;
    width: 100%;
    margin-top: 0.25rem;
    border: 1px solid var(--border-light);
}

.dropdown-menu.open {
    display: block;
}

@media (min-width: 1024px) {
    .dropdown-menu {
        position: absolute;
        top: calc(100%);
        left: 50%;
        transform: translateX(-50%);
        min-width: 480px;
        padding: 0.75rem;
        margin-top: 0;
        width: auto;
        box-shadow: var(--shadow-lg);
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity var(--transition), visibility var(--transition);
        display: block !important;
    }

    .nav-links > li.dropdown:hover > .dropdown-menu {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    .nav-links > li.dropdown:hover > .dropdown-toggle .arrow {
        transform: rotate(180deg);
    }

    .dropdown-menu.open-desktop {
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }
}

.dropdown-menu li {
    width: 100%;
}

.dropdown-menu a {
    text-decoration: none;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.dropdown-menu a:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.dropdown-menu .dropdown-title {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    padding: 0.5rem 0.75rem;
    cursor: default;
    margin-top: 0.5rem;
}

.dropdown-menu .dropdown-title:first-child {
    margin-top: 0;
}

.mega-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

@media (min-width: 480px) {
    .mega-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 768px) {
    .mega-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
}

.mega-grid .col {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mega-grid .col .col-title {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-tertiary);
    padding: 0.5rem 0.75rem;
    cursor: default;
}

.btn-primary-nav {
    background: var(--accent);
    color: var(--text-inverse) !important;
    border-radius: var(--radius-lg) !important;
    padding: 0.625rem 1.25rem !important;
    font-weight: 600 !important;
    box-shadow: var(--shadow-sm);
    transition: var(--transition) !important;
    border: none !important;
    white-space: nowrap;
}

.btn-primary-nav:hover {
    background: var(--accent-hover) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

@media (min-width: 1024px) {
    .btn-primary-nav {
        margin-left: 0.5rem;
    }
}

/* ============================================
   WORKSPACE
   ============================================ */
.workspace {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 2rem;
}

@media (min-width: 1024px) {
    .workspace {
        grid-template-columns: minmax(0, 1fr) 180px minmax(0, 1fr);
        gap: 1.5rem;
    }
}

.editor-card {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: box-shadow var(--transition);
    border: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
}

.editor-card:hover {
    box-shadow: var(--shadow-lg);
}

/* Fullscreen editor mode */
.editor-card.is-fullscreen {
    position: fixed;
    inset: 0;
    z-index: 9500;
    max-width: none;
    width: 100vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    padding: 1.5rem;
}

.editor-card.is-fullscreen .CodeMirror {
    height: calc(100vh - 180px) !important;
}

body.editor-fullscreen-active {
    overflow: hidden;
}

.badge-fullscreen {
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
}

.badge-fullscreen:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
    flex-shrink: 0;
}

.editor-header h3 {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.editor-header h3 span {
    background: var(--accent-light);
    padding: 0.25rem 0.6rem;
    border-radius: var(--radius-md);
    font-size: 0.65rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.editor-header-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.badge-clear,
.badge-paste,
.badge-upload,
.badge-url {
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.badge-clear {
    background: var(--bg-surface-alt);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.badge-clear:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.badge-paste {
    background: var(--accent);
    color: var(--text-inverse);
}

.badge-paste:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.badge-upload {
    background: #8B5CF6;
    color: var(--text-inverse);
}

.badge-upload:hover {
    background: #7C3AED;
    transform: translateY(-1px);
}

.badge-url {
    background: #06B6D4;
    color: var(--text-inverse);
}

.badge-url:hover {
    background: #0891B2;
    transform: translateY(-1px);
}

#fileInput {
    display: none;
}

/* URL modal */
.url-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 46, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    justify-content: center;
    align-items: center;
    padding: 1.5rem;
}

.url-modal.active {
    display: flex;
}

.url-modal-content {
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    padding: 2rem;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.3s ease;
    border: 1px solid var(--border-light);
}

@keyframes modalIn {
    from {
        transform: scale(0.95);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.url-modal-content h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
}

.url-modal-content p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

.url-modal-content .url-input-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.url-modal-content .url-input-group input {
    flex: 1;
    padding: 0.6rem 0.9rem;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-family: inherit;
    min-width: 200px;
    transition: border var(--transition);
    background: var(--bg-surface-alt);
}

.url-modal-content .url-input-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-surface);
    box-shadow: 0 0 0 3px var(--accent-light);
}

.url-modal-content .url-actions {
    display: flex;
    gap: 8px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.url-modal-content .url-actions button {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    -webkit-tap-highlight-color: transparent;
}

.url-modal-content .url-actions .btn-fetch {
    background: var(--accent);
    color: var(--text-inverse);
}

.url-modal-content .url-actions .btn-fetch:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.url-modal-content .url-actions .btn-cancel {
    background: var(--bg-surface-alt);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.url-modal-content .url-actions .btn-cancel:hover {
    background: var(--border-light);
}

/* CodeMirror */
.CodeMirror {
    height: 320px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-family: 'Fira Code', 'Jet Brains Mono', 'Source Code Pro', monospace;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-light);
    transition: border var(--transition), box-shadow var(--transition);
    width: 100%;
    min-height: 150px;
    max-width: 100%;
    background: #FAFBFC;
}

.CodeMirror pre.CodeMirror-line,
.CodeMirror pre.CodeMirror-line-like {
    word-break: break-word !important;
    overflow-wrap: anywhere !important;
}

@media (min-width: 768px) {
    .CodeMirror {
        height: 480px !important;
        font-size: 14px;
        min-height: 250px;
    }
}

@media (min-width: 1024px) {
    .CodeMirror {
        height: 520px !important;
    }
}

.CodeMirror-focused {
    border-color: var(--accent);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05), 0 0 0 3px var(--accent-light);
}

.CodeMirror-scroll {
    max-width: 100%;
}

/* Size stats */
.size-stats {
    display: flex;
    gap: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    padding: 0.75rem 1rem;
    background: var(--bg-surface-alt);
    border-radius: var(--radius-md);
    margin-top: 0.75rem;
    flex-wrap: wrap;
    border: 1px solid var(--border-light);
    flex-shrink: 0;
    min-height: 44px;
    align-items: center;
}

.size-stats strong {
    color: var(--text-primary);
    font-weight: 600;
}

.size-stats .stat-item {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.size-stats .stat-item .label {
    opacity: 0.8;
}

.size-stats .diff-positive {
    color: #DC2626;
}

.size-stats .diff-negative {
    color: #16A34A;
}

.size-stats .diff-neutral {
    color: var(--text-tertiary);
}

/* Toolbar */
.toolbar {
    padding: 0.5rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 100;
    min-height: 60px;
}

@media (min-width: 1024px) {
    .toolbar {
        flex-direction: column;
        position: sticky;
        top: 1.5rem;
        gap: 10px;
        min-height: auto;
        max-height: 70vh;
        overflow-y: auto;
    }
}

.toolbar .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    border: none;
    background: var(--bg-surface-alt);
    font-weight: 600;
    font-size: 0.75rem;
    padding: 0.5rem 0.8rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
    white-space: nowrap;
    flex: 1 1 auto;
    min-width: 60px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (min-width: 1024px) {
    .toolbar .btn {
        width: 100%;
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
        flex-direction: column;
        flex: none;
    }
}

.toolbar .btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
    border: none;
    box-shadow: var(--shadow-sm);
}

.toolbar .btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.toolbar .btn:hover:not(.btn-primary) {
    background: var(--border-light);
    border-color: var(--text-secondary);
    transform: translateY(-1px);
}

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

.toolbar .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    width: 100%;
}

@media (min-width: 1024px) {
    .toolbar .btn-group {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
}

/* ============================================
   ARTICLE & CONTENT
   ============================================ */
article {
    max-width: 900px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
}

.entry-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-light);
}

.entry-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.entry-content {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

.entry-content p {
    margin-bottom: 1.25rem;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin: 2rem 0;
    display: block;
    transition: transform var(--transition);
    border: 1px solid var(--border-light);
}

.entry-content img:hover {
    transform: scale(1.01);
}

.entry-content h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2.5rem 0 1rem;
    padding-left: 0;
    border-left: none;
    line-height: 1.3;
}

.entry-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.75rem 0 0.75rem;
}

.entry-content strong {
    color: var(--text-primary);
    font-weight: 700;
}

.entry-content ul,
.entry-content ol {
    padding-left: 1.5rem;
    margin: 1rem 0 1.25rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.feature-card {
    background: var(--bg-surface-alt);
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: all var(--transition);
    border: 1px solid var(--border-light);
}

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

.feature-card h4 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0.75rem 0 0.5rem;
}

.feature-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

.entry-content .btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    margin: 0.5rem 0.5rem 0.5rem 0;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
}

.entry-content .btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
}

.entry-content .btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.entry-content .btn-secondary {
    background: var(--bg-surface-alt);
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.entry-content .btn-secondary:hover {
    background: var(--border-light);
    transform: translateY(-1px);
}

.entry-content hr {
    border: none;
    height: 1px;
    background: var(--border-light);
    margin: 2rem 0;
}

/* ============================================
   STORY SECTION
   ============================================ */
.story-section {
    background: var(--bg-surface-alt);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
}

.story-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.3px;
    word-break: break-word;
}

.story-section h2:first-of-type {
    margin-top: 0;
}

.story-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: var(--text-primary);
}

.story-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.75rem;
    word-break: break-word;
    font-size: 0.95rem;
}

.story-section ul {
    padding-left: 1.5rem;
    margin: 0.75rem 0 1rem;
}

.story-section ul li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    line-height: 1.5;
    word-break: break-word;
}

hr {
    border: none;
    border-top: 1px solid var(--border-light);
    margin: 1.5rem 0;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    margin-top: 3rem;
    background: var(--bg-primary);
    padding: 2.5rem 1.5rem 1.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@media (min-width: 768px) {
    .footer {
        padding: 3rem 2.5rem 2rem;
        margin-top: 4rem;
    }
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-brand .logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.footer-brand .logo img {
    max-height: 32px;
    width: auto;
}

.footer-brand .logo span {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-inverse);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    max-width: 300px;
    line-height: 1.6;
}

.footer-social {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-inverse);
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.95rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-social a:hover {
    background: var(--accent);
    color: var(--text-inverse);
    transform: translateY(-2px);
    border-color: var(--accent);
}

.footer-heading {
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-inverse);
    margin-bottom: 1rem;
}

.footer-links-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-links-list a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.85rem;
    transition: var(--transition);
    display: inline-block;
}

.footer-links-list a:hover {
    color: var(--text-inverse);
    transform: translateX(2px);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
        text-align: left;
    }
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-bottom-links a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    transition: var(--transition);
}

.footer-bottom-links a:hover {
    color: var(--text-inverse);
}

/* ============================================
   TOAST & NOTIFICATIONS
   ============================================ */
.toast {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background: var(--text-primary);
    color: var(--text-inverse);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
    font-size: 0.85rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(120px);
    opacity: 0;
    transition: all var(--transition);
    z-index: 9999;
    text-align: center;
    max-width: 400px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.copy-success {
    background: #16A34A;
    border-color: rgba(22, 163, 74, 0.3);
}

/* ============================================
   LOADING SPINNER
   ============================================ */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(79, 70, 229, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 6px;
}

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

/* ============================================
   UTILITIES
   ============================================ */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* Print styles */
@media print {
    .navbar,
    .toolbar,
    .footer,
    .toast {
        display: none !important;
    }

    .editor-card {
        box-shadow: none !important;
        border: 1px solid var(--border-light) !important;
    }

    .CodeMirror {
        height: auto !important;
        min-height: 400px !important;
    }
}