* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', -apple-system, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-color: #020617;
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --accent-color: #38bdf8;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;

    --diff-added-bg: rgba(34, 197, 94, 0.15);
    --diff-added-border: #22c55e;
    --diff-added-word: rgba(34, 197, 94, 0.4);

    --diff-removed-bg: rgba(239, 68, 68, 0.15);
    --diff-removed-border: #ef4444;
    --diff-removed-word: rgba(239, 68, 68, 0.4);

    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Light mode variables */
body.light-mode {
    --bg-color: #f8fafc;
    --glass-bg: rgba(255, 255, 255, 0.8);
    --glass-border: rgba(0, 0, 0, 0.1);
    --accent-color: #0284c7;
    --text-primary: #0f172a;
    --text-secondary: #64748b;

    --diff-added-bg: rgba(34, 197, 94, 0.2);
    --diff-added-border: #16a34a;
    --diff-added-word: rgba(34, 197, 94, 0.5);

    --diff-removed-bg: rgba(239, 68, 68, 0.2);
    --diff-removed-border: #dc2626;
    --diff-removed-word: rgba(239, 68, 68, 0.5);

    --card-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
}

body {
    background: radial-gradient(circle at top left, #1e1b4b, #020617);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    transition: background 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body.light-mode {
    background: radial-gradient(circle at top left, #e0e7ff, #f8fafc);
}

header {
    padding: 2rem 1rem;
    text-align: center;
    position: relative;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.theme-toggle {
    position: absolute;
    right: 2rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    background: var(--accent-color);
    color: #020617;
    transform: translateY(-50%) scale(1.1);
}

h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: center;
}

.typing-header {
    background: linear-gradient(to bottom right, #0a66c2, #95b894);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 4px solid var(--accent-color);
    width: 0;
    animation:
        typing 6s steps(20) infinite,
        blink 0.8s step-end infinite;
}

/* body.light-mode .typing-header {
    background: linear-gradient(to bottom right, #0f172a, #334155);
} */

@keyframes typing {

    0%,
    10% {
        width: 0;
    }

    40%,
    60% {
        width: 255px;
    }

    /* Width for 'DiffCheck' at 3.5rem */
    90%,
    100% {
        width: 0;
    }
}

@keyframes blink {

    from,
    to {
        border-color: transparent
    }

    50% {
        border-color: var(--accent-color)
    }
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}

main {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1.5rem 5rem;
}

/* Glassmorphism Controls */
.controls {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--card-shadow);
}

.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.options-group {
    display: flex;
    gap: 2rem;
}

.option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.option:hover {
    color: var(--text-primary);
}

.option input {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--accent-color);
}

.btn {
    background: var(--accent-color);
    color: #020617;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 0 30px rgba(56, 189, 248, 0.4);
}

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

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.1);
}

#compareBtn {
    font-weight: bold;
    background-color: rgb(136, 200, 40);
}

#compareBtn:hover {
    background-color: rgb(120, 180, 35);
}

/* Progress Indicator */
.progress-indicator {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    padding: 1rem 2rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--accent-color);
    width: 0%;
    animation: progress 1.5s ease-in-out infinite;
}

@keyframes progress {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

.progress-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Diff Actions & Navigation */
.diff-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid var(--glass-border);
    gap: 1rem;
}

.nav-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-btn {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--accent-color);
    color: #020617;
}

.nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.change-counter {
    color: var(--text-secondary);
    font-size: 0.85rem;
    min-width: 60px;
    text-align: center;
}

.diff-export {
    display: flex;
    gap: 0.5rem;
}

.btn-export {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.3s;
}

.btn-export:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border-color: var(--accent-color);
}

/* Unified Diff View */
.diff-unified {
    padding: 1rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-break: break-all;
}

.diff-unified .diff-line {
    padding: 0.2rem 0.5rem;
}

.diff-unified .diff-line.removed {
    background: var(--diff-removed-bg);
}

.diff-unified .diff-line.added {
    background: var(--diff-added-bg);
}

.diff-unified .diff-line.unchanged {
    color: var(--text-secondary);
}

/* Hidden lines when showing only changes */
.diff-line.hidden {
    display: none;
}

/* Syntax highlighting overrides */
.diff-pane code[class*="language-"],
.diff-unified code[class*="language-"] {
    background: transparent !important;
    padding: 0 !important;
    font-size: inherit !important;
}

