:root {
    --bg-color: #ffffff;
    --text-color: #2d3748;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --input-bg: #f8fafc;
    --button-bg: #3182ce;
    --button-hover: #2c5282;
    --file-link: #2b6cb0;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
}

[data-theme="dark"] {
    --bg-color: #1a202c;
    --text-color: #e2e8f0;
    --border-color: #2d3748;
    --card-bg: #2d3748;
    --input-bg: #1a202c;
    --button-bg: #4299e1;
    --button-hover: #2a4365;
    --file-link: #63b3ed;
    --shadow: 0 2px 10px rgba(0,0,0,0.3);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 20px;
    transition: background-color 0.3s, color 0.3s;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: var(--card-bg);
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 10px;
}

.header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    font-size: 1.2rem;
    transition: all 0.2s;
}

.theme-toggle:hover {
    background: var(--input-bg);
}

.upload-form {
    background: var(--input-bg);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.upload-form p {
    margin: 0 0 15px;
}

.upload-form input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-color);
    color: var(--text-color);
}

.upload-form button {
    margin-top: 15px;
    padding: 10px 24px;
    background-color: var(--button-bg);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.upload-form button:hover {
    background-color: var(--button-hover);
}

.file-list h2 {
    margin-top: 30px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.file-item {
    padding: 12px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed var(--border-color);
    flex-wrap: wrap;
    gap: 10px;
}

.file-info a {
    color: var(--file-link);
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-info a:hover {
    text-decoration: underline;
}

.delete-btn {
    background: none;
    border: none;
    color: #e53e3e;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 6px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.delete-btn:hover {
    background-color: rgba(229, 62, 62, 0.15);
}

.file-meta {
    font-size: 0.85rem;
    color: var(--text-color);
    opacity: 0.8;
    white-space: nowrap;
}

.messages {
    margin-bottom: 20px;
}

.message {
    padding: 10px;
    background: #e6fffa;
    border-left: 4px solid #38b2ac;
    border-radius: 4px;
    color: #234e52;
}

@media (max-width: 600px) {
    .container {
        padding: 18px;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .file-meta {
        margin-left: 0;
        margin-top: 4px;
    }

    .upload-form button {
        width: 100%;
        justify-content: center;
    }
}

.messages {
    margin: 1rem 0;
}
.message {
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}
.message.warning { background-color: #fff3cd; color: #856404; }
.message.success { background-color: #d4edda; color: #155724; }