:root {
	--font-sans: "Poppins", ui-sans-serif, system-ui, sans-serif;
	--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	--font-abhaya: "Abhaya Libre", serif;
	--color-primary: #2563eb;
	--color-primary-light: #dbeafe;
	--color-gray-600: #3d444f;
	--color-gray-100: #f3f4f6;
	--color-gray-50: #f9fafb;
	--gradient-circle-large: 24rem;
	--gradient-circle-small: 20rem;
	--title-color: #2563eb;
	--container-opacity: 0.7;
	--container-bg: rgba(255, 255, 255, 0.7);
	--sidebar-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
	--container-radius: 1rem;
	--blur-strength: 12px;
	--glass-border: rgba(255, 255, 255, 0.1);
	--glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
	--bg-color: white;
	--text-color: #1f2937;
	--text-color-secondary: #6b7280;
	--textarea-bg: white;
	--textarea-border: #e5e7eb;
	--gradient-opacity: 0.15;
	--font-ttf: "Abhaya Libre", serif;
	--border-color: #e5e7eb;
	--bg-color-secondary: #f9fafb;
	--hover-color: #e0e7ff; 

	--btn-size-sm: 2.25rem;
	--btn-size-md: 2.75rem;
	--btn-size-lg: 3.25rem;
	--btn-radius-sm: 0.375rem;
	--btn-radius-md: 0.5rem;
	--btn-radius-lg: 0.75rem;
	--btn-padding-sm: 0.5rem 0.75rem;
	--btn-padding-md: 0.75rem 1rem;
	--btn-padding-lg: 1rem 1.5rem;
	--btn-transition: all 0.2s ease;
	--btn-hover-transform: translateY(-2px);
	--btn-active-transform: scale(0.98);
	--btn-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	--btn-shadow-hover: 0 4px 6px rgba(0, 0, 0, 0.1);
	--btn-icon-size-sm: 1.25rem;
	--btn-icon-size-md: 1.5rem;
	--btn-icon-size-lg: 2rem;
	--btn-border: 1px solid var(--glass-border);
}

[data-theme="dark"] {
	--bg-color: #1f2937;
	--text-color: #f3f4f6;
	--text-color-secondary: #9ca3af;
	--container-bg: var(--bg-color);
	--textarea-bg: var(--bg-color);
	--textarea-border: #334155;
	--gradient-opacity: 0.2;
	--title-color: #60a5fa;
	--sidebar-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
	--glass-border: rgba(255, 255, 255, 0.05);
	--glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
	--color-primary: #60a5fa;
	--color-primary-light: rgba(96, 165, 250, 0.1);
	--color-gray-600: #94a3b8;
	--color-gray-100: var(--bg-color);
	--color-gray-50: var(--bg-color);
	--card-bg: var(--bg-color);
	--border-color: #374151;
	--hover-color: #334155; 
	--bg-color-secondary: #111827;
	--hover-bg: #374151;

	--btn-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
	--btn-shadow-hover: 0 4px 6px rgba(0, 0, 0, 0.2);
}

html,
body {
    overflow-x: hidden; 
    overflow-y: auto; 
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none; 
}

body {
	margin: 0;
	padding: 0;
	min-height: 100vh;
	background-color: var(--bg-color);
	color: var(--text-color);
	font-family: var(--font-sans);
	position: relative;
	transition: background-color 0.3s ease, color 0.3s ease;
}

.gradient-circle {
	position: fixed;
	border-radius: 50%;
	filter: blur(80px);
	opacity: 0.15;
	z-index: -1;
	pointer-events: none;
}

