:root {
    --primary-color: #6c5ce7;
    --secondary-color: #00cec9;
    --dark-bg: #0f0f17;
    --card-bg: #1a1a25;
    --text-primary: #f1f1f1;
    --text-secondary: #a0a0a0;
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #ff7675;
    --border-radius: 16px;
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 15px 25px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

html,
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    background: linear-gradient(135deg, #0f0f17 0%, #1a1a25 100%);
}

/* Glassmorphism Effect */
.glass {
    background: rgba(26, 26, 37, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #0f0f17 0%, #1a1a25 100%);
    position: relative;
    overflow: hidden;
}

.gradient-text {
    font-size: clamp(1.5rem, 4vw, 2rem);
    background: linear-gradient(135deg, #6c5ce7, #00cec9, #a29bfe);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    padding-bottom: 10px;
    animation: gradientShift 5s ease infinite;
    transition: transform 0.3s ease, filter 0.3s ease;

}

/* Animated Background */
.container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 80%, rgba(108, 92, 231, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(0, 206, 201, 0.15) 0%, transparent 50%);
    z-index: -1;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 0.8;
    }
}

header {
    padding: 20px 30px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    align-items: center;



}

header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg,
            transparent 0%,
            var(--primary-color) 50%,
            transparent 100%);
    opacity: 0.5;
}

header h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    margin-bottom: 8px;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 2px 10px rgba(108, 92, 231, 0.3);
}

.subtitle {
    color: var(--secondary-color);
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 500;
}

.controls {
    background: rgba(255, 255, 255, 0.05);
    padding: 15px 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
}

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

button {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    min-width: 120px;
    justify-content: center;
}

button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

button:active::before {
    width: 200px;
    height: 200px;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

button.success {
    background: linear-gradient(135deg, var(--success) 0%, #00a085 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
}

button.success:hover {
    background: linear-gradient(135deg, #26d9b8 0%, var(--success) 100%);
    box-shadow: 0 8px 25px rgba(0, 184, 148, 0.4);
}

button.secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #e0e0e0;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

button.secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
}

button.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #f9c74f 100%);
    color: #2d3436;
    box-shadow: 0 4px 15px rgba(253, 203, 110, 0.3);
}

button.warning:hover {
    background: linear-gradient(135deg, #ffe066 0%, var(--warning) 100%);
}

button.danger {
    background: linear-gradient(135deg, var(--danger) 0%, #ff5252 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 118, 117, 0.3);
}

button.danger:hover {
    background: linear-gradient(135deg, #ff8a80 0%, var(--danger) 100%);
}

.main-content {
    display: grid;
    grid-template-columns: 70% 30%;
    flex: 1;
    overflow: hidden;
    min-height: 0;
    gap: 20px;
    padding: 20px;
    position: relative;
}

.editor-section,
.output-section {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    background: rgba(26, 26, 37, 0.7);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.editor-section:hover,
.output-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.output-section {
    border-radius: var(--border-radius);
}

.section-header {
    background: rgba(0, 0, 0, 0.3);
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.section-title {
    color: var(--primary-color);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.section-controls {
    display: flex;
    gap: 10px;
}

.editor-container {
    flex: 1;
    overflow: hidden;
    min-height: 0;
    display: flex;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

#editor {
    flex: 1;
    background: #1e1e1e;
    border: none;
    outline: none;
    padding: 25px;
    font-family: 'Cascadia Code', 'Consolas', 'Monaco', monospace;
    font-size: 15px;
    line-height: 1.6;
    color: #d4d4d4;
    resize: none;
    overflow: auto;
    tab-size: 4;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
}

/* Custom Scrollbar for Editor */
#editor::-webkit-scrollbar {
    width: 12px;
}

#editor::-webkit-scrollbar-track {
    background: #2d2d2d;
}

#editor::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 6px;
    border: 3px solid #2d2d2d;
}

#editor::-webkit-scrollbar-thumb:hover {
    background: #666;
}

.language-panel {
    width: 180px;
    background: rgba(2, 6, 23, 0.9);
    border-left: 1px solid rgba(30, 41, 59, 0.5);
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
    transition: width 0.3s ease;
}

.language-panel:hover {
    width: 200px;
}

.language-title {
    padding: 15px;
    font-size: 14px;
    font-weight: bold;
    color: #38bdf8;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
    background: rgba(30, 41, 59, 0.3);
    display: flex;
    align-items: center;
    gap: 8px;
}

.language-title i {
    font-size: 16px;
}

#languageList {
    list-style: none;
    padding: 10px 0;
}

#languageList li {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    color: #cbd5f5;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

#languageList li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary-color);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

#languageList li:hover {
    background: rgba(30, 41, 59, 0.6);
    padding-left: 25px;
}

#languageList li:hover::before {
    transform: translateX(0);
}

