/* style.css */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --background: #f8fafc;
    --dark-bg: #1e293b;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --border: #e2e8f0;
    --code-bg: #f1f5f9;
    --code-text: #334155;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --glass: rgba(255, 255, 255, 0.7);
}

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

body {
    font-family: 'Montserrat', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background-color: var(--background);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(16, 185, 129, 0.1) 0%, transparent 20%);
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    background: var(--glass);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.header h1 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 2.8rem;
    font-weight: 700;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
}

.header p {
    color: var(--text-light);
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 2rem;
}

@media (max-width: 1200px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.form-group {
    margin-bottom: 2.5rem;
    position: relative;
}

label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 600;
    color: var(--text);
    font-size: 1.2rem;
}

textarea {
    width: 100%;
    min-height: 350px;
    padding: 1.5rem;
    border: 1px solid var(--border);
    border-radius: 1rem;
    font-family: 'JetBrains Mono', monospace;
    resize: vertical;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.8);
    color: var(--code-text);
    line-height: 1.7;
}

textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    padding: 1.2rem 2.5rem;
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.4s ease;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.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: 0.5s;
}

.btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.4);
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: translateY(0);
}

.btn i {
    font-size: 1.3rem;
}

.radio-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--background);
    padding: 1rem 1.5rem;
    border-radius: 0.75rem;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    flex: 1;
    min-width: 200px;
}

.radio-option input {
    margin: 0;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
}

.radio-option input:checked {
    border-color: var(--primary);
}

.radio-option input:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    background: var(--primary);
    border-radius: 50%;
}

.radio-option:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.radio-option.active {
    background: rgba(79, 70, 229, 0.1);
    border-color: var(--primary);
}

.result-area {
    position: relative;
    border-radius: 1rem;
    overflow: hidden;
}

.copy-btn {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    z-index: 10;
}

.copy-btn:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.glow {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background: radial-gradient(circle at center, rgba(99, 102, 241, 0.2) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.convert-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.convert-animation.active {
    opacity: 1;
    pointer-events: all;
}

.animation-content {
    text-align: center;
}

.animation-content i {
    font-size: 5rem;
    color: var(--primary);
    margin-bottom: 2rem;
    animation: pulse 1.5s infinite;
}

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

#lua_output {
    min-height: 450px;
    font-size: 1.05rem;
}

@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    .header h1 {
        font-size: 2.2rem;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    textarea {
        min-height: 250px;
    }
    
    #lua_output {
        min-height: 350px;
    }
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--success);
    color: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateX(200%);
    transition: transform 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.notification.show {
    transform: translateX(0);
}

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

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

.stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    background: var(--background);
    padding: 1rem;
    border-radius: 0.75rem;
    flex: 1;
    min-width: 120px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-3px);
}

.stat-value {
    display: block;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.result-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.result-tab {
    padding: 0.75rem 1.5rem;
    background: var(--background);
    border-radius: 0.5rem;
    cursor: pointer;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.result-tab:hover {
    border-color: var(--primary);
}

.result-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.download-btn {
    margin-top: 1rem;
    background: var(--background);
    border: 1px solid var(--border);
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-right: 0.75rem;
    margin-bottom: 0.75rem;
}

.download-btn:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.info-banner {
    background: rgba(79, 70, 229, 0.1);
    border-left: 4px solid var(--primary);
    padding: 1.25rem;
    margin-bottom: 2rem;
    border-radius: 0 0.75rem 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.info-banner i {
    color: var(--primary);
    font-size: 1.5rem;
}

.tooltip {
    display: inline-block;
    margin-left: 0.5rem;
    position: relative;
    cursor: pointer;
}

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

.tooltip-text {
    visibility: hidden;
    width: 250px;
    background-color: var(--dark-bg);
    color: white;
    text-align: center;
    border-radius: 0.5rem;
    padding: 0.75rem;
    position: absolute;
    z-index: 100;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
    font-weight: normal;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}