.gradient-circle-blue {
	width: 600px;
	height: 600px;
	background: linear-gradient(45deg, #3b82f6, #60a5fa);
	top: -200px;
	right: -100px;
}

.gradient-circle-purple {
	width: 500px;
	height: 500px;
	background: linear-gradient(45deg, #8b5cf6, #a78bfa);
	bottom: -150px;
	left: -100px;
}

.title-container {
	width: 100%;
	max-width: 600px;
	text-align: center;
	padding: 0.5rem 0;
	position: relative;
	z-index: 10;
	margin-bottom: 1rem;
}

.title {
	font-size: 3.25rem;
	font-weight: bold;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.3rem;
}

.title-primary {
	color: #000000;
	font-size: 3.25rem;
}

.title-gradient {
	background: linear-gradient(to right, #1696f5, #64acfa);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
	color: transparent;
	font-size: 3.25rem;
}

[data-theme="dark"] .title-primary {
	color: #ffffff;
}

@media (max-width: 768px) {
	.title-container {
		margin-bottom: 0.5rem;
	}

	.title,
	.title-primary,
	.title-gradient {
		font-size: 2.25rem;
	}

	.gradient-circle-blue {
		width: 400px;
		height: 400px;
		top: -100px;
		right: -50px;
	}

	.gradient-circle-purple {
		width: 300px;
		height: 300px;
		bottom: -100px;
		left: -50px;
	}
}

@media (min-width: 768px) {
	.title,
	.title-primary,
	.title-gradient {
		font-size: 3.25rem;
	}
}

[data-theme="dark"] .title-primary {
	color: #ffffff;
}

@keyframes gradient-shift {
	0% {
		background-position: 0% 50%;
	}

	50% {
		background-position: 100% 50%;
	}

	100% {
		background-position: 0% 50%;
	}
}

[data-theme="dark"] .title-primary {
	color: #ffffff;
}

@media (min-width: 768px) {
	.title,
	.title-primary,
	.gradient-text {
		font-size: 3.25rem;
	}
}

.sidebar {
	border-radius: 1.25rem;
	background-color: var(--container-bg);
	backdrop-filter: blur(var(--blur-strength));
	-webkit-backdrop-filter: blur(var(--blur-strength));
	border: 1px solid var(--glass-border);
	box-shadow: var(--glass-shadow);
	transition: all 0.3s ease;
	z-index: 40;
}

.sidebar-button {
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 0.5rem;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	cursor: pointer;
	position: relative;
}

.sidebar-button-active {
	background-color: var(--color-primary-light);
	color: var(--color-primary);
	transform: scale(1.05);
}

.sidebar-button-default {
	color: var(--color-gray-600);
}

.sidebar-button:hover {
	transform: translateY(-2px);
	background-color: var(--color-primary-light);
	color: var(--color-primary);
}

[data-theme="dark"] .sidebar-button {
	color: #94a3b8;
}

[data-theme="dark"] .sidebar-button-active {
	background-color: rgba(96, 165, 250, 0.15);
	color: #60a5fa;
}

[data-theme="dark"] .sidebar-button:hover:not(.sidebar-button-active) {
	background-color: rgba(148, 163, 184, 0.1);
	color: #60a5fa;
}

@media (max-width: 768px) {
	.gradient-circle {
		display: none;
	}
	.title-container {
		top: 1rem;
	}
	.main-container {
		padding: 0.75rem;
		gap: 0.5rem;
	}
	.content-wrapper {
		padding: 0 0.5rem;
	}
	.sidebar {
		position: fixed;
		bottom: 1rem;
		left: 50%;
		transform: translateX(-50%);
		padding: 0.5rem;
		background-color: var(--container-bg);
		border-radius: var(--container-radius);
		box-shadow: var(--glass-shadow);
		z-index: 20;
	}
}

@media (min-width: 769px) {
    .sidebar {
        position: static; /* or relative */
        width: 100%;
        z-index: 1;
    }

	.sidebar nav {
		display: flex;
		flex-direction: column;
		gap: 0.75rem;
	}
    .mode-card {
        margin-top: 16px;
        width: 100%;
        z-index: 2;
        position: relative; /* or static */
  }
}

.sidebar-button-active::after {
	content: "";
	position: absolute;
	left: -0.5rem;
	top: 50%;
	transform: translateY(-50%);
	width: 3px;
	height: 1.5rem;
	background-color: var(--color-primary);
	border-radius: 0 2px 2px 0;
	opacity: 0;
	transition: opacity 0.2s ease;
}

[data-theme="dark"] .sidebar-button-active::after {
	background-color: #60a5fa;
}

@media (min-width: 769px) {
	.sidebar-button-active::after {
		opacity: 1;
	}
}

.app-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    gap: 1rem;
}

.content-wrapper {
    width: 100%;
    max-width: 850px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 1rem;
    padding: 0 1rem;
}

.main-container {
    width: 100%;
    max-width: 900px !important;
    background-color: var(--container-bg);
    backdrop-filter: blur(var(--blur-strength));
    -webkit-backdrop-filter: blur(var(--blur-strength));
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: var(--container-radius);
    transition: all 0.3s ease;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.main-container:hover {
	transform: translateY(-2px);
	box-shadow: var(--glass-shadow), 0 10px 40px 0 rgba(0, 0, 0, 0.1);
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.25rem;
    border-radius: var(--btn-radius-md);
    font-size: 1rem;
	font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    position: relative;
    overflow: hidden;
    z-index: 1;
    color: var(--text-color);
}

.button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
	border-color: var(--color-primary);
    color: var(--color-primary);
}

.button:hover::before {
    opacity: 0.1;
}

.button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.button i {
    width: var(--btn-icon-size-md);
    height: var(--btn-icon-size-md);
    color: currentColor;
    transition: color 0.2s ease;
}

.button:hover i {
    color: currentColor;
}

.button-primary {
	background-color: var(--color-primary);
	color: white;
	border: 1px solid var(--color-primary);
}

.button-primary:hover {
    background-color: var(--color-primary);
    opacity: 0.95;
	border-color: var(--color-primary);
    color: white;
}

.button-secondary {
    background-color: var(--bg-color-secondary);
    color: var(--text-color-secondary);
    border: 1px solid var(--border-color);
}

.button-secondary:hover {
    background-color: var(--bg-color-secondary);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.button-secondary i {
    color: currentColor;
}

.button-secondary:hover i {
    color: currentColor;
}

[data-theme="dark"] .button {
    background-color: var(--bg-color);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    color: var(--text-color);
}

[data-theme="dark"] .button:hover {
    background-color: var(--bg-color);
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    color: var(--color-primary);
}

[data-theme="dark"] .button i {
    color: currentColor;
}

[data-theme="dark"] .button:hover i {
    color: currentColor;
}

[data-theme="dark"] .button-primary {
    background-color: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

[data-theme="dark"] .button-primary:hover {
    background-color: var(--color-primary);
    opacity: 0.95;
    border-color: var(--color-primary);
    color: white;
}

[data-theme="dark"] .button-secondary {
    background-color: var(--bg-color-secondary);
    color: var(--text-color-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .button-secondary:hover {
    background-color: var(--bg-color-secondary);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

[data-theme="dark"] .button-secondary i {
    color: currentColor;
}

[data-theme="dark"] .button-secondary:hover i {
    color: currentColor;
}

.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    background: var(--bg-color);
    border: 2px solid var(--color-primary);
    cursor: pointer;
    z-index: 100;
}

#theme-icon {
    display: block;
    transition: transform 0.3s ease;
}

.theme-toggle:hover #theme-icon {
    transform: rotate(90deg);
}

.swipe-mode-btn,
.settings-btn {
    width: var(--btn-size-md);
    height: var(--btn-size-md);
    border-radius: var(--btn-radius-md);
    background-color: var(--bg-color); 
    border: 1px solid var(--border-color); 
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.swipe-mode-btn::before,
.settings-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

.swipe-mode-btn:hover,
.settings-btn:hover {
    transform: translateY(-1px); 
    background-color: var(--bg-color); 
    border-color: var(--color-primary); 
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1); 
}

.swipe-mode-btn:hover::before,
.settings-btn:hover::before {
    opacity: 0.1;
}

.swipe-mode-btn:active,
.settings-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.swipe-mode-btn i,
.settings-btn i {
    width: var(--btn-icon-size-md);
    height: var(--btn-icon-size-md);
    color: var(--text-color-secondary); 
    transition: color 0.2s ease;
    display: inline-block;
    transform-origin: center;
    position: relative;
    z-index: 1;
}

.swipe-mode-btn:hover i,
.settings-btn:hover i {
    color: var(--color-primary); 
}

[data-theme="dark"] .button,
[data-theme="dark"] .button-secondary,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .swipe-mode-btn,
[data-theme="dark"] .settings-btn {
    background-color: var(--bg-color);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .button:hover,
[data-theme="dark"] .button-secondary:hover,
[data-theme="dark"] .theme-toggle:hover,
[data-theme="dark"] .swipe-mode-btn:hover,
[data-theme="dark"] .settings-btn:hover {
    background-color: var(--bg-color);
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .button i,
[data-theme="dark"] .button-secondary i,
[data-theme="dark"] .theme-toggle i,
[data-theme="dark"] .swipe-mode-btn i,
[data-theme="dark"] .settings-btn i {
    color: var(--text-color-secondary);
}

[data-theme="dark"] .button:hover i,
[data-theme="dark"] .button-secondary:hover i,
[data-theme="dark"] .theme-toggle:hover i,
[data-theme="dark"] .swipe-mode-btn:hover i,
[data-theme="dark"] .settings-btn:hover i {
    color: var(--color-primary);
}

@media (max-width: 640px) {
    .theme-toggle,
    .swipe-mode-btn,
    .settings-btn {
        width: var(--btn-size-sm);
        height: var(--btn-size-sm);
    }

    .theme-toggle i,
    .swipe-mode-btn i,
    .settings-btn i {
        width: var(--btn-icon-size-sm);
        height: var(--btn-icon-size-sm);
    }
}

.btn-hover-effect:hover {
	transform: translateY(-2px);
	transition: all 0.2s ease;
}

.textarea-focus-effect {
  resize: none;
  width: 100%;
  min-height: 100px;
  padding: 0.75rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  background-color: #ffffff;
  color: #1f2937;
  font-size: 1rem;
  line-height: 1.5;
  transition: all 0.2s ease;
}

.textarea-focus-effect:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

@media (prefers-color-scheme: dark) {
  .textarea-focus-effect {
    background-color: var(--bg-primary);
    border-color: #374151;
    color: var(--text-primary);
  }

  .textarea-focus-effect:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
  }
}

.textarea-container {
	height: auto;
	position: relative;
    margin-bottom: 0.5rem;
}

#singlish-input {
	height: 140px;
	width: 100%;
	position: relative;
	overflow-y: auto;
	resize: none;
	min-height: 120px;
	max-height: 35vh;
	padding: 14px;
	border-radius: 8px;
	border: 2px solid var(--textarea-border);
	background-color: var(--textarea-bg);
	color: var(--text-color);
	transition: all 0.2s ease;
	font-size: 1.1rem;
}

#singlish-input:focus {
	box-shadow: 0 0 0 2px var(--color-primary-light);
	border-color: var(--color-primary);
	transform: translateY(-1px);
}

#singlish-input:hover {
	border-color: var(--color-primary);
}

[data-theme="dark"] #singlish-input {
	border-color: var(--textarea-border);
	background-color: var(--bg-color);
	color: var(--text-color);
}

[data-theme="dark"] #singlish-input:hover,
[data-theme="dark"] #singlish-input:focus {
	border-color: var(--color-primary);
	box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

.scrollable-textarea {
    resize: none;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--color-primary) var(--color-gray-100);
}

