:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --error-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg,
            var(--primary-color) 0%,
            var(--secondary-color) 100%);
    min-height: 100vh;
    padding: 20px;
    padding-top: 60px;
}

/* BACK BUTTON */

.back-button {
    position: fixed;
    top: 10px;
    left: 20px;
    background: rgba(255, 255, 255, .95);
    color: #333;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .1);
    transition: .2s;
}

.back-button:hover {
    transform: translateX(-3px);
}

/* BREADCRUMB */

.breadcrumb-nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px 10px;
}

.breadcrumb {
    list-style: none;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb li {
    color: rgba(255, 255, 255, .9);
}

.breadcrumb li:not(:last-child)::after {
    content: '›';
    margin-left: 8px;
    color: rgba(255, 255, 255, .6);
}

.breadcrumb a {
    color: white;
    text-decoration: none;
}

/* TOOL SWITCHER */

.tool-switcher {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 14px;
    padding: 10px 16px;
    margin: 0 auto 16px;
    max-width: 1100px;
}

.tool-switcher-label {
    color: rgba(255, 255, 255, .75);
    font-size: .82rem;
    font-weight: 700;
    text-transform: uppercase;
}

.tool-switch-btn {
    color: rgba(255, 255, 255, .9);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 20px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    font-size: .85rem;
    transition: .2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-switch-btn:hover {
    background: rgba(255, 255, 255, .22);
}

.tool-switch-btn.active {
    background: white;
    color: var(--primary-color);
    font-weight: 700;
    pointer-events: none;
}

/* CONTAINER */

.container {
    max-width: 1100px;
    margin: 0 auto 40px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .2);
}

/* HEADER */

.header {
    background: #2c3e50;
    color: white;
    padding: 28px;
    text-align: center;
}

.header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.header p {
    opacity: .92;
}

.privacy-pill {
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .14);
    padding: 10px 16px;
    border-radius: 30px;
    font-size: .9rem;
}

/* TOOL AREA */

.tool-area {
    padding: 30px;
    display: grid;
    grid-template-columns: 1fr 370px;
    gap: 30px;
}

.main-content {
    display: flex;
    flex-direction: column;
}

/* UPLOAD */

.upload-box {
    border: 3px dashed var(--primary-color);
    border-radius: 12px;
    padding: 55px 20px;
    text-align: center;
    background: #f8f9fa;
    transition: .25s;
    cursor: pointer;
}

.upload-box:hover {
    background: #eef2ff;
}

.upload-box.dragover {
    background: #d4edda;
    border-color: var(--success-color);
}

.upload-icon {
    color: var(--primary-color);
    margin-bottom: 18px;
}

.browse-button {
    background: var(--primary-color);
    color: white;
    padding: 12px 26px;
    border: none;
    border-radius: 24px;
    margin-top: 14px;
    cursor: pointer;
    font-weight: 700;
    transition: .2s;
}

.browse-button:hover {
    transform: translateY(-2px);
}

#fileInput {
    display: none;
}

/* PREVIEW */

.preview-container {
    margin-top: 24px;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
    min-height: 500px;
    padding: 20px;
}

.preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

.preview-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #eee;
    transition: .2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, .05);
}

.preview-card:hover {
    transform: translateY(-3px);
}

.preview-image {
    width: 100%;
    display: block;
}

.preview-footer {
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* SIDEBAR */

.controls-sidebar {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 10px;
    height: fit-content;
    position: sticky;
    top: 30px;
}

.control-group {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.control-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 700;
}

.select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #ddd;
    background: white;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider {
    width: 100%;
}

.slider-value {
    min-width: 55px;
    text-align: center;
    font-weight: 700;
    color: var(--primary-color);
}

/* BUTTONS */

.action-button {
    color: white;
    padding: 14px 22px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: .95rem;
    font-weight: 700;
    width: 100%;
    transition: .2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.action-button:hover:not(:disabled) {
    transform: translateY(-2px);
}

.action-button:disabled {
    background: #999 !important;
    cursor: not-allowed;
}

.convert-button {
    background: var(--success-color);
}

.download-button {
    background: var(--primary-color);
    margin-top: 12px;
}

.single-download {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
}

/* PROGRESS */

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 5px;
    margin: 18px 0;
    overflow: hidden;
    display: none;
}

.progress-fill {
    width: 0%;
    height: 100%;
    background: var(--success-color);
    transition: width .3s ease;
}

/* MESSAGE */

.message {
    padding: 12px;
    border-radius: 8px;
    margin-top: 16px;
    display: none;
    font-size: .92rem;
}

.message.show {
    display: block;
}

.info-message {
    background: #d1ecf1;
    color: #0c5460;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
}

/* FEATURES */

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    padding: 30px;
    background: #f8f9fa;
}

.feature {
    text-align: center;
    padding: 20px;
}

.feature-icon {
    color: var(--primary-color);
    margin-bottom: 12px;
}

/* SEO */

.seo-content,
.faq-section,
.related-tools {
    padding: 30px;
    border-top: 1px solid #eee;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.faq-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 18px;
}

.faq-item summary {
    cursor: pointer;
    font-weight: 700;
}

.faq-item p {
    margin-top: 10px;
    color: #555;
}

/* RELATED */

.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 18px;
}

.related-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: #e9ecef;
    border-radius: 25px;
    text-decoration: none;
    color: #333;
    transition: .2s;
}

.related-link:hover {
    background: var(--primary-color);
    color: white;
}

/* FOOTER */

footer {
    background: rgba(0, 0, 0, .25);
    color: rgba(255, 255, 255, .9);
    padding: 20px;
    text-align: center;
    border-radius: 0 0 15px 15px;
}

footer a {
    color: white;
    text-decoration: none;
}

/* MOBILE */

@media(max-width:1024px) {
    .tool-area {
        grid-template-columns: 1fr;
    }

    .controls-sidebar {
        position: static;
    }
}

@media(max-width:768px) {

    body {
        padding-top: 55px;
    }

    .tool-area {
        padding: 20px;
    }

    .header h1 {
        font-size: 1.6rem;
    }

    .faq-grid {
        grid-template-columns: 1fr;
    }

    .related-links {
        flex-direction: column;
    }

    .tool-switcher {
        padding: 10px;
    }
}