/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-cyan: #00ffff;
    --primary-magenta: #ff00ff;
    --primary-blue: #0080ff;
    --accent-green: #00ff80;
    --accent-purple: #8000ff;
    --bg-dark: #0a0a0a;
    --bg-darker: #050505;
    --bg-card: #1a1a1a;
    --bg-card-hover: #252525;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --text-muted: #666666;
    --border-color: #333333;
    --danger: #ff4444;
    --warning: #ffaa00;
    --success: #00ff44;
    
    --font-primary: 'Orbitron', monospace;
    --font-secondary: 'Rajdhani', sans-serif;
    
    --shadow-glow: 0 0 20px rgba(0, 255, 255, 0.3);
    --shadow-glow-hover: 0 0 30px rgba(0, 255, 255, 0.5);
    --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.3);
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.15s ease;
}

body {
    background: var(--bg-dark);
    color: var(--text-primary);
    font-family: var(--font-secondary);
    font-weight: 400;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    min-height: 100vh;
}

/* Matrix Background */
.matrix-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(45deg, var(--bg-darker) 0%, var(--bg-dark) 100%);
}

.matrix-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(0, 255, 255, 0.03) 2px,
            rgba(0, 255, 255, 0.03) 4px
        ),
        repeating-linear-gradient(
            90deg,
            transparent,
            transparent 2px,
            rgba(255, 0, 255, 0.03) 2px,
            rgba(255, 0, 255, 0.03) 4px
        );
    animation: matrix-scroll 20s linear infinite;
}

/* Hexagonal Pattern */
.hex-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.1;
    background-image: 
        radial-gradient(circle at 25% 25%, var(--primary-cyan) 2px, transparent 2px),
        radial-gradient(circle at 75% 75%, var(--primary-magenta) 2px, transparent 2px);
    background-size: 100px 100px;
    background-position: 0 0, 50px 50px;
    animation: hex-float 30s ease-in-out infinite;
}

@keyframes matrix-scroll {
    0% { transform: translateY(0); }
    100% { transform: translateY(-100px); }
}

@keyframes hex-float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(10px, -10px) rotate(90deg); }
    50% { transform: translate(-5px, 5px) rotate(180deg); }
    75% { transform: translate(5px, 10px) rotate(270deg); }
}

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

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: var(--transition);
}

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

.logo {
    font-family: var(--font-primary);
    font-weight: 900;
    font-size: 1.5rem;
}

.logo-text {
    color: var(--primary-cyan);
    text-shadow: 0 0 10px var(--primary-cyan);
}

.domain {
    color: var(--primary-magenta);
    text-shadow: 0 0 10px var(--primary-magenta);
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    position: relative;
    transition: var(--transition);
}

.nav-link:hover {
    color: var(--primary-cyan);
    text-shadow: 0 0 5px var(--primary-cyan);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-magenta));
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    text-align: center;
    position: relative;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-family: var(--font-primary);
    font-size: clamp(2.5rem, 8vw, 5rem);
    font-weight: 900;
    margin-bottom: 20px;
    line-height: 1.1;
}

.glitch {
    position: relative;
    color: var(--primary-cyan);
    text-shadow: 0 0 20px var(--primary-cyan);
    display: block;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    animation: glitch-1 0.5s infinite;
    color: var(--primary-magenta);
    z-index: -1;
}

.glitch::after {
    animation: glitch-2 0.5s infinite;
    color: var(--primary-blue);
    z-index: -2;
}

@keyframes glitch-1 {
    0%, 14%, 15%, 49%, 50%, 99%, 100% { transform: translate(0); }
    1%, 13% { transform: translate(-2px, 2px); }
    16%, 48% { transform: translate(2px, -1px); }
    51%, 98% { transform: translate(-1px, 1px); }
}

