/* CSS Variables for Light Theme */
:root {
    --primary-gradient: linear-gradient(135deg, rgba(61, 84, 0, 1.000) 0.000%, rgba(78, 110, 0, 1.000) 35.000%, rgba(96, 137, 0, 1.000) 60.000%, rgb(107, 152, 1) 80.000%, rgb(115, 168, 1) 100.000%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --success-gradient: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);

    --bg-primary: linear-gradient(314deg, #4c823f 0%, #3ffd3f 74%);
    --bg-secondary: #d6ffcd;
    --bg-tertiary: #ecfdf5;
    --bg-glass: rgba(255, 255, 255, 0.25);
    
    --text-primary: rgb(50, 69, 1);
    --text-secondary: rgba(78, 110, 0, 1.000);
    --text-light: rgba(113, 163, 0, 1.000);
    
    --border-color: rgba(255, 255, 255, 0.2);
    --shadow-light: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-medium: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 20px 40px rgba(0, 0, 0, 0.15);
    
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --bg-primary: #0f2a10;
    --bg-secondary: #233b1e;
    --bg-tertiary: #365533;
    --bg-glass: rgba(0, 0, 0, 0.25);
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-light: #648b66;
    
    --border-color: rgba(255, 255, 255, 0.1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
}

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

.floating-shapes {
    position: relative;
    width: 100%;
    height: 100%;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite linear;
}

.shape-1 {
    width: 80px;
    height: 80px;
    background: var(--primary-gradient);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape-2 {
    width: 120px;
    height: 120px;
    background: var(--secondary-gradient);
    top: 60%;
    left: 80%;
    animation-delay: -7s;
}

.shape-3 {
    width: 60px;
    height: 60px;
    background: var(--accent-gradient);
    top: 30%;
    left: 70%;
    animation-delay: -14s;
}

.shape-4 {
    width: 100px;
    height: 100px;
    background: var(--success-gradient);
    top: 80%;
    left: 20%;
    animation-delay: -3s;
}

.shape-5 {
    width: 140px;
    height: 140px;
    background: var(--primary-gradient);
    top: 20%;
    left: 50%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-30px) rotate(120deg);
    }
    66% {
        transform: translateY(30px) rotate(240deg);
    }
}

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
}

.theme-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-medium);
}

.theme-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

/* Main Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2rem;
    animation: slideInDown 0.6s ease-out;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo i {
    font-size: 3rem;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: pulse 2s infinite;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    flex: 1;
    animation: slideInUp 0.6s ease-out 0.2s both;
}

.main-content > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Input Section */
.input-section {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
    transition: var(--transition);
    height: fit-content;
}

.input-section:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-heavy);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-group label i {
    color: var(--text-secondary);
}

/* Form Controls */
textarea, select, input[type="color"] {
    width: 100%;
    padding: 1rem;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: var(--shadow-light);
}

textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

textarea:focus, select:focus, input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.char-counter {
    text-align: right;
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Color Section */
.color-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.color-group input[type="color"] {
    height: 50px;
    cursor: pointer;
    border-radius: var(--border-radius);
}

/* Generate Button */
.generate-btn {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

.generate-btn:active {
    transform: translateY(-1px);
}

.btn-shimmer {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Output Section */
.output-section {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.qr-container {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
    text-align: center;
    transition: var(--transition);
}

.qr-result {
    margin-bottom: 2rem;
    min-height: 330px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    transition: var(--transition);
}

.placeholder {
    text-align: center;
    color: var(--text-light);
}

.placeholder i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.placeholder p {
    font-size: 1.1rem;
}

.qr-result canvas {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    animation: zoomIn 0.5s ease-out;
}

/* QR Actions */
.qr-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.action-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.download-btn {
    background: var(--success-gradient);
    color: white;
}

.copy-btn {
    background: var(--accent-gradient);
    color: white;
}

.share-btn {
    background: var(--secondary-gradient);
    color: white;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Templates Section */
.templates-section {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
}

.templates-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.template-btn {
    padding: 1rem;
    background: var(--bg-secondary);
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    font-weight: 600;
    max-height: 60px;
}

.template-btn:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: var(--shadow-light);
}

.template-btn i {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--bg-secondary);
    margin: 10% auto;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideInUp 0.3s ease-out;
    box-shadow: var(--shadow-heavy);
}

.close {
    position: absolute;
    right: 1rem;
    top: 1rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

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

.modal-content h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.modal-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 1rem;
}

.modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .options-grid,
    .color-section,
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .qr-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .input-section,
    .qr-container,
    .templates-section {
        padding: 1.5rem;
    }
    
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo i {
        font-size: 2.5rem;
    }
    
    .logo h1 {
        font-size: 1.8rem;
    }
}

.developer-credit {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 18px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    font-size: 0.8rem;
    font-family: 'Poppins', sans-serif;
    color: #e0e0e0;
    opacity: 0.75;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 100;
    transition: all 0.3s ease;
    letter-spacing: 0.4px;
}

.developer-credit:hover {
    opacity: 1;
    transform: translateY(-2px) scale(1.015);
    box-shadow: 0 6px 18px rgba(255, 193, 111, 0.35);
}

.explorer-signature {
    font-family: 'Georgia', 'Times New Roman', serif;
    font-weight: 500;
    font-size: 0.8rem;
    color: #f3f3f3;
    letter-spacing: 0.5px;
}

.eccentric {
    font-weight: 700;
    font-family: 'Georgia', 'Times New Roman', serif;
    background: linear-gradient(90deg, #fcb045, #fd1d1d, #833ab4);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
    background-size: 200% auto;
    animation: shimmerText 4s ease infinite;
}

@keyframes shimmerText {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

/* QR Decoder Styles */
.decoder-section {
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-medium);
    margin-bottom: 2rem;
    transition: var(--transition);
}

.decoder-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
}

.decoder-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-size: 1.2rem;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    background: var(--bg-secondary);
}

.upload-area:hover {
    border-color: #667eea;
    background: var(--bg-tertiary);
}

.upload-area.dragover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.02);
}

.upload-content i {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.upload-content p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.upload-preview {
    position: relative;
    display: inline-block;
}

.clear-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: #ef4444;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.clear-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.decode-result {
    margin-top: 2rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border-left: 4px solid #43e97b;
}

.decode-result h4 {
    color: #43e97b;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.decoded-text {
    background: var(--bg-tertiary);
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    word-break: break-all;
    font-family: 'Monaco', monospace;
    font-size: 0.9rem;
    color: var(--text-primary);
    max-height: 150px;
    overflow-y: auto;
}

.decode-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.decode-actions .action-btn {
    flex: 1;
    min-width: 120px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .decode-actions {
        flex-direction: column;
    }

    .decode-actions .action-btn {
        width: 100%;
    }
}