.scrollable-textarea::-webkit-scrollbar {
    width: 8px;
}

.scrollable-textarea::-webkit-scrollbar-track {
    background: var(--color-gray-100);
    border-radius: 10px;
}

.scrollable-textarea::-webkit-scrollbar-thumb {
    background-color: var(--color-primary);
    border-radius: 10px;
    border: 2px solid var(--color-gray-100);
}

.scrollable-textarea:focus {
    outline: none;
}

.scrollable-textarea:hover {
    scrollbar-color: var(--color-primary) var(--color-gray-100);
}

@media (prefers-color-scheme: dark) {
    .scrollable-textarea {
        scrollbar-color: var(--color-primary) var(--bg-primary);
    }

    .scrollable-textarea::-webkit-scrollbar-track {
        background: var(--bg-primary);
    }

    .scrollable-textarea::-webkit-scrollbar-thumb {
        border-color: var(--bg-primary);
    }
}

.theme-toggle {
	position: fixed;
	top: 1rem;
	right: 1rem;
	width: var(--btn-size-md);
	height: var(--btn-size-md);
	border-radius: var(--btn-radius-md);
	background-color: var(--container-bg);
	backdrop-filter: blur(var(--blur-strength));
	-webkit-backdrop-filter: blur(var(--blur-strength));
	border: var(--btn-border);
	box-shadow: var(--btn-shadow);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: var(--btn-transition);
	z-index: 50;
}

.theme-toggle:hover {
    background-color: var(--color-primary-light);
    box-shadow: var(--btn-shadow-hover);
}

.theme-toggle:active {
	transform: var(--btn-active-transform);
}

.theme-toggle i {
    width: var(--btn-icon-size-md);
    height: var(--btn-icon-size-md);
    color: var(--color-gray-600);
    transition: color 0.2s ease;
    display: inline-block;
    transform-origin: center;
}

.theme-toggle:hover i {
    animation: rotate360 0.5s ease-in-out;
}

@media (max-width: 640px) {
    .mode-selector-container {
        padding: 0.375rem;
        gap: 0.5rem;
        flex-wrap: nowrap;
    }

    #mode-tabs {
        gap: 1rem;
        flex-shrink: 1;
    }

    .mode-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }

    .settings-btn,
    .swipe-mode-btn {
        width: 2.25rem;
        height: 2.25rem;
        margin-left: 0;
    }

    .settings-btn i,
    .swipe-mode-btn i {
        width: 1.25rem;
        height: 1.25rem;
    }

    .mode-helper {
        padding: 0.25rem;
        margin-left: 0.25rem;
    }
}

@media (max-width: 480px) {
    .mode-selector-container {
        padding: 0.25rem;
    }

    .mode-tab {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }

    .settings-btn,
    .swipe-mode-btn {
        width: 2rem;
        height: 2rem;
    }

    .settings-btn i,
    .swipe-mode-btn i {
        width: 1.125rem;
        height: 1.125rem;
    }
}

@media (max-width: 480px) {
    .mode-tab {
        padding: 0.5rem 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 360px) {
    .mode-tab {
        padding: 0.375rem 0.25rem;
        font-size: 0.7rem;
    }
}

.font-sinhala {
	font-family: var(--font-sans);
	font-size: 1.1rem;
}

.font-sinhala[data-mode="uni-ttf"],
.font-sinhala[data-mode="sin-ttf"] {
	font-family: var(--font-abhaya) !important;
	font-weight: 500;
	letter-spacing: 0.5px;
}

.font-sinhala[data-mode="sin-uni"],
.font-sinhala[data-mode="uni-sin"] {
	font-family: var(--font-sans);
}

@font-face {
    font-family: "FM Abhaya";
    src: url("assets/fonts/FMAbhaya.ttf") format("truetype");
	font-weight: normal;
	font-style: normal;
}

.sinhala-ttf-font {
	font-family: var(--font-abhaya) !important;
	font-size: 1.2rem;
	letter-spacing: 0.2px;
}

.scrollable-textarea {
	min-height: 100px;
	max-height: 35vh;
	resize: vertical;
}

.button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 500;
	border-radius: 0.5rem;
	transition: all 0.2s;
}

@media (max-width: 640px) {
	.main-container {
		padding: 0.75rem;
	}

	.textarea-container {
		margin-bottom: 0.75rem;
	}

	select#mode-select {
		min-height: 2.75rem;
	}

	.button {
		min-height: 2.75rem;
	}
}

@media (prefers-color-scheme: dark) {
	.scrollable-textarea {
		background-color: var(--bg-color);
		border-color: var(--glass-border);
	}
}

.alert-container {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 50;
}

.alert-container.show {
    opacity: 1;
    visibility: visible;
}

.help-icon {
    width: 1.25rem;
    height: 1.25rem;
    fill: #6b7280;
}

.alert-text {
    color: #374151;
    font-size: 0.875rem;
    font-weight: 400;
}

[data-theme="dark"] .alert-container {
    background-color: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] .help-icon {
    fill: #9ca3af;
}

[data-theme="dark"] .alert-text {
    color: #e5e7eb;
}

.shortcut-btn.editing {
    background-color: #e5e7eb;
    border-color: #6b7280;
}

[data-theme="dark"] .shortcut-btn.editing {
    background-color: #374151;
    border-color: #6b7280;
}

.suggestion-box {
    position: absolute;
    background: var(--container-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    box-shadow: var(--glass-shadow);
    max-height: 150px;
    overflow-y: auto;
    z-index: 1000;
    min-width: 280px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    padding: 4px;
}

.suggestion-item {
    padding: 8px 14px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    margin: 2px 0;
    position: relative;
    color: var(--text-color);
}

.suggestion-item:hover {
    background-color: var(--color-primary-light);
    transform: translateX(4px);
}

.suggestion-item.selected {
    background-color: var(--color-primary-light);
    border-left: 3px solid var(--color-primary);
}

.suggestion-item.selected .suggestion-word {
    color: var(--color-primary);
    font-weight: 600;
}

.suggestion-item.selected .suggestion-sinhala {
    color: var(--color-primary);
    opacity: 1;
}

[data-theme="dark"] .suggestion-box {
    background-color: var(--bg-color);
    border-color: var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] .suggestion-item {
    color: var(--text-color);
}

[data-theme="dark"] .suggestion-item:hover {
    background-color: rgba(37, 99, 235, 0.15);
}

[data-theme="dark"] .suggestion-item.selected {
    background-color: rgba(37, 99, 235, 0.2);
    border-left-color: #60a5fa;
}

[data-theme="dark"] .suggestion-item.selected .suggestion-word,
[data-theme="dark"] .suggestion-item.selected .suggestion-sinhala {
    color: #60a5fa;
}

[data-theme="dark"] .suggestion-item:active {
    background-color: rgba(37, 99, 235, 0.3);
}

[data-theme="dark"] .suggestion-box::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
}

[data-theme="dark"] .suggestion-box::-webkit-scrollbar-thumb:hover {
    background: #60a5fa;
}

.suggestion-box::-webkit-scrollbar {
    width: 6px;
}

.suggestion-box::-webkit-scrollbar-track {
    background: transparent;
}