@keyframes glitch-2 {
    0%, 20%, 21%, 62%, 63%, 99%, 100% { transform: translate(0); }
    1%, 19% { transform: translate(2px, -2px); }
    22%, 61% { transform: translate(-2px, 1px); }
    64%, 98% { transform: translate(1px, -1px); }
}

.cyber-text {
    font-size: 0.4em;
    color: var(--primary-magenta);
    text-shadow: 0 0 15px var(--primary-magenta);
    font-weight: 700;
    letter-spacing: 0.2em;
    display: block;
    margin-top: 10px;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-weight: 300;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    position: relative;
    padding: 15px 30px;
    background: transparent;
    border: 2px solid;
    border-radius: 8px;
    font-family: var(--font-secondary);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn span {
    position: relative;
    z-index: 2;
}

.btn-glow {
    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 ease;
}

.btn:hover .btn-glow {
    left: 100%;
}

.btn-primary {
    border-color: var(--primary-cyan);
    color: var(--primary-cyan);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.btn-primary:hover {
    background: rgba(0, 255, 255, 0.1);
    box-shadow: var(--shadow-glow-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    border-color: var(--primary-magenta);
    color: var(--primary-magenta);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 0, 255, 0.1);
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.5);
    transform: translateY(-2px);
}

.btn-encode {
    border-color: var(--accent-green);
    color: var(--accent-green);
    box-shadow: 0 0 15px rgba(0, 255, 128, 0.3);
}

.btn-encode:hover {
    background: rgba(0, 255, 128, 0.1);
    box-shadow: 0 0 25px rgba(0, 255, 128, 0.5);
}

.btn-decode {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
    box-shadow: 0 0 15px rgba(0, 128, 255, 0.3);
}

.btn-decode:hover {
    background: rgba(0, 128, 255, 0.1);
    box-shadow: 0 0 25px rgba(0, 128, 255, 0.5);
}

.btn-copy,
.btn-qr {
    border-color: var(--accent-purple);
    color: var(--accent-purple);
    box-shadow: 0 0 15px rgba(128, 0, 255, 0.3);
    padding: 10px 20px;
    font-size: 0.9rem;
}

.btn-copy:hover,
.btn-qr:hover {
    background: rgba(128, 0, 255, 0.1);
    box-shadow: 0 0 25px rgba(128, 0, 255, 0.5);
}

.btn-clear {
    border-color: var(--danger);
    color: var(--danger);
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.3);
    padding: 10px 20px;
    font-size: 0.9rem;
}

.btn-clear:hover {
    background: rgba(255, 68, 68, 0.1);
    box-shadow: 0 0 25px rgba(255, 68, 68, 0.5);
}

/* Sections */
.section {
    padding: 80px 0;
    position: relative;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-family: var(--font-primary);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.hex-icon {
    color: var(--primary-cyan);
    text-shadow: 0 0 10px var(--primary-cyan);
    font-size: 1.2em;
}

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

/* Panels */
.encode-panel,
.decode-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    box-shadow: var(--shadow-card);
    position: relative;
    overflow: hidden;
}

.encode-panel::before,
.decode-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-magenta), var(--primary-blue));
}

.panel-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

/* Download Section */
.download-section {
    margin: 40px 0;
    animation: slideInUp 0.5s ease;
}

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

.download-panel {
    background: var(--bg-card);
    border: 1px solid var(--accent-green);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 0 30px rgba(0, 255, 128, 0.2);
    position: relative;
    overflow: hidden;
}

.download-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-green), var(--primary-cyan));
}

.download-panel .panel-title {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    color: var(--accent-green);
    text-shadow: 0 0 10px var(--accent-green);
    margin-bottom: 20px;
    text-align: center;
}

