:root {
    --primary-color: #0ea6ec;
    /* Vibrant blue for primary actions */
    --primary-dark: #0b85c0;
    /* Darker blue for hover states */
    --secondary-color: #1a3e72;
    /* Navy blue for secondary elements */
    --bg-color: #090f1b;
    /* Dark background */
    --card-bg: #0f172a;
    /* Slightly lighter card background */
    --text-color: #f1f1f1;
    /* Main text color */
    --text-muted: #94a3b8;
    /* Muted text for less important info */
    --highlight-color: #32a852;
    /* Success green */
    --highlight-dark: #2b9748;
    /* Darker success green */
    --danger-color: #e74c3c;
    /* Error/delete red */
    --warning-color: #f39c12;
    /* Warning orange */
    --border-color: #1e293b;
    /* Border color */
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    --border-radius: 12px;
    --transition: all 0.25s ease;
}

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

body {
    font-family: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Container & Layout */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem;
    overflow-x: hidden;
    /* Prevent horizontal overflow */
}

/* Typography */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.25rem;
    background: linear-gradient(90deg, var(--primary-color), var(--highlight-color));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-align: center;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    text-align: center;
    max-width: 700px;
    margin: 0 auto 2rem;
}

/* Tabs Navigation */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(26, 62, 114, 0.3);
    border-radius: var(--border-radius);
    padding: 0.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
    display: none;
}

.tab {
    flex: 1;
    min-width: fit-content;
    padding: 0.75rem 1rem;
    text-align: center;
    cursor: pointer;
    border-radius: calc(var(--border-radius) - 4px);
    transition: var(--transition);
    font-weight: 600;
    color: var(--text-muted);
    border: none;
    background: transparent;
    white-space: nowrap;
    font-size: 0.95rem;
}

.tab.active {
    background: var(--secondary-color);
    color: white;
    box-shadow: var(--box-shadow);
}

.tab i {
    margin-right: 0.5rem;
}

/* Card Components */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.card-title {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-title i {
    font-size: 1.5rem;
}

/* Upload Areas */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 2.5rem 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(14, 166, 236, 0.05);
}

.upload-area.active {
    border-color: var(--highlight-color);
    background: rgba(50, 168, 82, 0.05);
}

.upload-area i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.25rem;
    transition: var(--transition);
}

.upload-area.active i {
    color: var(--highlight-color);
}

.upload-area p {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.upload-area .small {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.file-input {
    display: none;
}

/* Controls & Form Elements */
.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.control-group {
    margin-bottom: 0.5rem;
}

label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-color);
}

input[type="range"] {
    width: 100%;
    height: 8px;
    -webkit-appearance: none;
    background: rgba(14, 166, 236, 0.2);
    border-radius: 10px;
    outline: none;
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

input[type="range"]:hover {
    background: rgba(14, 166, 236, 0.3);
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary-color);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid var(--bg-color);
}

input[type="range"]::-webkit-slider-thumb:hover {
    background: var(--highlight-color);
    transform: scale(1.1);
}

.value-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.value-display span:first-child {
    color: var(--text-muted);
}

.value-display span:last-child {
    font-weight: 600;
    color: var(--primary-color);
}

/* Format Options */
.format-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.format-option {
    padding: 0.65rem 1.25rem;
    background: rgba(26, 62, 114, 0.3);
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    border: 1px solid transparent;
    user-select: none;
}

.format-option:hover {
    background: rgba(26, 62, 114, 0.5);
    transform: translateY(-2px);
}

