/* Universal Encoder Decoder Styles - Advanced Futuristic Design */

/* Import base styles and modern fonts */
@import url('../../Home page/style.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* Advanced CSS Custom Properties */
:root {
    /* Color Palette */
    --primary-color: #00f5ff;
    --primary-dark: #00b8cc;
    --secondary-color: #ff6b6b;
    --accent-color: #4ecdc4;
    --success-color: #00ff88;
    --warning-color: #ffb74d;
    --error-color: #ff5252;
    
    /* Background Colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-quaternary: #242424;
    --bg-glass: rgba(255, 255, 255, 0.05);
    --bg-card: rgba(255, 255, 255, 0.03);
    
    /* Text Colors */
    --text-primary: #ffffff;
    --text-secondary: #b0b3b8;
    --text-muted: #8a8a8a;
    --text-accent: var(--primary-color);
    
    /* Effects */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-accent: rgba(0, 245, 255, 0.3);
    --shadow-glow: 0 0 20px rgba(0, 245, 255, 0.15);
    --shadow-heavy: 0 10px 40px rgba(0, 0, 0, 0.3);
    
    /* Spacing & Sizing */
    --border-radius: 12px;
    --border-radius-lg: 16px;
    --transition-speed: 0.3s;
    --transition-curve: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Consolas', monospace;
    --font-weight-light: 300;
    --font-weight-normal: 400;
    --font-weight-medium: 500;
    --font-weight-semibold: 600;
    --font-weight-bold: 700;
    --font-weight-extrabold: 800;
}

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

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    font-weight: var(--font-weight-normal);
}

/* Animated Background */
.animated-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bg-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 25% 25%, rgba(0, 245, 255, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(255, 107, 107, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 50% 10%, rgba(78, 205, 196, 0.1) 0%, transparent 50%);
    animation: particleFloat 20s ease-in-out infinite;
}

.bg-grid {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 245, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 245, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 30s linear infinite;
}

.bg-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 245, 255, 0.05) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    animation: glowPulse 8s ease-in-out infinite;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-container {
    text-align: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 3px solid rgba(0, 245, 255, 0.2);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-glow);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.logo-icon {
    font-size: 2rem;
    color: var(--primary-color);
    animation: logoSpin 10s linear infinite;
}

.logo h1 {
    font-size: 1.75rem;
    font-weight: var(--font-weight-bold);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
}

.logo-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(0, 245, 255, 0.2) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    z-index: -1;
    animation: glowPulse 3s ease-in-out infinite;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed) var(--transition-curve);
    font-weight: var(--font-weight-medium);
}

.nav-link:hover {
    color: var(--primary-color);
    border-color: var(--border-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 3rem 0;
}

/* Page Header */
.page-header {
    text-align: center;
    margin-bottom: 3rem;
}

.page-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: var(--font-weight-extrabold);
    margin-bottom: 1rem;
    line-height: 1.1;
}

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

.title-highlight {
    background: linear-gradient(135deg, var(--secondary-color), var(--warning-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    max-width: 600px;
    margin: 0 auto;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-speed) var(--transition-curve);
    backdrop-filter: blur(10px);
}

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

.stat-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
    font-family: var(--font-mono);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: var(--font-weight-medium);
}

/* Control Panel */
.control-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.section-title i {
    color: var(--primary-color);
}

/* Mode Toggle */
.mode-section {
    margin-bottom: 2rem;
}

.mode-toggle {
    position: relative;
    display: flex;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    padding: 4px;
    border: 1px solid var(--border-color);
}

.mode-slider {
    position: absolute;
    top: 4px;
    left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: calc(var(--border-radius) - 4px);
    transition: transform var(--transition-speed) var(--transition-curve);
    box-shadow: var(--shadow-glow);
}

.mode-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 1rem 1.5rem;
    cursor: pointer;
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    border-radius: calc(var(--border-radius) - 4px);
    transition: all var(--transition-speed) var(--transition-curve);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.mode-btn.active {
    color: white;
}

.mode-btn[data-mode="decode"].active ~ .mode-slider {
    transform: translateX(100%);
}

/* Format Selection */
.format-section {
    margin-bottom: 2rem;
}

.format-selection {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.custom-select {
    position: relative;
    display: flex;
    align-items: center;
}

.format-dropdown {
    width: 100%;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    padding: 1rem 3rem 1rem 1rem;
    font-size: 1rem;
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-curve);
    appearance: none;
    background-image: none;
}

.format-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 245, 255, 0.2);
}