.file-info {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.file-info p {
    margin: 5px 0;
    color: var(--text-secondary);
}

.file-info strong {
    color: var(--text-primary);
}

.download-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.share-link-display {
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.share-input {
    width: 100%;
    padding: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: monospace;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.share-options {
    display: flex;
    gap: 10px;
    justify-content: center;
}

/* QR Popup */
.qr-popup {
    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;
    animation: fadeIn 0.3s ease;
}

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

.qr-popup-content {
    background: var(--bg-card);
    border: 1px solid var(--primary-cyan);
    border-radius: 12px;
    padding: 30px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.3);
}

.qr-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.qr-header h3 {
    color: var(--primary-cyan);
    font-family: var(--font-primary);
}

.close-qr {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: var(--transition);
}

.close-qr:hover {
    color: var(--danger);
    background: rgba(255, 68, 68, 0.1);
}

.qr-code-display {
    text-align: center;
    margin-bottom: 20px;
}

.qr-placeholder {
    padding: 20px;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    background: var(--bg-darker);
}

.qr-visual {
    width: 150px;
    height: 150px;
    margin: 15px auto;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.qr-pattern {
    width: 80%;
    height: 80%;
    background: 
        linear-gradient(45deg, #000 25%, transparent 25%),
        linear-gradient(-45deg, #000 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #000 75%),
        linear-gradient(-45deg, transparent 75%, #000 75%);
    background-size: 10px 10px;
    background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
}

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

/* Upload Zone */
.upload-zone {
    border: 2px dashed var(--border-color);
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    background: var(--bg-darker);
}

.upload-zone:hover {
    border-color: var(--primary-cyan);
    background: rgba(0, 255, 255, 0.05);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.1);
}

.upload-zone.dragover {
    border-color: var(--primary-magenta);
    background: rgba(255, 0, 255, 0.05);
    box-shadow: 0 0 30px rgba(255, 0, 255, 0.2);
}

.upload-content h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    margin: 15px 0 5px;
    font-weight: 600;
}

.upload-content p {
    color: var(--text-secondary);
    margin: 5px 0;
}

.upload-info {
    font-size: 0.9rem !important;
    color: var(--text-muted) !important;
    margin-top: 15px !important;
}

.upload-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    opacity: 0.7;
}

.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--bg-darker);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.upload-progress.active {
    opacity: 1;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-magenta));
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
}

/* Image Preview */
.image-preview {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    background: var(--bg-darker);
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.preview-placeholder {
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Message Panel */
.message-panel {
    grid-column: 1 / -1;
    margin-top: 20px;
}

.label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.textarea,
.input,
.select {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-secondary);
    font-size: 1rem;
    transition: var(--transition);
    margin-bottom: 20px;
}

.textarea {
    resize: vertical;
    min-height: 120px;
}

.textarea:focus,
.input:focus,
.select:focus {
    outline: none;
    border-color: var(--primary-cyan);
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.textarea::placeholder,
.input::placeholder {
    color: var(--text-muted);
}

/* Password Container */
.password-container {
    position: relative;
}

.password-strength {
    margin-top: -15px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.strength-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-darker);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.strength-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: var(--danger);
    transition: all 0.3s ease;
    border-radius: 2px;
}

.strength-bar.weak::after {
    width: 25%;
    background: var(--danger);
}

.strength-bar.medium::after {
    width: 60%;
    background: var(--warning);
}

.strength-bar.strong::after {
    width: 100%;
    background: var(--success);
}

.strength-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    min-width: 100px;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

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

.option-group .label {
    margin-bottom: 5px;
}

.option-group .select,
.option-group .input {
    margin-bottom: 0;
}

/* Decode Controls */
.decode-controls {
    display: flex;
    flex-direction: column;
}

/* Decoded Message */
.decoded-message {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.message-display {
    min-height: 100px;
    padding: 15px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 15px;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.message-display .placeholder {
    color: var(--text-muted);
    font-style: italic;
}

/* QR Panel */
.qr-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 30px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 12px;
}

.panel-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    text-align: center;
}

.qr-display {
    width: 200px;
    height: 200px;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: var(--bg-card);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* History Panel */
.history-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    box-shadow: var(--shadow-card);
}

.history-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.history-list {
    min-height: 200px;
}

.history-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: var(--text-muted);
    font-style: italic;
}