#languageList li.active {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.2) 0%, transparent 100%);
    color: var(--secondary-color);
    font-weight: 700;
    border-left: 4px solid var(--secondary-color);
}

#output {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    background: #1e1e1e;
    font-family: 'Cascadia Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #d4d4d4;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Console Output Styling */
.console-entry {
    margin-bottom: 12px;
    padding: 12px;
    border-left: 4px solid;
    background: #020617;
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.console-entry:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.console-entry.log {
    border-color: var(--success);
    background: rgba(0, 184, 148, 0.05);
}

.console-entry.error {
    border-color: var(--danger);
    background: rgba(255, 118, 117, 0.05);
}

.console-entry.warn {
    border-color: var(--warning);
    background: rgba(253, 203, 110, 0.05);
}

.console-entry.info {
    border-color: #3b82f6;
    background: rgba(59, 130, 246, 0.05);
}

.console-header {
    display: flex;
    gap: 8px;
    font-size: 11px;
    margin-bottom: 6px;
    align-items: center;
}

.badge {
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.badge.log {
    background: var(--success);
    color: white;
}

.badge.error {
    background: var(--danger);
    color: white;
}

.badge.warn {
    background: var(--warning);
    color: #2d3436;
}

.badge.info {
    background: #3b82f6;
    color: white;
}

.timestamp {
    color: var(--text-secondary);
    font-family: 'Consolas', monospace;
}

.console-body pre {
    background: rgba(255, 255, 255, 0.02);
    padding: 10px;
    border-radius: 6px;
    margin: 8px 0 0 0;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.5;
}

.console-body pre code {
    font-family: 'Cascadia Code', 'Consolas', monospace;
    color: #d4d4d4;
}

.status-bar {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
}

#status {
    font-weight: 600;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.status-item i {
    font-size: 14px;
}

.loader {
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    display: none;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 400px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform-origin: right bottom;
}

.toast.show {
    display: block;
    animation: slideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.toast.success {
    background: linear-gradient(135deg, var(--success) 0%, #00a085 100%);
}

.toast.error {
    background: linear-gradient(135deg, var(--danger) 0%, #ff5252 100%);
}

.toast.warning {
    background: linear-gradient(135deg, var(--warning) 0%, #f9c74f 100%);
    color: #2d3436;
}

.toast.info {
    background: linear-gradient(135deg, #339af0 0%, #1971c2 100%);
}

@keyframes slideIn {
    from {
        transform: translateX(100%) scale(0.8);
        opacity: 0;
    }

    to {
        transform: translateX(0) scale(1);
        opacity: 1;
    }
}

/* Snippets Panel */
.snippets-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(30, 30, 30, 0.95);
    border-radius: var(--border-radius);
    padding: 0;
    z-index: 1001;
    display: none;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    overflow: hidden;
    border: 2px solid var(--primary-color);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
}

.snippets-panel.show {
    display: block;
    animation: modalFadeIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.snippets-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px 25px;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.close-snippets {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-snippets:hover {
    background: rgba(255, 255, 255, 0.1);
}

.snippets-list {
    padding: 25px;
    overflow-y: auto;
    max-height: calc(80vh - 70px);
    display: grid;
    gap: 15px;
}

.snippet-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.snippet-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg,
            rgba(108, 92, 231, 0.1) 0%,
            rgba(0, 206, 201, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.snippet-item:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.snippet-item:hover::before {
    opacity: 1;
}

.snippet-title {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    position: relative;
    z-index: 1;
}

.snippet-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    border: 3px solid transparent;
    background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .main-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr;
    }

    .editor-section,
    .output-section {
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 15px 20px;
    }

    header h2 {
        font-size: 1.5rem;
    }

    .controls {
        padding: 12px 20px;
    }

    .button-group {
        gap: 8px;
    }

    button {
        padding: 8px 16px;
        font-size: 0.9rem;
        min-width: auto;
    }

    .main-content {
        padding: 15px;
        gap: 15px;
    }

    .section-header {
        padding: 12px 20px;
    }

    #editor,
    #output {
        padding: 20px;
    }

    .language-panel {
        width: 60px;
    }

    .language-panel:hover {
        width: 200px;
    }

    #languageList li span {
        display: none;
    }

    .language-panel:hover #languageList li span {
        display: inline;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.slide-up {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Pulse Animation for Important Elements */
@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Selection Styling */
::selection {
    background: rgba(108, 92, 231, 0.3);
    color: white;
}

/* Focus Styles for Accessibility */
:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 15, 23, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

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

.loading-text {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 500;
}