* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --secondary-color: #06B6D4;
    --success-color: #10B981;
    --danger-color: #EF4444;
    --warning-color: #F59E0B;
    --dark-bg: #1F2937;
    --light-bg: #F9FAFB;
    --border-color: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #6B7280;
    --added-bg: #D1FAE5;
    --added-border: #10B981;
    --removed-bg: #FEE2E2;
    --removed-border: #EF4444;
    --editor-bg-left: linear-gradient(135deg, #e8f4fd 0%, #d6e9f7 100%);
    --editor-bg-right: linear-gradient(135deg, #fff4e6 0%, #ffecd1 100%);
    --editor-bg-left-dark: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --editor-bg-right-dark: linear-gradient(135deg, #451a03 0%, #78350f 100%);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.2);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

.container {
    flex-grow: 1;
    max-width: 1920px;
    width: 95%;
    margin: 2rem auto;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.95) 0%, rgba(118, 75, 162, 0.95) 100%);
    padding: 4rem 0 3rem;
    margin-top: -2rem;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 0 2rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 2rem;
}

/* Search Box */
.search-container {
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.search-box:focus-within {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 1rem;
    flex-shrink: 0;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: var(--text-primary);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin: 3rem 0 2rem;
}

.section-header h2 {
    font-size: 2rem;
    color: white;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.section-header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Tools Grid */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.tool-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.tool-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    margin-bottom: 1.5rem;
}

.tool-card h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.tool-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-container {
    max-width: 1920px;
    width: 95%;
    margin: 0 auto;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    justify-self: start;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo svg {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.header-nav {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: color 0.3s ease, background-color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
    background-color: rgba(79, 70, 229, 0.05);
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
    background-color: rgba(79, 70, 229, 0.1);
    box-shadow: 0 2px 5px rgba(79, 70, 229, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-self: end;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--primary-color);
}

.mobile-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
    border-top: 1px solid var(--border-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 99;
}

.mobile-nav.active {
    display: flex;
}

.mobile-nav-link {
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.mobile-nav-link:last-child {
    border-bottom: none;
}

.mobile-nav-link:hover {
    background: var(--light-bg);
}

.mobile-nav-link.active {
    background-color: rgba(79, 70, 229, 0.1);
    color: var(--primary-color);
    font-weight: 600;
}

/* Controls */
.controls {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--glass-border);
}

.controls-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.3);
}

.btn-outline {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.file-input-wrapper {
    position: relative;
    display: inline-block;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    top: 0;
    left: 0;
}

/* Modern Editor Container */
.editor-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--glass-border);
    position: relative;
}

.editor-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
}

.editor-header {
    background: rgba(249, 250, 251, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1rem 1.5rem;
    gap: 1rem;
    position: relative;
}

.editor-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.editor-title:first-child {
    justify-content: flex-start;
}

.editor-title:last-child {
    justify-content: flex-end;
}

.title-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.editor-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.central-swap-button {
    display: flex;
    justify-content: center;
    align-items: center;
}

.swap-btn {
    background: linear-gradient(135deg, var(--secondary-color), #0891B2);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(6, 182, 212, 0.3);
}

.swap-btn:hover {
    transform: translateY(-2px) rotate(180deg);
    box-shadow: 0 8px 25px rgba(6, 182, 212, 0.4);
}

.btn-icon {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(209, 213, 219, 0.5);
    border-radius: 8px;
    padding: 0.4rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    color: var(--text-secondary);
}

.btn-icon:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.editor-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 500px;
    position: relative;
    overflow: hidden;
}

.editor-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    background-position: center;
    background-size: cover;
    border-right: 1px solid var(--border-color);
}

.editor-panel:last-child {
    border-right: none;
}

.editor-panel:first-child {
    background: var(--editor-bg-left);
}

.editor-panel:last-child {
    background: var(--editor-bg-right);
}

.editor-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(1px);
    pointer-events: none;
}

