:root {
    --bg-color: #FDF7EF;
    /* Warm cream */
    --card-bg: #FFFFFF;
    --primary-color: #FF5733;
    /* Vibrant Red/Orange from reference */
    --primary-hover: #E64020;
    --text-main: #333333;
    --text-muted: #888888;
    --border-color: #EAEAEA;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    /* Center vertically too if possible */
    min-height: 100vh;
    padding: 20px;
}

.main-wrapper {
    width: 100%;
    max-width: 500px;
}

.app-header {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.logo-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: opacity 0.2s;
}

.logo-link:hover {
    opacity: 0.8;
}

.app-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    border-radius: 12px;
    /* Optional rounded look */
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0;
}

.card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

/* Format Section */
.format-section {
    margin-bottom: 2rem;
}

.section-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #AAA;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.format-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.fake-select,
.select-wrapper {
    flex: 1;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
    font-weight: 500;
    color: var(--text-main);
    position: relative;
}

.fake-select {
    background-color: #FAFAFA;
    cursor: default;
}

.divider {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Custom Select Styling */
.select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0;
    /* Hide default selector but keep clickability */
    cursor: pointer;
}

/* Since we hid the select, we need to show the text. 
   Actually, the simplest way to style a select cleanly without custom JS dropdowns 
   is to style the select itself. Let's revert to a styled select.
*/
.select-wrapper {
    position: relative;
    padding: 0;
}

.select-wrapper select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-main);
    appearance: none;
    position: static;
    opacity: 1;
    z-index: 1;
}

.select-wrapper .chevron {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--text-muted);
}

/* Upload Section */
.upload-section {
    margin-bottom: 1rem;
}

.upload-area {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--primary-color);
    border-radius: var(--radius);
    padding: 2.5rem 1rem;
    cursor: pointer;
    transition: transform 0.1s, background-color 0.2s;
    color: white;
    text-align: center;
}

.upload-area:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.upload-area:active {
    transform: translateY(0);
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.cloud-icon svg {
    width: 40px;
    height: 40px;
    stroke: white;
    stroke-width: 2;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 600;
}

.underline {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

input[type="file"] {
    display: none;
}

.file-count {
    text-align: center;
    min-height: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Convert Button */
.action-btn {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: var(--radius);
    background-color: var(--text-main);
    /* Dark Convert Button */
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.action-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #ccc;
}

/* Results */
.results-section {
    margin-top: 2rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.results-header h2 {
    font-size: 1.1rem;
}

.secondary-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
}

.results-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.file-name {
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: inline-block;
}

.download-btn {
    text-decoration: none;
    font-weight: 600;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.download-btn:hover {
    text-decoration: underline;
}

.error-container {
    background-color: #FEE2E2;
    color: #B91C1C;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

[hidden] {
    display: none !important;
}

@media (max-width: 600px) {
    body {
        padding: 1rem;
        align-items: flex-start;
        /* Allow scrolling on small screens */
    }

    .card {
        padding: 1.5rem;
    }

    .app-header h1 {
        font-size: 1.25rem;
    }

    .format-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .divider {
        transform: rotate(90deg);
    }
}