:root {
    --bg-color: #0d0f14;
    --card-bg: rgba(26, 29, 36, 0.6);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #94a3b8;

    --primary-color: #8b5cf6;
    /* Vibrant purple */
    --primary-hover: #7c3aed;
    --gradient-1: linear-gradient(135deg, #8b5cf6 0%, #d946ef 100%);

    --success-color: #10b981;
    --radius-lg: 24px;
    --radius-md: 16px;
    --radius-sm: 8px;

    --font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Dynamic Animated Background Blobs */
.blob-bg {
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(139, 92, 246, 0) 70%);
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    top: -100px;
    left: -100px;
    animation: blobAnim 10s infinite alternate linear;
}

.blob-bg-2 {
    background: radial-gradient(circle, rgba(217, 70, 239, 0.1) 0%, rgba(217, 70, 239, 0) 70%);
    top: auto;
    bottom: -200px;
    left: auto;
    right: -100px;
    animation: blobAnim2 12s infinite alternate linear;
}

@keyframes blobAnim {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 50px) scale(1.1);
    }
}

@keyframes blobAnim2 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-50px, -100px) scale(1.2);
    }
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 600px;
    padding: 2rem;
    position: relative;
}

/* Header & Lang Switcher */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: var(--gradient-1);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.logo-icon {
    -webkit-text-fill-color: initial;
}

.lang-switch {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    padding: 4px;
    border: 1px solid var(--border-color);
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.lang-btn.active {
    background: var(--card-bg);
    color: var(--text-primary);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Tool Navigation */
.tool-nav {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 6px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(10px);
}

.nav-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 12px;
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.nav-btn.active {
    background: var(--card-bg);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

/* Main Footer Styling */
.main-footer {
    margin-top: 6rem;
    padding: 3rem 2rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    text-align: left;
    margin-bottom: 3rem;
}

.footer-brand .logo {
    margin-bottom: 1rem;
}

.footer-tagline {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 250px;
}

.footer-links h3,
.footer-social h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
}

.social-icons {
    display: flex;
    gap: 1rem;
}

.social-icons a {
    color: var(--text-secondary);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icons a:hover {
    color: var(--primary-color);
    transform: translateY(-3px);
}

.footer-bottom {
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-bottom p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
}

/* App Container adjustment for full width footer */
.app-container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Main Content Area */
.tool-section {
    display: none;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    backdrop-filter: blur(16px);
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.4s ease-out forwards;
}

.tool-section.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Inputs and Outputs */
.output-container {
    position: relative;
    display: flex;
    margin-bottom: 2rem;
}

.output-container.inline {
    margin-bottom: 0;
}

input[type="text"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    padding: 1rem 3.5rem 1rem 1.5rem;
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 500;
    font-family: 'Courier New', Courier, monospace;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.2);
}

.text-input {
    font-family: var(--font-family) !important;
    font-size: 1rem !important;
    padding: 0.75rem 1rem !important;
}

.copy-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-50%) scale(1.05);
}

.copy-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.copy-btn.success {
    background: var(--success-color);
}

/* Controls */
.controls-panel {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    font-weight: 600;
    font-size: 0.95rem;
}

/* Custom Range Slider */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--primary-color);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
    transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

/* Custom Checkboxes */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.checkbox-grid.single-col {
    grid-template-columns: 1fr;
}

.custom-checkbox {
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 30px;
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.custom-checkbox:hover {
    color: var(--text-primary);
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    height: 20px;
    width: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.custom-checkbox input:checked~.checkmark {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked~.checkmark:after {
    display: block;
}

/* Primary Button */
.primary-btn {
    width: 100%;
    padding: 1rem;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-family);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.glow-effect::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.primary-btn:hover {
    transform: translateY(-2px);
}

.primary-btn:hover::before {
    left: 100%;
}

.primary-btn:active {
    transform: translateY(1px);
}

/* Color Picker specific styles */
.color-display-area {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
}

.color-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background-color: #8b5cf6;
    border: 4px solid var(--border-color);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.4);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

input[type="color"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 10;
}

.color-outputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.color-box {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.color-label {
    width: 40px;
    font-weight: 600;
    color: var(--text-secondary);
}

/* Toast Message */
.toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--card-bg);
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    border: 1px solid var(--success-color);
    font-weight: 600;
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 1000;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 480px) {
    .app-container {
        padding: 1rem;
    }

    .tool-section {
        padding: 1.5rem;
    }

    .checkbox-grid {
        grid-template-columns: 1fr;
    }

    .nav-btn {
        font-size: 0.8rem;
        padding: 10px 4px;
    }
}