.suggestion-box::-webkit-scrollbar-thumb {
    background: var(--color-primary-light);
    border-radius: 3px;
}

.suggestion-word {
    font-weight: 500;
    color: var(--text-color);
    flex: 1;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 8px;
}

.suggestion-sinhala {
    color: var(--text-color);
    font-family: var(--font-abhaya);
    text-align: right;
    font-size: 0.9rem;
    opacity: 0.9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 40%;
}

[data-theme="dark"] .suggestion-word,
[data-theme="dark"] .suggestion-sinhala {
    color: var(--text-color);
}

@keyframes slideOut {
    0% {
        transform: translateX(0);
        opacity: 1;
    }
    100% {
        transform: translateX(-20px);
        opacity: 0;
    }
}

@keyframes slideIn {
    0% {
        transform: translateX(20px);
        opacity: 0;
    }
    100% {
        transform: translateX(0);
        opacity: 1;
    }
}

.mode-tab {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-color-secondary);
    transition: all 0.2s ease;
    position: relative;
    border-radius: 0.5rem;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    z-index: 1;
}

.mode-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

.mode-tab:hover {
    color: var(--color-primary);
    background-color: var(--bg-color);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.mode-tab:hover::before {
    opacity: 0.1;
}

.mode-tab.active {
    color: var(--color-primary);
    background-color: var(--bg-color);
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light), 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

[data-theme="dark"] .mode-tab {
    background-color: var(--bg-color);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .mode-tab:hover {
    background-color: var(--bg-color);
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .mode-tab.active {
    background-color: var(--bg-color);
    border: 1px solid var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary), 0 2px 4px rgba(0, 0, 0, 0.2);
}

#swipe-mode-btn {
    transition: var(--btn-transition);
    cursor: pointer;
}

#swipe-mode-btn:hover {
    transform: scale(1.1);
}

#swipe-mode-btn:active {
    transform: scale(0.95);
}

@keyframes rotate180 {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(180deg);
    }
}

.mode-text {
    transition: opacity 0.3s ease;
}

.mode-text.fade-out {
    opacity: 0;
}

.mode-text.fade-in {
    opacity: 1;
}

.mode-helper {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--bg-color);
    border: 1px solid var(--textarea-border);
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mode-helper.show {
    opacity: 1;
    visibility: visible;
}

.mode-helper i {
    color: var(--color-primary);
    flex-shrink: 0;
}

.mode-helper span {
    color: var(--text-color);
    white-space: nowrap;
}

[data-theme="dark"] .mode-helper {
    background-color: var(--bg-color);
    border-color: var(--textarea-border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.mode-tab:not(.main-mode):not(.active) {
  display: none;
}

@keyframes modeFadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
}
@keyframes modeFadeOut {
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 0;
      transform: translateY(-10px);
    }
}
.mode-tab.animated-in {
  animation: modeFadeIn 0.25s ease;
}
.mode-tab.animated-out {
  animation: modeFadeOut 0.25s ease;
}

#settings-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px; 
    background-color: var(--bg-color); 
    box-shadow: -6px 0 20px rgba(0, 0, 0, 0.1); 
    transform: translateX(100%);
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    z-index: 1000;
    overflow-y: auto;
    border-top-left-radius: 1.5rem; 
    border-bottom-left-radius: 1.5rem;
    border: 1px solid var(--border-color); 
}

#settings-modal.show {
    transform: translateX(0);
}

#settings-modal.hidden {
    transform: translateX(100%);
}

[data-theme="dark"] #settings-modal {
    background-color: var(--bg-color);
    box-shadow: -6px 0 20px rgba(0, 0, 0, 0.3); 
    border-color: var(--border-color);
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem; 
    border-bottom: 1px solid var(--border-color); 
    margin-bottom: 0; 
    background-color: var(--bg-color-secondary); 
    border-top-left-radius: 1.5rem; 
    border-bottom: none; 
}

[data-theme="dark"] .settings-header {
    border-bottom-color: var(--border-color);
    background-color: var(--bg-color);
}

.settings-header h2 {
    font-size: 1.625rem; 
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

[data-theme="dark"] .settings-header h2 {
    color: var(--text-color);
}

.settings-header tgs-player {
    width: 28px; 
    height: 28px;
    display: block;
    position: relative;
    z-index: 1;
}

.settings-header tgs-player::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: -1;
}

#close-settings {
    color: var(--text-color-secondary); 
    padding: 0.75rem; 
    border-radius: 50%; 
    background-color: transparent;
    transition: all 0.2s ease;
}

#close-settings:hover {
    background-color: var(--hover-bg); 
    color: var(--color-primary); 
    transform: rotate(90deg); 
}

#close-settings i {
    width: 24px; 
    height: 24px;
}

[data-theme="dark"] #close-settings {
    color: var(--text-color-secondary);
}

[data-theme="dark"] #close-settings:hover {
    background-color: var(--hover-bg);
    color: var(--color-primary);
}

.settings-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    margin-bottom: 1.25rem;
    background-color: var(--bg-color-secondary);
    border-top-left-radius: 0.75rem;
    border-top-right-radius: 0.75rem;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    margin-left: 1rem;
    margin-right: 1rem;
    border-bottom: 1px solid var(--border-color);
    overflow: visible;
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); 
}

[data-theme="dark"] .settings-tabs {
    background-color: var(--bg-color);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); 
}

.settings-tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    color: var(--text-color-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
    background: var(--bg-color); 
    border: 1px solid var(--border-color);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); 
}

.settings-tab::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

.settings-tab i {
    color: var(--text-color-secondary);
}