.format-option.active {
    background: var(--secondary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Buttons */
.btn {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: var(--transition);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: var(--box-shadow);
    min-height: 50px;
}

.btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(14, 166, 236, 0.3);
}

.btn:disabled {
    background: rgba(14, 166, 236, 0.3);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: var(--text-muted);
}

.btn-success {
    background: var(--highlight-color);
}

.btn-success:hover {
    background: var(--highlight-dark);
    box-shadow: 0 6px 15px rgba(50, 168, 82, 0.3);
}

.btn-danger {
    background: var(--danger-color);
}

.btn-danger:hover {
    background: #c44133;
    box-shadow: 0 6px 15px rgba(231, 76, 60, 0.3);
}

/* Preview Areas */
.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.preview-box {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 240px;
    margin: 0.8rem auto 0;
    justify-content: center;
}

.preview-box h3 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.preview-box h3 i {
    color: var(--primary-color);
    font-size: 1.1rem;
}

.preview-media {
    max-width: 100%;
    max-height: 300px;
    display: block;
    margin: 0 auto;
    border-radius: calc(var(--border-radius) - 5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    object-fit: contain;
}

.file-info {
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.file-info strong {
    color: var(--text-color);
    font-weight: 500;
}

/* Progress Indicators */
.progress-container {
    width: 100%;
    background: rgba(26, 62, 114, 0.3);
    border-radius: 10px;
    margin: 1.25rem 0;
    overflow: hidden;
    display: none;
}

.progress-bar {
    height: 10px;
    border-radius: 10px;
    background: linear-gradient(90deg, var(--primary-color), var(--highlight-color));
    width: 0%;
    transition: width 0.4s ease;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.3),
            transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* Status Messages */
.status {
    text-align: center;
    margin: 1.25rem 0;
    font-weight: 500;
    min-height: 24px;
    transition: var(--transition);
}

.status.success {
    color: var(--highlight-color);
}

.status.error {
    color: var(--danger-color);
}

.status.warning {
    color: var(--warning-color);
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 200px;
    background-color: var(--secondary-color);
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 0.5rem;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.8rem;
    font-weight: normal;
    pointer-events: none;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Feature Cards */
.convertout-features {
    margin-top: 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.feature-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow);
    border-color: var(--primary-color);
}

.feature-icon {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.feature-title {
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
    color: var(--text-color);
}

.feature-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
    }

    100% {
        transform: scale(1);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

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

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

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-content.active {
    display: block;
}

/* Custom Compression Styles */
.size-input {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.size-input input {
    flex: 1;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
}

.size-input select {
    padding: 0.75rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
}

.size-input span {
    white-space: nowrap;
}

/* FAQ Section */
.faq-section {
    max-width: 100%;
    margin: 2rem 0;
    padding: 0 12px;
}

.faq-title {
    text-align: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
    position: relative;
    padding: 0 15px;
}

.faq-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--highlight-color));
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.faq-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.faq-item {
    background: var(--card-bg);
    border-radius: 10px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
}

.faq-question {
    padding: 1rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.95rem;
    -webkit-tap-highlight-color: transparent;
}

.faq-question:hover {
    background: rgba(14, 166, 236, 0.05);
}

.faq-question::after {
    content: '+';
    font-size: 1.3rem;
    color: var(--primary-color);
    transition: transform 0.2s ease;
    flex-shrink: 0;
    margin-left: 10px;
}

.faq-item.active .faq-question::after {
    content: '-';
    color: var(--highlight-color);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 1rem;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    padding: 0 1rem 1rem;
}

.faq-answer-content {
    color: var(--text-muted);
    line-height: 1.5;
    font-size: 0.9rem;
    padding-top: 0.5rem;
}

.faq-answer-content ul,
.faq-answer-content ol {
    padding-left: 1.2rem;
    margin: 0.5rem 0;
}

.faq-answer-content li {
    margin-bottom: 0.3rem;
}

/* Footer */
.footer-attribution {
    text-align: center;
    margin: 2rem 0 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
}

.footer-attribution a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    display: inline-block;
}

.footer-attribution a:hover {
    color: var(--highlight-color);
    transform: translateY(-2px);
}

.footer-attribution::before {
    content: "";
    display: block;
    width: 50px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), var(--highlight-color));
    margin: 0 auto 1rem;
    opacity: 0.5;
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .container {
        padding: 1.25rem;
    }

    .card {
        padding: 1.5rem;
    }

    .preview-container {
        grid-template-columns: 1fr;
    }
}

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

    h1 {
        font-size: 1.8rem;
    }

    .subtitle {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 0.5rem;

        justify-content: center;
    }
 .faq-title {
     font-size: 20px;
 }
    .tab {
        flex: 0 0 auto;
        padding: 0.75rem 1rem;
        font-size: 0.85rem;
    }

    .card {
        padding: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .upload-area {
        padding: 1.75rem 1rem;
    }

    .upload-area i {
        font-size: 2.5rem;
    }

    .controls {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .format-options {
        gap: 0.5rem;
    }

    .format-option {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .btn {
        padding: 0.9rem;
        font-size: 0.95rem;
    }

    .preview-media {
        max-height: 220px;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .tooltip .tooltiptext {
        width: 180px;
        font-size: 0.75rem;
    }
}

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

    h1 {
        font-size: 1.8rem;
        padding: 5px;
    }

    .card {
        padding: 1rem;
        border-radius: 10px;
    }

    .upload-area {
        padding: 1.5rem 0.75rem;
    }

    .upload-area i {
        font-size: 2.2rem;
    }

    .upload-area p {
        font-size: 1rem;
    }

    .upload-area .small {
        font-size: 0.8rem;
    }

    .card-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }

    .tab {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }

    .btn {
        min-height: 44px;
        font-size: 0.9rem;
    }

    .preview-media {
        max-height: 180px;
    }

    /* Better download button for mobile */
    .btn-success {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    /* Fix overflow issues */
    .preview-box {
        max-width: 100%;
        padding: 1rem;
    }

    .size-input {
        flex-wrap: wrap;
    }

    .size-input input {
        width: 100%;
    }
}

/* iOS Input Zoom Fix */
@media screen and (max-width: 767px) {

    input,
    select,
    textarea {
        font-size: 16px;
    }
}

/* Accessibility Improvements */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Prevent long words from breaking layout */
body {
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}