:root {
    --bg-color: #0f1115;
    --card-bg: rgba(25, 28, 36, 0.6);
    --card-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f0f2f5;
    --text-secondary: #a0a4b8;
    --accent-color: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.5);
    
    --font-ui: 'Outfit', sans-serif;
    --font-kalob: 'Gentium Plus', serif;
    
    --transition-speed: 0.3s;
}

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

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

/* Background Effects */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.orb-1 {
    top: -10%;
    left: -10%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(circle, rgba(99,102,241,0.8) 0%, rgba(0,0,0,0) 70%);
}

.orb-2 {
    bottom: -20%;
    right: -10%;
    width: 60vw;
    height: 60vw;
    background: radial-gradient(circle, rgba(139,92,246,0.6) 0%, rgba(0,0,0,0) 70%);
}

/* Layout */
.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.app-header {
    text-align: center;
    margin-bottom: 2rem;
}

.app-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a5b4fc, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

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

/* Glassmorphism Panel */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    margin-bottom: 3rem;
}

/* Settings Area */
.settings-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.setting-item {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    flex: 1 1 calc(50% - 0.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.setting-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Radio Buttons */
.radio-group {
    display: flex;
    gap: 1rem;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
    gap: 0.4rem;
}

.radio-label input {
    display: none;
}

.radio-custom {
    width: 16px;
    height: 16px;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    position: relative;
    transition: all var(--transition-speed);
}

.radio-label input:checked + .radio-custom {
    border-color: var(--accent-color);
}

.radio-label input:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
}

/* Toggle Switch */
.toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    cursor: pointer;
}

.toggle-label .label-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.1);
    transition: var(--transition-speed);
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: #fff;
    transition: var(--transition-speed);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--accent-color);
    box-shadow: 0 0 8px var(--accent-glow);
}

input:checked + .slider:before {
    transform: translateX(20px);
}

/* Input Area */
.input-area textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 1.5rem;
    transition: border-color var(--transition-speed);
}

.input-area textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-glow);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* Output Area */
.output-area {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    padding: 1rem;
    border: 1px solid var(--card-border);
}

.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
}

.output-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-copy {
    background: var(--accent-color);
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: all var(--transition-speed);
}

.btn-copy:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

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

#kalobOut {
    min-height: 60px;
    font-size: 2.5rem;
    line-height: 1.5;
    word-break: break-word;
    white-space: pre-wrap;
}

.kalob-text {
    font-family: var(--font-kalob);
}

.hidden {
    display: none;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #10b981;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    font-weight: 600;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    pointer-events: none;
    z-index: 100;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Documentation Section */
.documentation {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.documentation h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: -1em;
    color: white;
}

.documentation h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #e2e8f0;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.5rem;
}

.documentation h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: #cbd5e1;
}

.documentation h4 {
    font-size: 1.1rem;
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
    color: #94a3b8;
}

.documentation p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.documentation ul {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.documentation li {
    margin-bottom: 0.5rem;
}

.documentation strong {
    color: #e2e8f0;
}

.documentation em {
    color: #cbd5e1;
}

.documentation code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9em;
    color: #a5b4fc;
}

.documentation hr {
    border: 0;
    height: 1px;
    background: var(--card-border);
    margin: 2rem 0;
}

/* Table Styles */
.table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.documentation table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
}

.documentation th {
    background: rgba(0, 0, 0, 0.4);
    padding: 0.75rem 1rem;
    text-align: left;
    color: #e2e8f0;
    font-weight: 600;
}

.documentation td {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--card-border);
    color: var(--text-secondary);
}

.documentation tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
}

.documentation td .kalob-text {
    font-size: 1.4em;
    vertical-align: middle;
}

/* Footer */
.app-footer {
    text-align: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.app-footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

.app-footer a:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .setting-item {
        flex: 1 1 100%;
    }
    
    .documentation {
        padding: 1.5rem;
    }
    
    #kalobOut {
        font-size: 2rem;
    }
}