/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

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

a {
    color: #0078d4;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button {
    cursor: pointer;
    background-color: #0078d4;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 16px;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #106ebe;
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Header styles */
header {
    background-color: #0078d4;
    color: white;
    text-align: center;
    padding: 30px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main content styles */
main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

@media (min-width: 768px) {
    main {
        grid-template-columns: 1fr 1fr;
    }
}

.upload-panel, #result-panel {
    background-color: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #333;
}

/* File input styles */
.file-input-container {
    margin-bottom: 20px;
}

.custom-file-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border: 2px dashed #0078d4;
    border-radius: 4px;
    background-color: #f0f9ff;
    cursor: pointer;
}

.custom-file-input .button {
    background-color: #0078d4;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 14px;
}

#file-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

/* Options styles */
.options {
    margin-bottom: 20px;
}

.options label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.file-size-info {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
    text-align: right;
}

/* Loading indicator */
#loading {
    text-align: center;
    margin: 20px 0;
}

.spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 120, 212, 0.2);
    border-radius: 50%;
    border-top-color: #0078d4;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Result panel */
#success-message {
    color: #107c10;
    font-weight: 600;
    margin-bottom: 15px;
}

.preview-container {
    margin: 20px 0;
}

h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
}

#markdown-preview {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 4px;
    white-space: pre-wrap;
    overflow-x: auto;
    font-family: Consolas, Monaco, 'Andale Mono', monospace;
    font-size: 14px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #ddd;
}

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

#new-conversion-button {
    background-color: #f0f0f0;
    color: #333;
}

#new-conversion-button:hover {
    background-color: #e0e0e0;
}

/* Error message */
#error-message {
    background-color: #fde7e9;
    color: #d13438;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 20px 0;
    border-left: 4px solid #d13438;
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    color: #666;
}

/* Utility classes */
.hidden {
    display: none;
}