.settings-tab:hover {
    background-color: var(--bg-color);
    color: var(--color-primary);
    border-color: var(--color-primary);
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.settings-tab:hover::before {
    opacity: 0.1;
}

.settings-tab:hover i {
    color: var(--color-primary);
}

.settings-tab.active {
    color: var(--color-primary) !important;
    background-color: var(--bg-color) !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 2px var(--color-primary-light), 0 2px 4px rgba(0, 0, 0, 0.1) !important;
    transform: translateY(-1px);
    z-index: 10;
}

.settings-tab.active i {
    color: var(--color-primary) !important;
}

[data-theme="dark"] .settings-tab:hover {
    background-color: var(--bg-color);
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .settings-tab:hover i {
    color: var(--color-primary);
}

[data-theme="dark"] .settings-tab.active {
    background-color: var(--bg-color) !important;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 2px var(--color-primary), 0 2px 4px rgba(0, 0, 0, 0.2) !important;
}

[data-theme="dark"] .settings-tab.active i {
    color: var(--color-primary) !important;
}

.theme-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem;
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.theme-option[data-theme="light"] {
    background-color: #ffffff; 
    border: 2px solid #e5e7eb;
}

.theme-option[data-theme="dark"] {
    background-color: #1f2937; 
    border: 2px solid #374151;
}

.theme-option::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, var(--color-primary), var(--color-primary-light));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.theme-indicator {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    z-index: 1;
}

.theme-indicator-light {
    background: #ffffff !important;
    border: 2px solid #e5e7eb !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.theme-indicator-dark {
    background: #1f2937 !important;
    border: 2px solid #111827 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.theme-option[data-theme="light"] .theme-indicator {
    border-color: #9ca3af; 
}

.theme-option[data-theme="dark"] .theme-indicator {
    border-color: #6b7280; 
}

.theme-option span {
    font-weight: 500;
    color: var(--text-color); 
    transition: color 0.3s ease;
    z-index: 1;
}

.theme-option[data-theme="light"] span {
    color: #4b5563; 
}

.theme-option[data-theme="dark"] span {
    color: #f3f4f6; 
}

.theme-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-option:hover::before {
    opacity: 0.05;
}

.theme-option.active {
    border-color: var(--color-primary); 
    box-shadow: 0 0 0 2px var(--color-primary-light), 0 4px 12px rgba(0, 0, 0, 0.1);
}

.theme-option.active .theme-indicator {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

.theme-option:hover .theme-indicator-light,
.theme-option:hover .theme-indicator-dark {
    border-color: var(--color-primary) !important;
}

.theme-option.active .theme-indicator-light,
.theme-option.active .theme-indicator-dark {
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

[data-theme="dark"] .theme-option:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-option.active {
    box-shadow: 0 0 0 2px var(--color-primary), 0 4px 12px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .theme-option span {
    color: var(--text-color); 
}

[data-theme="dark"] .theme-option[data-theme="dark"] {

    background-color: #1f2937; 
    border-color: #374151; 
    color: #f3f4f6; 
}

[data-theme="dark"] .theme-option[data-theme="dark"] span {
    color: #f3f4f6; 
}

[data-theme="dark"] .theme-option[data-theme="dark"] div {
    background-color: #1f2937; 
    border-color: #111827;
}

[data-theme="dark"] .theme-option[data-theme="dark"]:hover {
    background-color: #334155; 
    border-color: var(--color-primary);
    color: var(--color-primary); 
}

[data-theme="dark"] .theme-option[data-theme="dark"]:hover span {
    color: var(--color-primary); 
}

#custom-font-btn {
    background-color: var(--bg-color-secondary);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    z-index: 1;
    color: var(--text-color); 
}

#custom-font-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

#custom-font-btn:hover {
    transform: translateY(-1px);
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    color: var(--color-primary);
}

#custom-font-btn:hover::before {
    opacity: 0.1;
}

#custom-font-btn i {
    color: currentColor;
}

[data-theme="dark"] #custom-font-btn {
    background-color: var(--bg-color);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] #custom-font-btn:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.text-size-btn {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    z-index: 1;
    color: var(--text-color-secondary);
}

.text-size-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

.text-size-btn:hover {
    transform: translateY(-1px);
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    color: var(--color-primary);
}

.text-size-btn:hover::before {
    opacity: 0.1;
}

.text-size-btn i {
    color: currentColor;
}

[data-theme="dark"] .text-size-btn {
    background-color: var(--bg-color);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    color: var(--text-color); 
}

[data-theme="dark"] .text-size-btn:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    color: var(--color-primary); 
}

.settings-content {
    padding: 0.75rem;
    overflow-y: auto; 
}

.settings-panel {
    display: none;
    padding: 0.5rem;
}

.settings-panel.active {
    display: block;
}

.setting-item {
    margin-bottom: 0.75rem;
}

.setting-item label {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
}

.setting-description {
    font-size: 0.875rem;
    color: var(--text-color-secondary);
    margin-top: 0.5rem;
    margin-left: 0;
    line-height: 1.4;
    display: block;
}

[data-theme="dark"] .setting-description {
    color: #9ca3af;
}

.toggle-wrapper {
    position: relative;
    display: inline-block;
}

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