textarea {
    width: 100%;
    flex-grow: 1;
    padding: 2rem;
    border: none;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.8;
    resize: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

textarea:focus {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
}

.char-count-container {
    position: absolute;
    bottom: 2px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 0.4rem 0.7rem;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.char-count {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

/* Diff Display */
.diff-view-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    margin-top: 1.5rem;
    border: 1px solid var(--glass-border);
}

.diff-view-header {
    background: rgba(249, 250, 251, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diff-view-title {
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.1rem;
}

.view-toggle {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.5);
    padding: 0.25rem;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

.view-toggle button {
    padding: 0.5rem 1rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.view-toggle button.active {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
}

.diff-side-by-side {
    display: grid;
    grid-template-columns: 1fr 1fr;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.8;
    gap: 1px;
    background-color: var(--border-color);
}

.diff-panel {
    padding: 1rem 0;
    overflow-x: auto;
    min-height: 300px;
    background: white;
}

.diff-panel-header {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    padding: 0 1.5rem 0.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.diff-panel-header .btn-sm {
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
}

.diff-line {
    padding: 0 0.5rem;
    margin: 0.05rem 0;
    position: relative;
    word-wrap: break-word;
    transition: background 0.3s ease;
    display: flex;
    align-items: baseline;
}

.diff-line:hover {
    background: var(--light-bg);
}

.diff-added {
    background: var(--added-bg);
    border-left: 3px solid var(--added-border);
}

.diff-removed {
    background: var(--removed-bg);
    border-left: 3px solid var(--removed-border);
}

.diff-unchanged {
    color: var(--text-primary);
}

.diff-empty {
    opacity: 0.3;
}

.line-number {
    display: inline-block;
    min-width: 50px;
    color: var(--text-secondary);
    text-align: right;
    padding-right: 1rem;
    user-select: none;
    opacity: 0.7;
    flex-shrink: 0;
    font-size: 0.8em;
}

.line-content {
    flex-grow: 1;
    white-space: pre-wrap;
    word-break: break-word;
}

[contenteditable]:focus {
    outline: 1px dashed var(--primary-color);
    background: rgba(79, 70, 229, 0.05);
}

.diff-unified {
    padding: 1rem 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    line-height: 1.8;
    background: white;
}

.line-prefix {
    margin-right: 0.5rem;
    font-weight: bold;
}

/* Stats Bar */
.stats-bar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    margin: 1.5rem 0;
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid var(--glass-border);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    animation: statsSlideUp 0.6s ease-out;
}

@keyframes statsSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card {
    text-align: center;
    padding: 2rem 1.5rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(249, 250, 251, 0.9) 100%);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(229, 231, 235, 0.5);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s ease;
}

.stat-card:hover::before {
    transform: scaleX(1);
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.stat-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.stat-icon {
    color: var(--text-secondary);
}

.stat-icon-added {
    color: var(--success-color);
}

.stat-icon-removed {
    color: var(--danger-color);
}

.stat-icon-modified {
    color: var(--warning-color);
}

.stat-icon-similarity {
    color: var(--primary-color);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: countUp 0.8s ease-out;
}

@keyframes countUp {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.5rem;
}

.stat-added {
    color: var(--success-color);
}

.stat-removed {
    color: var(--danger-color);
}

.stat-modified {
    color: var(--warning-color);
}

.stat-similarity {
    color: var(--primary-color);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 0.75rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
    transition: width 0.5s ease;
}

/* Export Options */
.export-panel {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--glass-border);
}

.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Loading & Toast */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-overlay.active {
    display: flex;
}

.loading-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
}

.spinner {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    z-index: 1001;
    border: 1px solid var(--glass-border);
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left: 4px solid var(--success-color);
}

.toast-error {
    border-left: 4px solid var(--danger-color);
}

.toast-info {
    border-left: 4px solid var(--primary-color);
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding-top: 2.5rem;
    margin-top: 3rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-grid-container {
    max-width: 1920px;
    width: 95%;
    margin: 0 auto;
    padding: 0 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.footer-section h4 {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-size: 1rem;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-link {
    color: var(--text-secondary);
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-link:hover {
    color: var(--primary-color);
    transform: translateY(-2px);
}

.newsletter-form {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.newsletter-form input {
    flex-grow: 1;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    transition: border-color 0.3s ease;
}

.newsletter-form input:focus {
    border-color: var(--primary-color);
}

.newsletter-form input::placeholder {
    color: var(--text-secondary);
}

.footer-bottom {
    background: rgba(249, 250, 251, 0.95);
}

.footer-bottom-container {
    max-width: 1920px;
    width: 95%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    padding: 1rem 0;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background: var(--dark-bg);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Default views - Side by Side for desktop */
#sideBySideView {
    display: grid;
}

#unifiedView {
    display: none;
}

/* Responsive Design */
@media (min-width: 1200px) {
    .container {
        width: 90%;
    }
}

@media (max-width: 1024px) {
    .container {
        width: 95%;
        margin: 1.5rem auto;
    }
    .header-nav {
        gap: 0.5rem;
    }
    .nav-link {
        padding: 0.5rem;
    }
    .hero-title {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    body { font-size: 15px; }
    .container { margin: 1rem auto; gap: 1rem; }
    
    .hero-section {
        padding: 3rem 0 2rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .header-container {
        grid-template-columns: auto 1fr auto;
        gap: 1rem;
    }
    
    .mobile-menu-toggle {
        display: block;
        order: 1;
    }
    
    .logo {
        order: 2;
        justify-self: center;
        font-size: 1.25rem;
    }
    
    .logo span {
        display: none;
    }
    
    .logo svg {
        width: 28px;
        height: 28px;
    }
    
    .header-nav {
        display: none;
    }
    
    .header-actions {
        order: 3;
    }
    
    .editor-container {
        display: grid; 
    }
    
    .editor-header, .editor-body {
        display: contents;
    }
    
    .editor-header > .editor-title {
        padding: 1rem 1.5rem;
        border-bottom: 1px solid var(--border-color);
        background: rgba(249, 250, 251, 0.95);
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 1rem;
    }
    
    .editor-header > .editor-title .title-content {
        flex: 1;
        order: 1;
    }
    
    .editor-header > .editor-title .editor-actions {
        order: 2;
        flex-wrap: nowrap;
    }

    .editor-header > .editor-title:first-child { order: 1; }
    .editor-body > .editor-panel:first-child { order: 2; min-height: 300px; border: none; }
    .editor-header > .central-swap-button { order: 3; padding: 1rem 0; background: var(--light-bg); }
    .editor-header > .editor-title:last-child { order: 4; }
    .editor-body > .editor-panel:last-child { order: 5; min-height: 300px; }
    .editor-body { min-height: auto; }
    
    .diff-side-by-side { grid-template-columns: 1fr; }
    .controls-grid { grid-template-columns: 1fr; }
    .stats-bar { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; padding: 1.5rem 1rem; }
    .stat-value { font-size: 2rem; }
    .stat-card { padding: 1.5rem 1rem; }
    textarea { padding: 1.5rem; }
    
    .diff-view-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .view-toggle {
        width: 100%;
        justify-content: center;
    }
    
    .footer-bottom-container {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .footer-grid-container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-section {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .footer-links {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .contact-info {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .social-links {
        justify-content: center;
    }
    
    .newsletter-form {
        flex-direction: column;
        max-width: 300px;
        margin: 1rem auto 0;
    }
    
    .newsletter-form input {
        width: 100%;
    }
    
    /* Mobile: Default to Unified view */
    #sideBySideView {
        display: none !important;
    }
    
    #unifiedView {
        display: block !important;
    }
    
    .view-toggle button:first-child {
        background: transparent;
        color: inherit;
        box-shadow: none;
    }
    
    .view-toggle button:nth-child(2) {
        background: var(--primary-color);
        color: white;
        box-shadow: 0 2px 8px rgba(79, 70, 229, 0.3);
    }
    
    body.dark-mode .view-toggle button:first-child {
        background: transparent;
        color: #E2E8F0;
    }
    
    body.dark-mode .view-toggle button:nth-child(2) {
        background: var(--primary-color);
        color: white;
    }
}

@media (max-width: 480px) {
    .container {
        width: 100%;
        margin: 0;
    }
    
    .controls, .editor-container, .diff-view-container, .stats-bar, .export-panel {
        border-radius: 0;
        margin-left: 0;
        margin-right: 0;
        width: 100%;
    }

    .header-container, .footer-bottom-container {
        width: 90%;
    }
    
    .stats-bar { 
        grid-template-columns: 1fr 1fr;
        padding: 1.5rem 1rem;
    }

    .btn { padding: 0.8rem 1rem; font-size: 0.9rem; }
    textarea { padding: 1rem; font-size: 13px; min-height: 250px; }
    .swap-btn { width: 44px; height: 44px; }
    .editor-actions { flex-wrap: wrap; justify-content: center; }
    
    .logo svg {
        width: 24px;
        height: 24px;
    }
    
    .export-options {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1.5rem 1rem;
    }
    
    .stat-value {
        font-size: 2rem;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
}

/* Dark Mode */
body.dark-mode { 
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%); 
    color: #E2E8F0; 
}

body.dark-mode .hero-section {
    background: linear-gradient(135deg, rgba(26, 26, 46, 0.95) 0%, rgba(15, 15, 30, 0.95) 100%);
}

body.dark-mode .search-box {
    background: rgba(45, 55, 72, 0.95);
}

body.dark-mode .search-input {
    color: #E2E8F0;
}

body.dark-mode .header, 
body.dark-mode .controls, 
body.dark-mode .editor-container, 
body.dark-mode .diff-view-container, 
body.dark-mode .stats-bar, 
body.dark-mode .export-panel, 
body.dark-mode .footer {
    background: rgba(45, 55, 72, 0.95); 
    color: #E2E8F0; 
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2);
}

body.dark-mode .header-nav a, 
body.dark-mode .mobile-nav-link { 
    color: #9CA3AF; 
}

body.dark-mode .header-nav a:hover, 
body.dark-mode .mobile-nav-link:hover { 
    color: var(--primary-color); 
    background: rgba(79, 70, 229, 0.1); 
}

body.dark-mode .nav-link.active, 
body.dark-mode .mobile-nav-link.active { 
    background-color: rgba(79, 70, 229, 0.2); 
    color: var(--primary-color); 
}

body.dark-mode .nav-link.active::after { 
    background-color: var(--primary-color); 
}

body.dark-mode .mobile-nav { 
    background: #1A202C; 
    border-color: #374151; 
}

body.dark-mode .mobile-nav-link { 
    border-bottom-color: #374151; 
}

body.dark-mode .btn-icon { 
    background-color: #4A5568; 
    color: #CBD5E0; 
    border-color: #4A5568;
}

body.dark-mode .btn-icon:hover { 
    background-color: #718096; 
    border-color: #A0AEC0; 
    color: white; 
}

body.dark-mode .editor-panel:first-child { 
    background: var(--editor-bg-left-dark); 
}

body.dark-mode .editor-panel:last-child { 
    background: var(--editor-bg-right-dark); 
}

body.dark-mode textarea { 
    background: transparent; 
    color: #E2E8F0; 
}

body.dark-mode .editor-header, 
body.dark-mode .diff-view-header { 
    background: #1A202C; 
    border-bottom-color: #374151; 
}

body.dark-mode .editor-title, 
body.dark-mode .char-count, 
body.dark-mode .diff-view-title, 
body.dark-mode .diff-panel-header, 
body.dark-mode .diff-unchanged, 
body.dark-mode .line-number { 
    color: #9CA3AF; 
}

body.dark-mode .diff-side-by-side { 
    background-color: #374151; 
}

body.dark-mode .diff-panel, 
body.dark-mode .diff-unified { 
    background: #1A202C; 
}

body.dark-mode .diff-panel:first-child { 
    border-right-color: #374151; 
}

body.dark-mode .btn-outline { 
    background: #2D3748; 
    color: var(--primary-color); 
    border-color: var(--primary-color); 
}

body.dark-mode .btn-outline:hover { 
    background: var(--primary-color); 
    color: white; 
    border-color: var(--primary-color); 
}

body.dark-mode .view-toggle { 
    background: rgba(26, 32, 44, 0.5); 
}

body.dark-mode .view-toggle button { 
    background: transparent; 
    color: #E2E8F0; 
}

body.dark-mode .view-toggle button.active { 
    background: var(--primary-color); 
    color: white; 
}

body.dark-mode .stat-card {
    background: linear-gradient(135deg, rgba(45, 55, 72, 0.9) 0%, rgba(26, 32, 44, 0.9) 100%);
    border-color: rgba(55, 65, 81, 0.5);
}

body.dark-mode .stat-card:hover {
    border-color: var(--primary-color);
}

body.dark-mode .stat-value {
    background: linear-gradient(135deg, #6366F1, #14B8A6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .footer { 
    background: #1A202C; 
    color: #A0AEC0; 
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2); 
}

body.dark-mode .footer-grid-container { 
    border-bottom-color: #374151; 
}

body.dark-mode .footer-section h4 { 
    color: #E2E8F0; 
}

body.dark-mode .footer-links a, 
body.dark-mode .contact-info p, 
body.dark-mode .social-link { 
    color: #A0AEC0; 
}

body.dark-mode .footer-links a:hover, 
body.dark-mode .social-link:hover { 
    color: var(--primary-color); 
}

body.dark-mode .newsletter-form input { 
    background: #2D3748; 
    border-color: #374151; 
    color: #E2E8F0; 
}

body.dark-mode .newsletter-form input::placeholder { 
    color: #6B7280; 
}

body.dark-mode .footer-bottom { 
    background: #10151f; 
}

body.dark-mode .char-count-container {
    background: rgba(45, 55, 72, 0.9);
    color: #9CA3AF;
}

body.dark-mode .loading-content,
body.dark-mode .toast {
    background: rgba(45, 55, 72, 0.95);
    color: #E2E8F0;
}

body.dark-mode .editor-header > .central-swap-button { 
    background: #1F2937; 
}

body.dark-mode .editor-header > .editor-title {
    background: rgba(26, 32, 44, 0.95);
}

body.dark-mode .tool-card {
    background: rgba(45, 55, 72, 0.95);
}

body.dark-mode .tool-card h3 {
    color: #E2E8F0;
}