.diff-pane pre[class*="language-"],
.diff-unified pre[class*="language-"] {
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Light mode syntax highlighting */
body.light-mode .diff-pane code[class*="language-"],
body.light-mode .diff-unified code[class*="language-"] {
    color: #333 !important;
}

/* Side-by-Side Editor */
.comparison-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 1.5rem;
    min-height: 400px;
    /* Better than fixed height to allow for large editors */
}

.editor-container {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.editor-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
}

.editor-header h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    color: var(--text-secondary);
}

/* Hide default file input but keep it accessible */
.file-input-wrapper input[type=file] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.upload-link {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 0.8rem;
    background: rgba(56, 189, 248, 0.05);
    border: 1px solid rgba(56, 189, 248, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.upload-link:hover {
    background: rgba(56, 189, 248, 0.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.1);
}

textarea {
    width: 100%;
    height: 330px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-primary);
    border: none;
    padding: 1.5rem;
    resize: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    outline: none;
    transition: background 0.3s;
    -webkit-overflow-scrolling: touch;
}

body.light-mode textarea {
    background: rgba(0, 0, 0, 0.05);
}

textarea:focus {
    background: rgba(0, 0, 0, 0.3);
}

body.light-mode textarea:focus {
    background: rgba(0, 0, 0, 0.08);
}

/* Side-by-Side Result */
.diff-output {
    margin-top: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    display: none;
}

.diff-output.visible {
    display: block;
    animation: slideUp 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

.diff-side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.diff-pane {
    border-right: 1px solid var(--glass-border);
}

.diff-pane:last-child {
    border-right: none;
}

.diff-line {
    display: flex;
    min-height: 1.6rem;
    padding: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    word-break: break-all;
}

.line-num {
    min-width: 3.5rem;
    text-align: right;
    padding-right: 1rem;
    color: var(--text-secondary);
    opacity: 0.4;
    user-select: none;
    background: rgba(0, 0, 0, 0.1);
}

body.light-mode .line-num {
    background: rgba(0, 0, 0, 0.05);
}

.line-content {
    padding: 0 1rem;
    flex: 1;
}

/* Highlight Colors */
.diff-line.removed {
    background: var(--diff-removed-bg);
}

.diff-line.added {
    background: var(--diff-added-bg);
}

.diff-line.removed .line-num {
    background: rgba(239, 68, 68, 0.1);
    color: var(--diff-removed-border);
    opacity: 0.7;
}

.diff-line.added .line-num {
    background: rgba(34, 197, 94, 0.1);
    color: var(--diff-added-border);
    opacity: 0.7;
}

.word-removed {
    background: var(--diff-removed-word);
    border-radius: 3px;
}

.word-added {
    background: var(--diff-added-word);
    border-radius: 3px;
}

/* Stats & Header */
.diff-stats-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 2px solid var(--glass-border);
}

.stat-box {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.count-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 2rem;
    font-size: 0.8rem;
}

.btn-copy {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s;
}

.btn-copy:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.no-diff {
    margin: 10px;
    padding: 10px;
    font-size: x-large;
    color: yellowgreen;
    text-align: center;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid var(--diff-added-border);
    border-radius: 0.5rem;
}

@media (max-width: 1000px) {

    .comparison-grid,
    .diff-side-by-side,
    .diff-stats-header {
        grid-template-columns: 1fr;
    }

    .no-diff {
        margin: 10px;
        padding: 10px;
        font-size: x-large;
        color: yellowgreen;
    }

    .diff-pane {
        border-right: none;
        border-bottom: 1px solid var(--glass-border);
    }

    .controls {
        flex-direction: column;
        align-items: stretch;
    }

    .button-group {
        justify-content: center;
    }

    .diff-actions {
        flex-wrap: wrap;
    }

    .diff-export {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile responsive styles */
@media (max-width: 768px) {
    header {
        padding: 1.5rem 1rem;
    }

    h1 {
        font-size: 2rem;
        letter-spacing: -1px;
    }

    .typing-header {
        border-right-width: 3px;
    }

    .subtitle {
        font-size: 0.9rem;
    }

    .theme-toggle {
        right: 1rem;
        width: 36px;
        height: 36px;
    }

    main {
        padding: 0 1rem 3rem;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .editor-container {
        border-radius: 1rem;
    }

    .editor-header {
        padding: 0.75rem 1rem;
    }

    .editor-header h3 {
        font-size: 0.75rem;
    }

    .upload-link {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }

    textarea {
        height: 200px;
        padding: 1rem;
        font-size: 0.85rem;
    }

    .controls {
        padding: 1rem;
        gap: 1rem;
        border-radius: 1rem;
    }

    .options-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .option {
        font-size: 0.85rem;
    }

    .option input {
        width: 1rem;
        height: 1rem;
    }

    .button-group {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
        justify-content: center;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

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

    .diff-output {
        border-radius: 1rem;
    }

    .diff-stats-header {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .stat-box {
        padding: 0.75rem 1rem;
    }

    .diff-actions {
        padding: 0.5rem 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .nav-buttons {
        width: 100%;
        justify-content: center;
    }

    .change-counter {
        font-size: 0.8rem;
    }

    .diff-export {
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
    }

    .btn-export {
        flex: 1;
        justify-content: center;
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }

    .diff-line {
        font-size: 0.8rem;
    }

    .line-num {
        min-width: 2.5rem;
        padding-right: 0.5rem;
        font-size: 0.75rem;
    }

    .line-content {
        padding: 0 0.5rem;
    }

    footer {
        padding: 1.5rem 1rem;
        font-size: 0.85rem;
    }

    .footer-content {
        flex-direction: column;
        gap: 1.25rem;
        text-align: center;
        animation: fadeInUpMobile 0.6s ease-out;
    }

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

    footer p {
        font-size: 0.85rem;
        text-align: center;
        line-height: 1.5;
        animation: fadeIn 0.6s ease-out;
    }

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

    footer p a {
        display: inline-block;
        transition: transform 0.2s ease;
    }

    footer p a:active {
        transform: scale(0.95);
    }

    .dropdown-toggle {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
        min-height: 40px;
    }

    .dropdown-toggle i {
        transition: transform 0.3s ease;
    }

    .dropdown-toggle:active i {
        transform: rotate(180deg) scale(0.9);
    }

    .dropdown-menu {
        min-width: 180px;
        max-height: 300px;
        bottom: calc(100% + 8px);
        right: 50%;
        transform: translateX(50%) translateY(10px);
    }

    .footer-dropdown:hover .dropdown-menu,
    .footer-dropdown:focus-within .dropdown-menu {
        transform: translateX(50%) translateY(0);
    }

    .dropdown-menu a {
        padding: 0.6rem 0.9rem;
        font-size: 0.85rem;
        opacity: 1;
        transform: translateX(0);
    }

    .dropdown-divider {
        margin: 0.4rem 0;
        opacity: 1;
    }

    /* Make dropdown tap-friendly on mobile */
    .footer-dropdown .dropdown-menu {
        pointer-events: auto;
    }

    .dropdown-toggle:active {
        transform: translateY(0) scale(0.95);
    }

    .dropdown-toggle:active::before {
        width: 120%;
        height: 120%;
        opacity: 0.3;
    }

    .dropdown-toggle:active i {
        transform: rotate(180deg) scale(0.9);
    }

    /* Improve touch targets */
    .nav-btn {
        width: 36px;
        height: 36px;
    }

    .btn-copy {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }

    /* Ensure minimum touch targets */
    .btn {
        min-height: 44px;
    }

    .nav-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .btn-export {
        min-height: 36px;
    }

    /* Prevent horizontal scroll on mobile */
    body {
        overflow-x: hidden;
    }

    /* Adjust progress indicator for mobile */
    .progress-indicator {
        padding: 0.75rem 1rem;
    }

    .progress-text {
        font-size: 0.8rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
        letter-spacing: -0.5px;
    }

    .typing-header {
        border-right-width: 2px;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .theme-toggle {
        right: 0.5rem;
        width: 32px;
        height: 32px;
    }

    main {
        padding: 0 0.75rem 2rem;
    }

    .controls {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .option {
        font-size: 0.8rem;
    }

    .option input {
        width: 0.9rem;
        height: 0.9rem;
    }

    .btn {
        font-size: 0.85rem;
        padding: 0.7rem 0.9rem;
    }

    .diff-line {
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .line-num {
        min-width: 2rem;
        padding-right: 0.4rem;
        font-size: 0.7rem;
    }

    .line-content {
        padding: 0 0.4rem;
    }

    .diff-actions {
        padding: 0.5rem 0.75rem;
    }

    .nav-btn {
        width: 32px;
        height: 32px;
    }

    .change-counter {
        font-size: 0.75rem;
    }

    .btn-export {
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
    }

    .stat-box {
        padding: 0.5rem 0.75rem;
    }

    .stat-label {
        font-size: 0.85rem;
    }

    .btn-copy {
        padding: 0.35rem 0.6rem;
        font-size: 0.75rem;
    }

    footer {
        padding: 1rem 0.75rem;
        animation: slideInFooterMobile 0.8s ease-out;
    }

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

    /* Add subtle animation to footer content on mobile */
    .footer-content {
        animation: fadeInUpMobile 0.6s ease-out;
    }

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

    footer p {
        font-size: 0.8rem;
    }

    footer p a {
        transition: all 0.3s ease;
    }

    footer p a:hover {
        text-shadow: 0 0 10px var(--accent-color);
        transform: translateY(-2px);
    }

    footer p a:active {
        transform: translateY(0) scale(0.95);
    }

    footer p a:active::after {
        width: 100%;
    }

    .dropdown-toggle {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        min-height: 38px;
        animation: pulse 2s infinite;
    }

    .dropdown-toggle:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
    }

    .dropdown-toggle i {
        transition: transform 0.3s ease;
    }

    .dropdown-toggle:hover i {
        transform: rotate(180deg);
    }

    @keyframes pulse {
        0%, 100% {
            box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.4);
        }
        50% {
            box-shadow: 0 0 0 8px rgba(56, 189, 248, 0);
        }
    }

    .dropdown-menu {
        min-width: 160px;
        max-height: 250px;
        animation: fadeInDropdown 0.3s ease-out;
    }

    .dropdown-menu:hover {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
    }

    .dropdown-menu a {
        padding: 0.5rem 0.7rem;
        font-size: 0.8rem;
        opacity: 1;
        transform: translateX(0);
        transition: all 0.2s ease;
    }

    .dropdown-menu a:active {
        transform: scale(0.95) translateX(4px);
    }

    .dropdown-menu a:hover {
        box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
        transform: translateX(4px) translateY(-1px);
    }

    .dropdown-divider {
        margin: 0.3rem 0;
        opacity: 1;
    }

    /* Add subtle animation to dropdown on mobile */
    .dropdown-menu {
        animation: fadeInDropdown 0.3s ease-out;
    }

    .dropdown-menu.closing {
        animation: fadeOutDropdown 0.2s ease-out forwards;
    }

    @keyframes fadeInDropdown {
        from {
            opacity: 0;
            transform: translateX(50%) translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateX(50%) translateY(0);
        }
    }

    @keyframes fadeOutDropdown {
        from {
            opacity: 1;
            transform: translateX(50%) translateY(0);
        }
        to {
            opacity: 0;
            transform: translateX(50%) translateY(10px);
        }
    }

    /* Add subtle animation to dropdown items on mobile */
    .dropdown-menu a {
        animation: slideInItem 0.3s ease-out forwards;
        opacity: 0;
        transform: translateX(-10px);
    }

    .dropdown-menu.closing a {
        animation: none;
        opacity: 1;
        transform: translateX(0);
    }

    .dropdown-menu a:nth-child(1) {
        animation-delay: 0.05s;
    }

    .dropdown-menu a:nth-child(2) {
        animation-delay: 0.1s;
    }

    .dropdown-menu a:nth-child(3) {
        animation-delay: 0.15s;
    }

    .dropdown-menu a:nth-child(4) {
        animation-delay: 0.2s;
    }

    .dropdown-menu a:nth-child(5) {
        animation-delay: 0.25s;
    }

    .dropdown-menu a:nth-child(6) {
        animation-delay: 0.3s;
    }

    .dropdown-menu a:nth-child(7) {
        animation-delay: 0.35s;
    }

    .dropdown-menu a:nth-child(8) {
        animation-delay: 0.4s;
    }

    .dropdown-menu a:nth-child(9) {
        animation-delay: 0.45s;
    }

    .dropdown-menu a:nth-child(10) {
        animation-delay: 0.5s;
    }

    .dropdown-menu a:nth-child(11) {
        animation-delay: 0.55s;
    }

    .dropdown-menu a:nth-child(12) {
        animation-delay: 0.6s;
    }

    .dropdown-menu a:nth-child(13) {
        animation-delay: 0.65s;
    }

    .dropdown-menu a:nth-child(14) {
        animation-delay: 0.7s;
    }

    @keyframes slideInItem {
        from {
            opacity: 0;
            transform: translateX(-10px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }

    /* Adjust typing animation for very small screens */
    @keyframes typing {
        0%,
        10% {
            width: 0;
        }

        40%,
        60% {
            width: 180px;
        }

        90%,
        100% {
            width: 0;
        }
    }

    /* Improve touch targets on very small screens */
    .btn {
        min-height: 44px;
    }

    .nav-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .btn-export {
        min-height: 36px;
    }
}

footer {
    padding: 2rem 1rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.1));
    border-top: 1px solid var(--glass-border);
    margin-top: auto;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: slideInFooter 0.8s ease-out;
}

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

body.light-mode footer {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.02));
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    position: relative;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease-out;
}

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

footer p {
    margin: 0;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

footer p:hover {
    color: var(--text-primary);
}

footer a {
    color: var(--accent-color);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    padding: 2px 4px;
}

footer a:hover {
    color: var(--text-primary);
    text-shadow: 0 0 15px var(--accent-color), 0 0 30px var(--accent-color);
    transform: scale(1.05);
}

footer a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

footer a:hover::after {
    width: 100%;
}

/* Footer Dropdown */
.footer-dropdown {
    position: relative;
    z-index: 10;
}

.dropdown-toggle {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    font-size: 0.9rem;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    overflow: hidden;
}

.dropdown-toggle::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: var(--accent-color);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    opacity: 0.1;
}

.dropdown-toggle:hover::before {
    width: 200%;
    height: 200%;
}

.dropdown-toggle i {
    transition: transform 0.3s ease;
}

.dropdown-toggle span {
    font-weight: 500;
}

.dropdown-toggle:hover,
.dropdown-toggle:focus {
    background: var(--accent-color);
    color: #020617;
    transform: translateY(-2px);
    outline: none;
}

.dropdown-toggle:hover i,
.dropdown-toggle:focus i {
    transform: rotate(180deg);
}

body.light-mode .dropdown-toggle:hover,
body.light-mode .dropdown-toggle:focus {
    color: #0f172a;
}

.dropdown-menu {
    position: absolute;
    bottom: calc(100% + 10px);
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 0.5rem;
    min-width: 200px;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.05);
    z-index: 100;
}

.footer-dropdown:hover .dropdown-menu,
.footer-dropdown:focus-within .dropdown-menu,
.dropdown-toggle:focus+.dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    opacity: 0;
    transform: translateX(-10px);
}

.footer-dropdown:hover .dropdown-menu a,
.footer-dropdown:focus-within .dropdown-menu a {
    opacity: 1;
    transform: translateX(0);
}

/* Stagger animation for dropdown items */
.footer-dropdown:hover .dropdown-menu a:nth-child(1),
.footer-dropdown:focus-within .dropdown-menu a:nth-child(1) {
    transition-delay: 0.05s;
}

.footer-dropdown:hover .dropdown-menu a:nth-child(2),
.footer-dropdown:focus-within .dropdown-menu a:nth-child(2) {
    transition-delay: 0.1s;
}

.footer-dropdown:hover .dropdown-menu a:nth-child(3),
.footer-dropdown:focus-within .dropdown-menu a:nth-child(3) {
    transition-delay: 0.15s;
}

.footer-dropdown:hover .dropdown-menu a:nth-child(4),
.footer-dropdown:focus-within .dropdown-menu a:nth-child(4) {
    transition-delay: 0.2s;
}

.footer-dropdown:hover .dropdown-menu a:nth-child(5),
.footer-dropdown:focus-within .dropdown-menu a:nth-child(5) {
    transition-delay: 0.25s;
}

.footer-dropdown:hover .dropdown-menu a:nth-child(6),
.footer-dropdown:focus-within .dropdown-menu a:nth-child(6) {
    transition-delay: 0.3s;
}

.footer-dropdown:hover .dropdown-menu a:nth-child(7),
.footer-dropdown:focus-within .dropdown-menu a:nth-child(7) {
    transition-delay: 0.35s;
}

.footer-dropdown:hover .dropdown-menu a:nth-child(8),
.footer-dropdown:focus-within .dropdown-menu a:nth-child(8) {
    transition-delay: 0.4s;
}

.footer-dropdown:hover .dropdown-menu a:nth-child(9),
.footer-dropdown:focus-within .dropdown-menu a:nth-child(9) {
    transition-delay: 0.45s;
}

.footer-dropdown:hover .dropdown-menu a:nth-child(10),
.footer-dropdown:focus-within .dropdown-menu a:nth-child(10) {
    transition-delay: 0.5s;
}

.footer-dropdown:hover .dropdown-menu a:nth-child(11),
.footer-dropdown:focus-within .dropdown-menu a:nth-child(11) {
    transition-delay: 0.55s;
}

.footer-dropdown:hover .dropdown-menu a:nth-child(12),
.footer-dropdown:focus-within .dropdown-menu a:nth-child(12) {
    transition-delay: 0.6s;
}

.footer-dropdown:hover .dropdown-menu a:nth-child(13),
.footer-dropdown:focus-within .dropdown-menu a:nth-child(13) {
    transition-delay: 0.65s;
}

.footer-dropdown:hover .dropdown-menu a:nth-child(14),
.footer-dropdown:focus-within .dropdown-menu a:nth-child(14) {
    transition-delay: 0.7s;
}

.dropdown-menu a i {
    width: 1.2rem;
    text-align: center;
    transition: color 0.2s ease;
}

.dropdown-menu a:hover {
    background: var(--accent-color);
    color: #020617;
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(56, 189, 248, 0.3);
}

body.light-mode .dropdown-menu a:hover {
    color: #0f172a;
    box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.dropdown-menu a::after {
    display: none;
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.5rem 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.footer-dropdown:hover .dropdown-divider,
.footer-dropdown:focus-within .dropdown-divider {
    opacity: 1;
}

/* Light mode dropdown adjustments */
body.light-mode .dropdown-menu {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

body.light-mode .dropdown-divider {
    background: rgba(0, 0, 0, 0.1);
}

/* Dropdown scrollbar styling */
.dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.dropdown-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--accent-color);
    border-radius: 3px;
}

body.light-mode .dropdown-menu::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
}

/* Custom Tooltips */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    pointer-events: none;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    background: var(--glass-bg);
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 400;
    white-space: nowrap;
    max-width: 300px;
    white-space: normal;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Wider tooltips for control options */
.option[data-tooltip]::before {
    max-width: 350px;
}

[data-tooltip]::after {
    content: '';
    border: 6px solid transparent;
}

/* Top tooltip (default) */
[data-tooltip][data-position="top"]::before {
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
}

[data-tooltip][data-position="top"]::after {
    bottom: calc(100% - 2px);
    left: 50%;
    transform: translateX(-50%) translateY(5px);
    border-top-color: var(--glass-bg);
}

/* Bottom tooltip */
[data-tooltip][data-position="bottom"]::before {
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
}

[data-tooltip][data-position="bottom"]::after {
    top: calc(100% - 2px);
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    border-bottom-color: var(--glass-bg);
}

/* Left tooltip */
[data-tooltip][data-position="left"]::before {
    right: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(5px);
}

[data-tooltip][data-position="left"]::after {
    left: calc(100% - 2px);
    top: 50%;
    transform: translateY(-50%) translateX(5px);
    border-left-color: var(--glass-bg);
}

/* Right tooltip */
[data-tooltip][data-position="right"]::before {
    left: calc(100% + 10px);
    top: 50%;
    transform: translateY(-50%) translateX(-5px);
}

[data-tooltip][data-position="right"]::after {
    right: calc(100% - 2px);
    top: 50%;
    transform: translateY(-50%) translateX(-5px);
    border-right-color: var(--glass-bg);
}

/* Show tooltip on hover */
[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
}

[data-tooltip][data-position="top"]:hover::before,
[data-tooltip][data-position="top"]:hover::after {
    transform: translateX(-50%) translateY(0);
}

[data-tooltip][data-position="bottom"]:hover::before,
[data-tooltip][data-position="bottom"]:hover::after {
    transform: translateX(-50%) translateY(0);
}

[data-tooltip][data-position="left"]:hover::before,
[data-tooltip][data-position="left"]:hover::after {
    transform: translateY(-50%) translateX(0);
}

[data-tooltip][data-position="right"]:hover::before,
[data-tooltip][data-position="right"]:hover::after {
    transform: translateY(-50%) translateX(0);
}

/* Light mode tooltip adjustments */
body.light-mode [data-tooltip]::before {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body.light-mode [data-tooltip][data-position="top"]::after,
body.light-mode [data-tooltip][data-position="bottom"]::after {
    border-top-color: rgba(255, 255, 255, 0.95);
    border-bottom-color: rgba(255, 255, 255, 0.95);
}

body.light-mode [data-tooltip][data-position="left"]::after,
body.light-mode [data-tooltip][data-position="right"]::after {
    border-left-color: rgba(255, 255, 255, 0.95);
    border-right-color: rgba(255, 255, 255, 0.95);
}