.history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: var(--transition);
}

.history-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary-cyan);
}

.history-info h4 {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 5px;
}

.history-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.history-actions {
    display: flex;
    gap: 10px;
}

.history-actions .btn {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Notifications */
.notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.notification {
    min-width: 300px;
    padding: 15px 20px;
    border-radius: 8px;
    color: var(--text-primary);
    font-weight: 500;
    box-shadow: var(--shadow-card);
    transform: translateX(100%);
    opacity: 0;
    animation: slideIn 0.3s ease forwards;
    position: relative;
    overflow: hidden;
}

.notification::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
}

.notification.success {
    background: rgba(0, 255, 68, 0.1);
    border: 1px solid var(--success);
}

.notification.success::before {
    background: var(--success);
}

.notification.error {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--danger);
}

.notification.error::before {
    background: var(--danger);
}

.notification.warning {
    background: rgba(255, 170, 0, 0.1);
    border: 1px solid var(--warning);
}

.notification.warning::before {
    background: var(--warning);
}

.notification.info {
    background: rgba(0, 128, 255, 0.1);
    border: 1px solid var(--primary-blue);
}

.notification.info::before {
    background: var(--primary-blue);
}

@keyframes slideIn {
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.notification.removing {
    animation: slideOut 0.3s ease forwards;
}

/* Loading Overlay */
.loading-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 0.3s ease;
}

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

.loading-content {
    text-align: center;
    color: var(--text-primary);
}

.cyber-loader {
    width: 80px;
    height: 80px;
    border: 4px solid transparent;
    border-top: 4px solid var(--primary-cyan);
    border-right: 4px solid var(--primary-magenta);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
    box-shadow: 
        0 0 20px rgba(0, 255, 255, 0.3),
        inset 0 0 20px rgba(255, 0, 255, 0.3);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    font-family: var(--font-primary);
    font-size: 1.2rem;
    font-weight: 600;
    text-shadow: 0 0 10px var(--primary-cyan);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header .container {
        padding: 12px 15px;
    }
    
    .nav {
        gap: 20px;
    }
    
    .nav-link {
        font-size: 0.9rem;
    }
    
    .hero {
        padding: 100px 0 60px;
    }
    
    .hero-title {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    
    .section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 2rem;
        flex-direction: column;
        gap: 10px;
    }
    
    .encode-panel,
    .decode-panel,
    .download-panel {
        padding: 25px 15px;
    }
    
    .panel-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .upload-zone {
        padding: 30px 15px;
    }
    
    .notifications {
        right: 10px;
        left: 10px;
    }
    
    .notification {
        min-width: auto;
    }
    
    .qr-display {
        width: 150px;
        height: 150px;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .history-actions {
        align-self: stretch;
        justify-content: space-between;
    }
    
    .download-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .share-options {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.2rem;
    }
    
    .nav {
        gap: 15px;
    }
    
    .nav-link {
        font-size: 0.8rem;
    }
    
    .hero-title {
        font-size: clamp(1.8rem, 5vw, 2.5rem);
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .encode-panel,
    .decode-panel,
    .download-panel {
        padding: 20px 10px;
    }
    
    .upload-zone {
        padding: 25px 10px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary-cyan), var(--primary-magenta));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--primary-magenta), var(--primary-cyan));
}

/* Selection */
::selection {
    background: rgba(0, 255, 255, 0.3);
    color: var(--text-primary);
}

::-moz-selection {
    background: rgba(0, 255, 255, 0.3);
    color: var(--text-primary);
}

/* Focus Visible */
*:focus-visible {
    outline: 2px solid var(--primary-cyan);
    outline-offset: 2px;
}

/* Disable outline for mouse users */
*:focus:not(:focus-visible) {
    outline: none;
}