.select-arrow {
    position: absolute;
    right: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: transform var(--transition-speed) var(--transition-curve);
}

.format-dropdown:focus + .select-arrow {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.format-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.format-info i {
    color: var(--primary-color);
}

/* Editor Workspace */
.editor-workspace {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.workspace-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.workspace-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.workspace-title i {
    color: var(--primary-color);
}

.workspace-controls {
    display: flex;
    gap: 0.5rem;
}

.workspace-btn {
    width: 40px;
    height: 40px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-curve);
    display: flex;
    align-items: center;
    justify-content: center;
}

.workspace-btn:hover {
    color: var(--primary-color);
    border-color: var(--border-accent);
    transform: scale(1.05);
}

/* Editor Container */
.editor-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 0;
    min-height: 400px;
}

.input-pane,
.output-pane {
    display: flex;
    flex-direction: column;
    position: relative;
}

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

.pane-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.pane-title i {
    color: var(--primary-color);
}

.pane-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.control-btn {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-curve);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.control-btn:hover {
    color: var(--primary-color);
    border-color: var(--border-accent);
    transform: scale(1.05);
}

.char-counter {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-weight: var(--font-weight-medium);
}

.editor-wrapper {
    flex: 1;
    position: relative;
}

.text-area {
    width: 100%;
    height: 100%;
    min-height: 350px;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    line-height: 1.6;
    resize: none;
    transition: all var(--transition-speed) var(--transition-curve);
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) transparent;
}

.text-area:focus {
    outline: none;
}

.text-area::-webkit-scrollbar {
    width: 8px;
}

.text-area::-webkit-scrollbar-track {
    background: transparent;
}

.text-area::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.text-area::-webkit-scrollbar-thumb:hover {
    background: var(--primary-dark);
}

.editor-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    border-radius: var(--border-radius);
    opacity: 0;
    transition: opacity var(--transition-speed) var(--transition-curve);
    box-shadow: inset 0 0 20px rgba(0, 245, 255, 0.1);
}

.text-area:focus + .editor-glow {
    opacity: 1;
}

.output-area {
    background: rgba(0, 245, 255, 0.02);
}

/* Editor Divider */
.editor-divider {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    background: var(--bg-tertiary);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    position: relative;
}

.divider-line {
    width: 1px;
    height: 40%;
    background: linear-gradient(to bottom, transparent, var(--primary-color), transparent);
}

.swap-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-curve);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem 0;
    box-shadow: var(--shadow-glow);
}

.swap-btn:hover {
    transform: scale(1.1) rotate(180deg);
    box-shadow: 0 0 30px rgba(0, 245, 255, 0.4);
}

/* Action Panel */
.action-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.primary-actions {
    display: flex;
    justify-content: center;
}

.secondary-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Quantum Button */
.quantum-btn {
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    perspective: 1000px;
}

.btn-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 2;
}

.btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 245, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity var(--transition-speed) var(--transition-curve);
    z-index: 1;
}

.quantum-btn:hover .btn-glow {
    opacity: 1;
    animation: quantumGlow 2s ease-in-out infinite;
}

.btn-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
}

.quantum-btn:hover .btn-particles::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    animation: particleExplosion 1s ease-out infinite;
}

/* Button Styles */
.btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-curve);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 140px;
    justify-content: center;
}

.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(--accent-color));
    color: white;
    box-shadow: var(--shadow-glow);
    font-size: 1.125rem;
    padding: 1.25rem 2.5rem;
}

.btn.primary:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 10px 40px rgba(0, 245, 255, 0.4);
}

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

.btn.secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

.btn.danger {
    background: linear-gradient(135deg, var(--error-color), #e74c3c);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 82, 82, 0.3);
}

.btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 82, 82, 0.4);
}

/* Advanced Options */
.advanced-options {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    margin-bottom: 2rem;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.options-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--bg-tertiary);
    cursor: pointer;
    transition: background var(--transition-speed) var(--transition-curve);
}

.options-header:hover {
    background: var(--bg-quaternary);
}

.options-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.options-title i {
    color: var(--primary-color);
}

.options-toggle {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-curve);
    padding: 0.5rem;
    border-radius: 50%;
}

.options-toggle:hover {
    color: var(--primary-color);
    background: var(--bg-glass);
}

.options-toggle.active {
    transform: rotate(180deg);
}

.options-content {
    padding: 2rem;
    display: none;
    gap: 2rem;
    flex-direction: column;
}