.toggle-label {
    position: relative;
    display: inline-block;
    width: 2.5rem; 
    height: 1.25rem; 
    background-color: var(--border-color);
    border-radius: 1.25rem; 
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-label:before {
    content: "";
    position: absolute;
    top: 0.125rem; 
    left: 0.125rem; 
    width: 0.9rem; 
    height: 0.9rem; 
    background-color: var(--bg-color);
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-input:checked + .toggle-label {
    background-color: #3b82f6;
}

.toggle-input:checked + .toggle-label:before {
    transform: translateX(1.2rem); 
}

.toggle-input:focus + .toggle-label {
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

[data-theme="dark"] .toggle-label {
    background-color: #374151;
}

[data-theme="dark"] .toggle-label:before {
    background-color: #f3f4f6;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .toggle-input:checked + .toggle-label {
    background-color: #3b82f6;
}

.toggle-label:hover {
    background-color: #d1d5db;
}

[data-theme="dark"] .toggle-label:hover {
    background-color: #4b5563;
}

.toggle-input:disabled + .toggle-label {
    opacity: 0.5;
    cursor: not-allowed;
}

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

.toggle-input:checked + .toggle-label:before {
    animation: toggleOn 0.3s ease;
}

.toggle-container {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.4rem; 
    gap: 0.6rem;
}

.toggle-container > div:first-child {
    flex: 1;
}

.setting-description {
    font-size: 0.875rem;
    color: var(--text-color-secondary);
    margin-top: 0.5rem;
    margin-left: 0;
    line-height: 1.4;
    display: block;
}

[data-theme="dark"] .setting-description {
    color: #9ca3af;
}

.setting-item {
    margin-bottom: 0;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background-color: transparent;
    transition: all 0.3s ease;
    border: none; 
    box-shadow: none; 
}

.setting-item .theme-options-grid,
.setting-item .font-select-container,
.setting-item .text-size-controls,
.setting-item .toggle-container {
    background-color: var(--bg-color-secondary);
    border-radius: 0.5rem;
    padding: 0.4rem; 
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

.setting-item .theme-options-grid:hover,
.setting-item .font-select-container:hover,
.setting-item .text-size-controls:hover,
.setting-item .toggle-container:hover {
    transform: translateY(-1px);
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .setting-item .theme-options-grid,
[data-theme="dark"] .setting-item .font-select-container,
[data-theme="dark"] .setting-item .text-size-controls,
[data-theme="dark"] .setting-item .toggle-container {
    background-color: var(--bg-color);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .setting-item .theme-options-grid:hover,
[data-theme="dark"] .setting-item .font-select-container:hover,
[data-theme="dark"] .setting-item .text-size-controls:hover,
[data-theme="dark"] .setting-item .toggle-container:hover {
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .setting-item {
    background-color: transparent;
}

.setting-item:hover {
    background-color: transparent;
}

[data-theme="dark"] .setting-item:hover {
    background-color: transparent;
}

.copy-success {
    animation: copySuccess 0.5s ease-out;
}

@keyframes copySuccess {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
        background-color: #059669; 
    }
    100% {
        transform: scale(1);
    }
}

.button-primary.has-content {
    animation: typing-pause-shine 0.5s ease-out;
}

@keyframes typing-pause-shine {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.2);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    }
}

@keyframes draftRecover {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.recovering-draft {
    animation: draftRecover 0.5s ease-out;
}

.upload-container {
    background-color: var(--card-bg);
    transition: all 0.3s ease;
}

.upload-container.drag-over {
    border-color: var(--primary-color);
    background-color: rgba(22, 150, 245, 0.05);
}

.progress-bar {
    width: 100%;
    height: 4px;
    background-color: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.mode-card {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.mode-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

.mode-card:hover {
    transform: translateY(-1px);
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.mode-card:hover::before {
    opacity: 0.1;
}

.mode-card.selected {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mode-card:hover .mode-icon i,
.mode-card:hover .mode-title,
.mode-card:hover .mode-description {
    color: var(--color-primary);
}

.mode-description   {
    text-align:center
}

[data-theme="dark"] .mode-card {
    background-color: var(--bg-color);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .mode-card:hover {
    background-color: var(--bg-color);
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .mode-card.selected {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.download-option {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.download-option::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

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

.download-option:hover::before {
    opacity: 0.1;
}

.download-option i {
    color: var(--text-color-secondary);
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.download-option span {
    color: var(--text-color); 
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.download-option:hover i,
.download-option:hover span {
    color: var(--color-primary);
}

[data-theme="dark"] .download-option {
    background-color: var(--bg-color);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .download-option:hover {
    background-color: var(--bg-color);
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .download-option i,
[data-theme="dark"] .download-option span {
    color: var(--text-color-secondary);
}

[data-theme="dark"] .download-option:hover i,
[data-theme="dark"] .download-option:hover span {
    color: var(--color-primary);
}

.custom-font-input {
    display: none;
}

.custom-font-input.show {
    display: block;
}

.font-preview {
    margin-bottom: 1rem;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-color-secondary);
    min-height: 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-color);
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    line-height: 1.5;
}

.font-preview:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.font-preview span {
    font-family: inherit;
    line-height: 1.5;
    display: inline-block;
    padding: 0.5rem;
    color: var(--text-color);
}

.font-select-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

#font-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
}

#font-select:hover {
    border-color: var(--primary-color);
}

#font-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color-light);
}

@keyframes fontChange {
    0% {
        opacity: 0.5;
    }
    100% {
        opacity: 1;
    }
}

.font-changing {
    animation: fontChange 0.3s ease;
}

.font-loading {
    position: relative;
    pointer-events: none;
}

.font-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

#mode-tabs {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

#sinhala-output {
	resize: none;
	height: 140px;
	width: 100%;
	position: relative;
	overflow-y: auto;
	min-height: 120px;
	max-height: 35vh;
	padding: 14px;
	border-radius: 8px;
	border: 2px solid var(--textarea-border);
	background-color: var(--textarea-bg);
	color: var(--text-color);
	transition: all 0.2s ease;
	font-size: 1.1rem;
}

#sinhala-output:focus {
	box-shadow: 0 0 0 2px var(--color-primary-light);
	border-color: var(--color-primary);
	transform: translateY(-1px);
}

#sinhala-output:hover {
	border-color: var(--color-primary);
}

[data-theme="dark"] #sinhala-output {
	border-color: var(--textarea-border);
	background-color: var(--bg-color);
	color: var(--text-color);
}

[data-theme="dark"] #sinhala-output:hover,
[data-theme="dark"] #sinhala-output:focus {
	border-color: var(--color-primary);
	box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

@media (max-width: 768px) {
    .app-container {
        padding: 0.5rem;
        gap: 0.5rem;
    }

    .title-container {
        margin-bottom: 0.5rem;
}

.content-wrapper {
        margin-top: 1rem;
    }

    .main-container {
        padding: 1rem;
        gap: 1rem;
    }

    .scrollable-textarea {
        height: 100px;
        min-height: 80px;
        padding: 0.5rem;
    }

    .title,
    .title-primary,
    .title-gradient {
        font-size: 2.25rem;
    }
}

.caret-mirror {
    position: absolute;
    visibility: hidden;
    white-space: pre-wrap;
    word-break: break-all;
}

.credit-line {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.credit-line span {
    display: inline;
}

#about-tab {
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    padding: 0.75rem;
}

#about-tab .grid {
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.logo-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 0.5rem;
    height: 100%;
}

.logo-section img {
    width: 96px;
    height: 96px;
    margin-bottom: 0.75rem;
}

.logo-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #000;
}

[data-theme="dark"] .logo-section h2 {
    color: #fff;
}

.logo-section p {
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-secondary);
    max-width: 240px;
}

.features-section {
    background: var(--card-bg);
    border-radius: 0.5rem;
    padding: 1rem;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.features-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-align: center;
}

.feature-card {
    background: var(--bg-color);
    border-radius: 0.75rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.feature-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, var(--color-primary), var(--color-primary-light));
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: -1;
}

.feature-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary);
}

.feature-card:hover::before {
    opacity: 0.1;
}

[data-theme="dark"] .feature-card {
    background: var(--bg-color);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .feature-card:hover {
    background: var(--bg-color);
    border-color: var(--color-primary);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.feature-card a,
.feature-card span {
    color: var(--text-color); 
    transition: color 0.2s ease;
}

.feature-card:hover a,
.feature-card:hover span {
    color: var(--color-primary); 
}

.feature-card tgs-player {
    position: relative;
    z-index: 1;
}

.feature-card h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #1f2937;
}

.feature-card p {
    font-size: 0.875rem;
    line-height: 1.3;
    color: #6b7280;
}

[data-theme="dark"] .feature-card {
    background: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] .feature-card:hover {
    background: #374151;
    border-color: #3b82f6;
}

[data-theme="dark"] .feature-card h4 {
    color: #f3f4f6;
}

[data-theme="dark"] .feature-card p {
    color: #9ca3af;
}

#about-tab .feature-card.group {
    padding: 0.5rem;
    border: 1px solid #374151;
    background: #ffffff;
    transition: all 0.2s ease;
}

#about-tab .feature-card.group:hover {
    border-color: #3b82f6;
    background: #f8fafc;
    transform: translateY(-1px);
}

#about-tab .feature-card.group a {
    text-decoration: none;
    color: #1f2937;
}

#about-tab .feature-card.group span {
    transition: color 0.2s ease;
    color: #6b7280;
}

#about-tab .feature-card.group:hover span {
    color: #3b82f6;
}

[data-theme="dark"] #about-tab .feature-card.group {
    background: #1f2937;
    border-color: #374151;
}

[data-theme="dark"] #about-tab .feature-card.group:hover {
    background: #374151;
    border-color: #3b82f6;
}

[data-theme="dark"] #about-tab .feature-card.group a {
    color: #f3f4f6;
}

[data-theme="dark"] #about-tab .feature-card.group span {
    color: #9ca3af;
}

[data-theme="dark"] #about-tab .feature-card.group:hover span {
    color: #60a5fa;
}

@media (prefers-color-scheme: dark) {
    .feature-card,
    #about-tab .feature-card.group {
        background: var(--bg-primary);
        border-color: #374151;
    }

    .feature-card:hover,
    #about-tab .feature-card.group:hover {
        background: var(--bg-primary);
        border-color: #3b82f6;
    }

    .feature-card h4,
    #about-tab .feature-card.group a {
        color: var(--text-primary);
    }

    .feature-card p,
    #about-tab .feature-card.group span {
        color: var(--text-secondary);
    }

    #about-tab .feature-card.group:hover span {
        color: #3b82f6;
    }
}

#about-tab .credit-line {
    margin-top: 0.5rem;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    .logo-section img {
        width: 80px;
        height: 80px;
    }
}

.features-section .grid {
    gap: 1rem;
}

.feature-card {
    background: #ffffff;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 0.75rem;
    border: 1px solid #374151;
    transition: all 0.2s ease;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 0 0.75rem;
    }

    .main-container {
        padding: 1rem;
        gap: 1rem;
    }

    .feature-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .content-wrapper {
        padding: 0 0.5rem;
    }

    .main-container {
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .feature-card {
        padding: 0.875rem;
    }
}

.max-w-4xl {
    max-width: 900px !important;
}

#close-settings {
    color: var(--text-color-secondary);
}

#close-settings:hover {
    background-color: var(--hover-bg);
    color: var(--text-color);
}

#text-size-value {
    color: var(--text-color-secondary);
}

.shortcut-item {
    border-color: var(--border-color);
}

.shortcut-label {
    color: var(--text-color);
}

.shortcut-key {
    background-color: var(--bg-color-secondary);
    color: var(--text-color);
}

