:root {
    --primary-color: #0066cc;
    --primary-color-hover: #005bb5;
    --secondary-color: #e9ecef;
    --secondary-color-hover: #dee2e6;
    --text-color: #1d1d1f;
    --secondary-text-color: #555;
    --background-color: #f5f5f7;
    --surface-color: #ffffff;
    --border-color: #d2d2d7;
    --border-radius: 12px;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

.hidden {
    display: none !important;
}

/* Header */
header {
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

header .logo {
    text-decoration: none;
}

.language-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.language-btn:hover {
    background-color: #f0f0f0;
}

.language-dropdown {
    position: relative;
}

.language-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    list-style: none;
    padding: 8px;
    min-width: 160px;
    max-height: 50vh;
    overflow: hidden;
    overflow-y: scroll;
}

.language-dropdown:hover .language-menu {
    display: block;
}

.language-menu a {
    display: block;
    padding: 8px 12px;
    text-decoration: none;
    color: var(--text-color);
    border-radius: 8px;
}

.language-menu a:hover {
    background-color: #f0f0f0;
}

/* Main Content */
main {
    padding: 40px 0;
}

.converter-section {
    background-color: var(--surface-color);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
}

.converter-section h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.converter-section .subtitle {
    font-size: 1.1rem;
    color: var(--secondary-text-color);
    margin-bottom: 30px;
}

/* Drop Area */
#drop-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 40px;
    transition: border-color 0.3s, background-color 0.3s;
}

#drop-area.drag-over {
    border-color: var(--primary-color);
    background-color: #f0f8ff;
}

#drop-area .upload-icon {
    font-size: 48px;
    color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s;
}

.btn:active {
    transform: scale(0.98);
}

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

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

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

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

.info-text {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
    margin-top: 15px;
}

/* Preview Section */
#preview-container {
    border: 2px dashed transparent;
    border-radius: var(--border-radius);
    transition: border-color 0.3s, background-color 0.3s;
    padding: 10px;
}

#preview-container.drag-over {
    border-color: var(--primary-color);
    background-color: #f0f8ff;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

#image-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
    margin-top: 30px;
}

.preview-card {
    position: relative;
    border-radius: var(--border-radius);
    overflow: hidden;
    cursor: grab;
    transition: transform 0.2s;
    aspect-ratio: 1 / 1;
    border: 1px solid var(--border-color);
}

.preview-card:active {
    cursor: grabbing;
}

.preview-card.sortable-ghost {
    opacity: 0.4;
    transform: scale(0.95);
}

.preview-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-card .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
    color: white;
}

.preview-card:hover .overlay {
    opacity: 1;
}

.preview-card .delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transform: scale(0);
    transition: transform 0.2s;
}

.preview-card .delete-btn .material-symbols-outlined {
    font-size: 18px;
}

.preview-card:hover .delete-btn {
    transform: scale(1);
}

/* Minimal App Promotion Section */
.app-promo-minimal {
    margin-top: 40px;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
    padding: 20px 25px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
}

.promo-icon {
    flex-shrink: 0;
}

.promo-icon img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    /* iOS-like icon radius */
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.promo-text h3 {
    font-size: 1.25rem;
    font-weight: 500;
    line-height: 1.3;
}

.promo-text p {
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

.promo-action {
    margin-left: auto;
    flex-shrink: 0;
}

.app-store-badge svg {
    height: 40px;
    display: block;
}

/* How It Works Section */
.how-to-section {
    padding: 60px 0;
    text-align: center;
    margin-top: 20px;
}

.how-to-section h2 {
    font-size: 2rem;
    margin-bottom: 40px;
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.step-card {
    background: var(--surface-color);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    transition: transform 0.3s;
}

.step-card .step-number {
    font-size: 3rem;
    font-weight: 700;
    color: rgba(0, 0, 0, 0.08);
    position: absolute;
    top: 15px;
    left: 20px;
    z-index: 0;
}

.step-card .step-icon .material-symbols-outlined {
    font-size: 48px;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.step-card h3 {
    margin-bottom: 10px;
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
}

.step-card p {
    color: var(--secondary-text-color);
    font-size: 0.95rem;
    position: relative;
    z-index: 1;
}

/* Info Section */
.info-section {
    margin-top: 60px;
    padding: 40px;
    background-color: var(--surface-color);
    border-radius: var(--border-radius);
}

.info-section h2 {
    margin-bottom: 10px;
}

.info-section h3 {
    margin-top: 30px;
    margin-bottom: 10px;
}

.info-section p,
.info-section li {
    color: var(--secondary-text-color);
    margin-bottom: 10px;
}

.info-section ul {
    padding-left: 20px;
}

/* Footer */
footer {
    margin-top: 40px;
    padding: 30px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: var(--secondary-text-color);
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: var(--secondary-text-color);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

@media (max-width: 600px) {

    .converter-section,
    .info-section {
        padding: 20px;
    }

    .converter-section h2 {
        font-size: 1.8rem;
    }

    .app-promo-minimal {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }

    .promo-action {
        margin-left: 0;
        margin-top: 5px;
    }

    .how-to-section {
        padding: 40px 0;
    }

    footer .container {
        flex-direction: column;
        gap: 15px;
    }
}