.options-content.active {
    display: flex;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: var(--font-weight-medium);
    color: var(--text-secondary);
    transition: color var(--transition-speed) var(--transition-curve);
}

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

.option-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: all var(--transition-speed) var(--transition-curve);
}

.option-label input[type="checkbox"]:checked + .checkmark {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.option-label input[type="checkbox"]:checked + .checkmark::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 12px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.slider-label {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.slider-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.slider {
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Status Panel */
.status-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    backdrop-filter: blur(10px);
}

.status-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success-color);
    animation: statusPulse 2s ease-in-out infinite;
}

.indicator-text {
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
}

.processing-time {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.processing-time i {
    color: var(--primary-color);
}

.progress-container {
    margin-bottom: 1rem;
    display: none;
}

.progress-container.active {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 3px;
    transition: width var(--transition-speed) var(--transition-curve);
    width: 0%;
}

.progress-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 245, 255, 0.3), transparent);
    animation: progressShimmer 1.5s ease-in-out infinite;
}

.progress-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.status-message {
    padding: 1rem;
    border-radius: var(--border-radius);
    font-weight: var(--font-weight-medium);
    text-align: center;
    transition: all var(--transition-speed) var(--transition-curve);
    opacity: 0;
    transform: translateY(10px);
}

.status-message.active {
    opacity: 1;
    transform: translateY(0);
}

.status-message.success {
    background: rgba(0, 255, 136, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.status-message.error {
    background: rgba(255, 82, 82, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.status-message.info {
    background: rgba(0, 245, 255, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

/* Floating Action Button */
.fab-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.fab {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border: none;
    border-radius: 50%;
    color: white;
    cursor: pointer;
    font-size: 1.25rem;
    transition: all var(--transition-speed) var(--transition-curve);
    box-shadow: var(--shadow-heavy);
}

.fab:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(0, 245, 255, 0.4);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-speed) var(--transition-curve);
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    transform: scale(0.9);
    transition: transform var(--transition-speed) var(--transition-curve);
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 2rem;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.25rem;
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition-speed) var(--transition-curve);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--error-color);
    border-color: var(--error-color);
}

.modal-content {
    padding: 2rem;
    overflow-y: auto;
    max-height: calc(80vh - 100px);
}

.shortcut-grid {
    display: grid;
    gap: 1rem;
}

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

.shortcut-item kbd {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-primary);
    margin: 0 0.25rem;
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

.footer-section {
    flex: 1;
}

.footer-section p {
    margin: 0;
    color: var(--text-muted);
}

.footer-subtitle {
    font-size: 0.875rem;
    margin-top: 0.25rem !important;
}

.footer-stats {
    display: flex;
    gap: 2rem;
    justify-content: flex-end;
}

.footer-stat {
    text-align: center;
}

.footer-stat .stat-value {
    display: block;
    font-size: 1.25rem;
    font-weight: var(--font-weight-bold);
    color: var(--primary-color);
    font-family: var(--font-mono);
}

.footer-stat .stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

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

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

@keyframes particleFloat {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

@keyframes gridMove {
    from { transform: translateX(0); }
    to { transform: translateX(50px); }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.8; transform: translate(-50%, -50%) scale(1.1); }
}

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

@keyframes progressShimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@keyframes quantumGlow {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.2); opacity: 0.6; }
}

@keyframes particleExplosion {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(10); opacity: 0; }
}

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

.main-content {
    animation: fadeIn 0.8s ease-out;
}

