/* Modern CSS Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00ff88;
    --primary-dark: #00cc66;
    --secondary: #764ba2;
    --accent: #f093fb;
    --background: #0f0f23;
    --surface: #1a1a2e;
    --surface-hover: #16213e;
    --text: #ffffff;
    --text-secondary: #a8a8b3;
    --border: #2d2d48;
    --success: #00d4aa;
    --warning: #ffb347;
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.12);
    --shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.4) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    z-index: -1;
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

/* Header Styles */
.header {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.logo-container {
    margin-bottom: 1.5rem;
}

#logo {
    width: 100px;
    height: 100px;
    padding: 1.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 2rem;
    transition: all 0.3s ease;
    display: block;
    margin: 0 auto;
}

#logo:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: var(--shadow);
}

.main-title {
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 400;
}


/* Layout Grid */
.container-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
    max-width: 100%;
    position: relative;
    left: 0;
}

.container, .container2 {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin: 0;
}

.container::before, .container2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 1.5rem 1.5rem 0 0;
}

.container:hover, .container2:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Section Titles */
.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1.5rem;
    text-align: center;
}

.settings-group-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 1rem;
    text-align: center;
}

/* File Upload */
.custom-file-upload {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 1rem;
    cursor: pointer;
    margin-bottom: 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.custom-file-upload::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;
}

.custom-file-upload:hover::before {
    left: 100%;
}

.custom-file-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.upload-icon {
    font-size: 1.2rem;
    transform: translateY(-3px);
}

/* Buttons */
button, .convert-btn {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--success) 0%, #00b4d8 100%);
    color: white;
    border: none;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 30px;
}

button:hover, .convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 212, 170, 0.4);
}

.modern-secondary-btn {
    background: linear-gradient(135deg, var(--warning) 0%, #ff6b6b 100%);
    margin-top: 1.5rem;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 600;
}

.modern-secondary-btn:hover {
    box-shadow: 0 10px 25px rgba(255, 179, 71, 0.4);
}

.btn-icon {
    font-size: 1.1rem;
    transform: translateY(-3px);
}

/* Radio Buttons */
.format-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modern-radio {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 10px;
}

.modern-radio:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
}

.modern-radio:has(.radio:checked) {
    background: rgba(0, 255, 136, 0.15);
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.3);
}

.radio-fakeradio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--text-secondary);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.radio:checked + .radio-fakeradio {
    border-color: var(--primary);
}

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

.option-content {
    display: flex;
    align-items: center;
    flex: 1;
}

.format-icon {
    width: 35px;
    height: 35px;
    border-radius: 0.25rem;
}

.option-label {
    margin-left: 10px;
    color: white;
    font-weight: 500;
}

/* Custom Inputs */
.custom-inputs {
    margin-top: 1rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.input-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.input-row:last-child {
    margin-bottom: 0;
}

.input-label {
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 50px;
}

.modern-input, .jc {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
    color: white;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    resize: none;
    width: 80px;
    text-align: center;
}

.modern-input:focus, .jc:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.3);
    background: rgba(255, 255, 255, 0.15);
}

/* Result Section */
.infobtn, .full-width {
    width: 100%;
    max-width: 100%;
    margin: 0;
    grid-column: 1 / -1;
}

.file-list, .result {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.file-list::before, .result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--success), #00b4d8);
    border-radius: 1.5rem 1.5rem 0 0;
}

.file-list {
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.textarea1 {
    width: 100%;
    height: 300px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    padding: 1.5rem;
    color: white;
    font-size: 0.9rem;
    resize: vertical;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.textarea1:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.textarea1::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Action Buttons */
.button-container {
    display: flex;
    gap: 1rem;
}

.download-btn {
    flex: 1;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    opacity: 0.5;
    pointer-events: none;
    text-transform: none;
    letter-spacing: normal;
}

.download-btn:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.download-btn:not(.hidden):hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

/* Utility Classes */
.hidden, .hidden-input, .radio {
    display: none;
}

.musor2.hidden {
    display: none;
}

.musor1, .musor2 {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .wrapper {
        padding: 1rem;
    }

    .container-columns {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        left: 0;
    }

    .main-title {
        font-size: 2.2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .container, .container2 {
        padding: 1.5rem;
        margin: 0;
    }

    .button-container {
        flex-direction: column;
    }

    .input-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .input-label {
        min-width: auto;
        text-align: left;
    }

    .modern-input, .jc {
        width: 100%;
        text-align: left;
    }

    br.mobile-only {
        display: block;
    }


    .header {
        padding-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .main-title {
        font-size: 1.8rem;
    }

    .container, .container2 {
        padding: 1rem;
    }

    #logo {
        width: 80px;
        height: 80px;
        padding: 1rem;
    }
}

/* Special handling for Karing mode */
.container-columns.karing-active {
    left: 0;
}

.container2.karing-active {
    margin-right: 0;
}

/* Enhanced glassmorphism effects */
.container:hover::after, .container2:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
    opacity: 0;
    animation: ripple 0.6s ease-out;
}

@keyframes ripple {
    0% {
        opacity: 1;
        transform: scale(0);
    }
    100% {
        opacity: 0;
        transform: scale(1);
    }
}

/* Scrollbar Styling */
.textarea1::-webkit-scrollbar {
    width: 8px;
}

.textarea1::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.textarea1::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.textarea1::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Custom Dropdown */
.custom-dropdown {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 130px;
    z-index: 1000;
}

.dropdown-selected {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    color: var(--text);
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.dropdown-selected:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.15);
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    font-size: 0.8rem;
    opacity: 0.7;
}

.custom-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.custom-dropdown.open .dropdown-selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.2), 0 8px 25px rgba(0, 255, 136, 0.1);
}

.dropdown-options {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.custom-dropdown.open .dropdown-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-option {
    padding: 0.75rem 1rem;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-option:last-child {
    border-bottom: none;
}

.dropdown-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--primary);
    padding-left: 1.25rem;
}

.dropdown-option.active {
    background: rgba(0, 255, 136, 0.15);
    color: var(--primary);
    font-weight: 600;
}

.dropdown-option.active::before {
    content: '✓';
    position: absolute;
    left: 0.75rem;
    color: var(--primary);
    font-weight: bold;
}

.dropdown-option.active {
    padding-left: 2rem;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .custom-dropdown {
        position: static;
        margin: 1rem auto 0;
        width: fit-content;
    }
}

@media (max-width: 480px) {
    .custom-dropdown {
        min-width: 110px;
    }
    
    .dropdown-selected {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
    
    .dropdown-option {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }
    
    .dropdown-option.active {
        padding-left: 1.8rem;
    }
}

.selected-text{
    transform: translateY(2px);
}

body.lang-zh {
  font-family: "Noto Sans TC", sans-serif;
}

body.lang-en, body.lang-tr {
  font-family: "Josefin Sans", sans-serif;
}

body.lang-fa {
  font-family: "Lalezar", sans-serif;
}

.donation-container {
    text-align: center;
    margin-top: 2rem;
}

.donation-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
    border: none;
    border-radius: 1rem;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.donation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 212, 170, 0.4);
}