.theme-option {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color-secondary);
    transition: all 0.2s ease;
    padding: 0.4rem; 
    border-radius: 0.5rem; 
    box-shadow: none; 
}

.theme-option span {
    color: var(--text-color-secondary);
    transition: color 0.2s ease;
    font-size: 0.7rem; 
}

.theme-option div { 
    background-color: var(--bg-color);
    border: 1px solid var(--text-color-secondary); 
    transition: border-color 0.2s ease, background-color 0.2s ease;
    width: 1.5rem; 
    height: 1.5rem; 
    margin-bottom: 0.25rem; 
}

.theme-option:hover {
    border-color: var(--color-primary); 
    background-color: var(--bg-color-secondary); 
    transform: none; 
    box-shadow: none; 
}

.theme-option:hover span {
    color: var(--color-primary); 
}

.theme-option.active {
    border: 1px solid var(--color-primary); 
    background-color: var(--color-primary-light); 
    transform: none; 
    box-shadow: none; 
}

.theme-option.active span {
    color: var(--color-primary); 
}

.theme-option.active div {
    border: 1px solid var(--color-primary); 
    background-color: var(--color-primary); 
}

[data-theme="dark"] .theme-option {
    background-color: var(--bg-color);
    border-color: var(--border-color);
}

[data-theme="dark"] .theme-option span {
    color: var(--text-color-secondary);
}

[data-theme="dark"] .theme-option div {
    background-color: var(--bg-color);
    border-color: var(--text-color-secondary);
}

[data-theme="dark"] .theme-option:hover {
    background-color: var(--bg-color-secondary); 
    border-color: var(--color-primary);
}

[data-theme="dark"] .theme-option:hover span {
    color: var(--color-primary);
}

[data-theme="dark"] .theme-option.active {
    background-color: rgba(96, 165, 250, 0.15); 
    border-color: var(--color-primary);
}

[data-theme="dark"] .theme-option.active span {
    color: var(--color-primary);
}

[data-theme="dark"] .theme-option.active div {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

[data-theme="dark"] .theme-option[data-theme="light"] {
    background-color: #ffffff; 
    border-color: #d1d5db; 
    color: #374151; 
}

[data-theme="dark"] .theme-option[data-theme="light"] span {
    color: #374151; 
}

[data-theme="dark"] .theme-option[data-theme="light"] div {
    background-color: #ffffff; 
    border-color: #d1d5db; 
}

[data-theme="dark"] .theme-option[data-theme="light"]:hover {
    background-color: #f3f4f6; 
    border-color: var(--color-primary); 
    color: var(--color-primary); 
}

[data-theme="dark"] .theme-option[data-theme="light"]:hover span {
    color: var(--color-primary);
}

[data-theme="dark"] .theme-option[data-theme="light"].active {
    background-color: var(--color-primary-light); 
    border-color: var(--color-primary);
    color: var(--color-primary);
}

[data-theme="dark"] .theme-option[data-theme="light"].active span {
    color: var(--color-primary);
}

.theme-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem; 
    margin-top: 0.5rem; 
}

.theme-option {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem; 
    cursor: pointer;
    transition: all 0.2s ease;
    overflow: hidden;
}

.theme-option[data-theme="light"] {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
}

.theme-option[data-theme="dark"] {
    background-color: #1f2937;
    border: 1px solid #374151;
}

.theme-option::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent; 
    opacity: 0; 
    transition: none; 
    z-index: 0;
}

.theme-indicator {
    width: 1.5rem; 
    height: 1.5rem; 
    border-radius: 50%;
    position: relative;
    transition: all 0.2s ease;
    z-index: 1;
}

.theme-indicator-light {
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    box-shadow: none; 
}

.theme-indicator-dark {
    background: #1f2937 !important;
    border: 1px solid #111827 !important;
    box-shadow: none; 
}

.theme-option[data-theme="light"] .theme-indicator {
    border-color: var(--text-color-secondary); 
}

.theme-option[data-theme="dark"] .theme-indicator {
    border-color: var(--text-color-secondary); 
}

.theme-option span {
    font-weight: 500;
    z-index: 1;
    transition: color 0.2s ease;
    font-size: 0.7rem; 
}

.theme-option[data-theme="light"] span {
    color: var(--text-color); 
}

.theme-option[data-theme="dark"] span {
    color: var(--text-color); 
}

.theme-option:hover {
    transform: none; 
    box-shadow: none; 
    border-color: var(--color-primary); 
}

.theme-option:hover::before {
    opacity: 0; 
}

.theme-option.active {
    border-color: var(--color-primary); 
    box-shadow: none; 
    background-color: var(--color-primary-light); 
}

.theme-option.active .theme-indicator {
    border-color: var(--color-primary) !important;
    background-color: var(--color-primary) !important; 
}

.theme-option:hover .theme-indicator-light,
.theme-option:hover .theme-indicator-dark {
    border-color: var(--color-primary) !important; 
}

.theme-option.active .theme-indicator-light,
.theme-option.active .theme-indicator-dark {
    border-color: var(--color-primary) !important;
    background-color: var(--color-primary) !important; 
}

[data-theme="dark"] .theme-option:hover {
    box-shadow: none; 
    background-color: var(--bg-color-secondary); 
}

[data-theme="dark"] .theme-option.active {
    box-shadow: none; 
    background-color: rgba(96, 165, 250, 0.15); 
}

.theme-option:hover span {
    color: var(--color-primary); 
}

.theme-option.active span {
    color: var(--color-primary); 
}

[data-theme="dark"] .theme-option[data-theme="light"]:hover span,
[data-theme="dark"] .theme-option[data-theme="light"].active span {
    color: var(--color-primary); 
}

[data-theme="dark"] .theme-option[data-theme="dark"]:hover span,
[data-theme="dark"] .theme-option[data-theme="dark"].active span {
    color: white; 
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); 
  gap: 0.75rem; 
  padding: 0.15rem;
}

.shortcuts-section {
  background: var(--bg-secondary);
  border-radius: 0.75rem;
  padding: 0.5rem; 
  transition: all 0.2s ease;
}

.shortcuts-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.shortcuts-header {
  display: flex;
  align-items: center;
  gap: 0.4rem; 
  margin-bottom: 0.6rem; 
  padding-bottom: 0.4rem; 
  border-bottom: 1px solid var(--border-color);
}

.shortcuts-header h3 {
  font-size: 0.95rem; 
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.shortcuts-header i {
  color: var(--text-secondary);
  width: 1.15rem; 
  height: 1.15rem; 
}

.shortcuts-note {
  font-size: 0.7rem; 
  color: var(--text-secondary);
  margin-left: auto;
}

.shortcuts-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem; 
}

.shortcut-item {
  display: flex;
  align-items: center;
  padding: 0.3rem; 
  border-radius: 0.3rem;
  transition: background-color 0.2s ease;
}

.shortcut-item:hover {
  background-color: var(--hover-color);
}

.shortcut-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.shortcut-label {
  font-size: 0.8rem; 
  color: var(--text-primary);
}

.shortcut-key {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.3rem; 
  font-size: 0.65rem; 
  font-weight: 500;
  color: var(--text-secondary);
  background-color: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .shortcuts-section {
  background: var(--bg-secondary);
}

[data-theme="dark"] .shortcut-item:hover {
  background-color: var(--hover-color);
}

[data-theme="dark"] .shortcut-key {
  background-color: var(--bg-primary);
  border-color: var(--border-color);
}

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

  .shortcuts-section {
    padding: 0.75rem;
  }

  .shortcut-item {
    padding: 0.375rem;
  }
}