/* Mobile Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .editor-container {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto 1fr;
    }
    
    .editor-divider {
        width: 100%;
        height: 60px;
        flex-direction: row;
    }
    
    .divider-line {
        width: 40%;
        height: 1px;
        background: linear-gradient(to right, transparent, var(--primary-color), transparent);
    }
    
    .swap-btn {
        margin: 0 1rem;
    }
    
    .secondary-actions {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 2.5rem;
    }
    
    .control-panel {
        padding: 1.5rem;
    }
    
    .mode-toggle {
        flex-direction: column;
    }
    
    .mode-slider {
        width: calc(100% - 8px);
        height: calc(50% - 4px);
    }
    
    .mode-btn[data-mode="decode"].active ~ .mode-slider {
        transform: translateY(100%);
    }
    
    .text-area {
        min-height: 200px;
        font-size: 0.8rem;
    }
    
    .pane-header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .pane-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.9rem;
    }
    
    .btn.primary {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    .secondary-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .secondary-actions .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .fab-container {
        bottom: 1rem;
        right: 1rem;
    }
    
    .modal-container {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-content {
        padding: 1.5rem;
    }
    
    .shortcut-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }
    
    .main-content {
        padding: 2rem 0;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .control-panel {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .workspace-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .text-area {
        min-height: 150px;
        padding: 1rem;
        font-size: 0.75rem;
    }
    
    .btn {
        padding: 0.75rem 1.25rem;
        font-size: 0.85rem;
    }
    
    .btn.primary {
        padding: 0.875rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .format-dropdown {
        padding: 0.875rem 2.5rem 0.875rem 0.875rem;
        font-size: 0.9rem;
    }
    
    .options-content {
        padding: 1rem;
    }
    
    .option-group {
        gap: 0.75rem;
    }
    
    .footer-stats {
        gap: 1rem;
    }
}

/* Dark/Light Theme Toggle */
.theme-dark {
    --bg-primary: #0a0a0a;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    --bg-quaternary: #242424;
    --text-primary: #ffffff;
    --text-secondary: #b0b3b8;
    --text-muted: #8a8a8a;
}

.theme-light {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #e9ecef;
    --bg-quaternary: #dee2e6;
    --text-primary: #000000;
    --text-secondary: #495057;
    --text-muted: #6c757d;
    --border-color: rgba(0, 0, 0, 0.1);
    --bg-glass: rgba(0, 0, 0, 0.05);
    --bg-card: rgba(0, 0, 0, 0.03);
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: rgba(255, 255, 255, 0.3);
        --bg-glass: rgba(255, 255, 255, 0.1);
        --text-muted: #cccccc;
    }
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-tertiary) 100%);
    border-bottom: 2px solid var(--primary-color);
    padding: 1rem 0;
    box-shadow: 0 4px 20px rgba(0, 212, 255, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.nav-link:hover {
    color: var(--primary-color);
    background: rgba(0, 212, 255, 0.1);
    transform: translateY(-2px);
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.page-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.3);
}

/* Mode Toggle */
.mode-toggle {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    gap: 0;
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 4px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    border: 1px solid var(--border-color);
}

.mode-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px 24px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
}

.mode-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.mode-btn:hover:not(.active) {
    color: var(--primary-color);
    background: rgba(0, 212, 255, 0.1);
}

/* Format Selection */
.format-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 2rem;
    gap: 0.5rem;
}

.format-label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
}

.format-dropdown {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 1rem;
    min-width: 300px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-dropdown:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2);
}

.format-dropdown option {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 8px;
}

/* Editor Container */
.editor-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.input-pane,
.output-pane {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.pane-label {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.text-area {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 1.5rem;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    min-height: 300px;
    transition: all 0.3s ease;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) var(--bg-tertiary);
}

.text-area:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.2), 
                0 0 20px rgba(0, 212, 255, 0.1);
}

.text-area::-webkit-scrollbar {
    width: 8px;
}

.text-area::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

.text-area::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

.text-area::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

.output-area {
    background: var(--bg-tertiary);
    cursor: default;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.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(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.3);
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 212, 255, 0.4);
}

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

.btn.secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
}

.btn.danger {
    background: linear-gradient(135deg, var(--error-color), #e74c3c);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
}

.btn.danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 71, 87, 0.4);
}

/* Status Message */
.status-message {
    text-align: center;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 600;
    min-height: 20px;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.status-message.success {
    background: rgba(0, 255, 136, 0.1);
    color: var(--success-color);
    border: 1px solid var(--success-color);
}

.status-message.error {
    background: rgba(255, 71, 87, 0.1);
    color: var(--error-color);
    border: 1px solid var(--error-color);
}

.status-message.info {
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    text-align: center;
    color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .page-title {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .editor-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .text-area {
        min-height: 200px;
        padding: 1rem;
        font-size: 13px;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
    
    .format-dropdown {
        min-width: 250px;
        width: 100%;
        max-width: 300px;
    }
    
    .mode-toggle {
        width: 100%;
        max-width: 300px;
    }
    
    .header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .page-title {
        font-size: 1.8rem;
    }
    
    .text-area {
        min-height: 150px;
        padding: 0.8rem;
        font-size: 12px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .format-dropdown {
        min-width: 200px;
        padding: 10px 12px;
        font-size: 0.9rem;
    }
}

/* Animation for smooth transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    animation: fadeIn 0.6s ease-out;
}

/* Focus indicators for accessibility */
.btn:focus,
.format-dropdown:focus,
.text-area:focus,
.mode-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}