#settings-modal *::-webkit-scrollbar {
    display: none;
}

#settings-modal * {
    scrollbar-width: none; 
}

[data-theme="dark"] #settings-modal {
    background-color: var(--bg-color);
    box-shadow: -6px 0 20px rgba(0, 0, 0, 0.3); 
    border-color: var(--border-color);
}

.shortcuts-section {
    padding: 0.5rem; 
    margin-bottom: 0.5rem; 
}

.shortcuts-header {
    padding: 0.25rem 0; 
    margin-bottom: 0.25rem; 
}

.shortcuts-header h3 {
    font-size: 0.875rem; 
}

.shortcuts-list {
    gap: 0.25rem; 
}

.setting-item {
    padding: 0.5rem; 
    margin-bottom: 0.25rem; 
}

.theme-options-grid {
    gap: 0.25rem; 
}

.theme-option {
    padding: 0.5rem !important; 
    font-size: 0.75rem; 
}

.font-select-container {
    gap: 0.25rem !important; 
}

.font-select {
    padding: 0.25rem 0.5rem !important; 
    font-size: 0.75rem; 
}

.font-preview {
    padding: 0.25rem !important; 
    font-size: 0.75rem; 
}

#custom-font-btn {
    padding: 0.25rem 0.5rem !important; 
    font-size: 0.75rem; 
}

.text-size-controls {
    gap: 0.25rem !important; 
}

.text-size-btn {
    padding: 0.25rem !important; 
}

#text-size-value {
    font-size: 0.75rem; 
}

.shortcuts-grid {
    gap: 0.5rem; 
}

.beta-badge {
  background-color: var(--color-primary); 
  color: white; 
  padding: 0.15rem 0.4rem; 
  border-radius: 0.3rem; 
  font-size: 0.65rem; 
  font-weight: 600;
  margin-left: 0.5rem; 
  vertical-align: middle; 
  text-transform: uppercase;
  letter-spacing: 0.025em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); 
}

[data-theme="dark"] .beta-badge {
  background-color: var(--color-primary); 
  color: white;
}

.setting-item {
    margin-bottom: 0.5rem; 
    padding: 0.75rem; 
}

.toggle-container {
    padding: 0.75rem; 
}

.setting-label {
    font-size: 0.95rem; 
}

.setting-description {
    font-size: 0.8rem; 
}

.main-guide-tabs {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
    background: var(--bg-color-secondary);
    border-radius: 0.75rem;
    padding: 0.5rem 0.5rem;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.04);
    position: relative;
    margin-bottom: 1.25rem;
    overflow-x: auto;
}

.main-tab {
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-color-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    transition: color 0.2s, background 0.2s, box-shadow 0.2s;
    z-index: 1;
}

.main-tab i {
    color: var(--text-color-secondary);
    transition: color 0.2s;
}

.main-tab:hover,
.main-tab:focus {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.main-tab:hover i,
.main-tab:focus i {
    color: var(--color-primary);
}

.main-tab.active {
    color: var(--color-primary);
    background: var(--bg-color);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
    position: relative;
}

.main-tab.active i {
    color: var(--color-primary);
}

.main-guide-tabs::after {

    content: '';
    position: absolute;
    bottom: 0.25rem;
    left: 0;
    height: 3px;
    width: 0;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    border-radius: 2px;
    transition: left 0.3s cubic-bezier(.4,0,.2,1), width 0.3s cubic-bezier(.4,0,.2,1);
    z-index: 0;
    pointer-events: none;
}

.main-tab.active::after {

    content: '';
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    bottom: 0.2rem;
    height: 3px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    border-radius: 2px;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    z-index: 2;
}

@media (max-width: 640px) {
    .main-guide-tabs {
        padding: 0.25rem 0.25rem;
        gap: 0.25rem;
        border-radius: 0.5rem;
    }
    .main-tab {
        padding: 0.5rem 0.75rem;
        font-size: 0.95rem;
    }
    .main-tab.active::after {
        left: 0.75rem;
        right: 0.75rem;
        height: 2px;
    }
}

[data-theme="dark"] .main-guide-tabs {
    background: var(--bg-color);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

[data-theme="dark"] .main-tab {
    color: var(--text-color-secondary);
    background: transparent;
}

[data-theme="dark"] .main-tab.active {
    background: var(--bg-color-secondary);
    color: var(--color-primary);
}

[data-theme="dark"] .main-tab i {
    color: var(--text-color-secondary);
}

[data-theme="dark"] .main-tab.active i {
    color: var(--color-primary);
}

#copy-btn {
    background-color: #3b82f6;
    color: white;
    border: none;
    transition: all 0.2s ease;
}

#copy-btn:hover {
    background-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.1), 0 2px 4px -1px rgba(37, 99, 235, 0.06);
}

#copy-btn:active {
    transform: translateY(0);
    background-color: #1d4ed8;
}

[data-theme="dark"] #copy-btn {
    background-color: #3b82f6;
    color: white;
}

[data-theme="dark"] #copy-btn:hover {
    background-color: #2563eb;
}

[data-theme="dark"] #copy-btn:active {
    background-color: #1d4ed8;
}

.character-map-tabs {
    background: var(--bg-color-secondary);
    padding: 0.5rem;
    border-radius: 0.75rem;
    position: relative;
}

.char-tab {
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-color-secondary);
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    cursor: pointer;
}

.char-tab:hover:not(.active) {
    background: rgba(59, 130, 246, 0.1);
    color: var(--color-primary);
}

.char-tab.active {
    background: var(--bg-color);
    color: var(--color-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.char-tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0.75rem;
    right: 0.75rem;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--color-primary-light));
    border-radius: 2px;
}

[data-theme="dark"] .character-map-tabs {
    background: var(--bg-color);
}

[data-theme="dark"] .char-tab.active {
    background: var(--bg-color-secondary);
}

@media (max-width: 640px) {
    .char-tab {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .character-map-tabs {
        padding: 0.375rem;
    }
}

.keymap-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-color);
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color);
}

.keymap-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-color: var(--color-primary-light);
}

.keymap-key {
    font-family: monospace;
    background: var(--bg-color-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    color: var(--color-primary);
    border: 1px solid var(--border-color);
}

.keymap-value {
    color: var(--text-color-secondary);
    font-weight: 500;
}

[data-theme="dark"] .keymap-item {
    background: var(--bg-color-secondary);
    border-color: var(--border-color-dark);
}

[data-theme="dark"] .keymap-key {
    background: var(--bg-color);
    border-color: var(--border-color-dark);
}

[data-theme="dark"] .keymap-item:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
}

@media (max-width: 640px) {
    .keymap-item {
        padding: 0.5rem 0.75rem;
    }

    .keymap-key {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
    }
}

@media (max-width: 640px) {
    .main-tab span {
        display: none;
    }

    .main-tab {
        padding: 0.75rem;
    }

    .main-tab i {
        width: 1.25rem;
        height: 1.25rem;
        margin: 0;
    }

    .flex.items-center.gap-2 {
        gap: 0;
    }
}

/* Hide mode descriptions on mobile */
@media screen and (max-width: 768px) {
    .mode-description {
        display: none;
    }

    .mode-option {
        padding: 8px;
        font-size: 0.9rem;
        /* If you're using grid or flex for layout */
        flex-direction: column;
        align-items: center;
    }

    .mode-title {
        text-align: center;
        margin-bottom: 0;
    }
}

