@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500&display=swap');

:root {
    --bg-color: #1a1a2e;
    --primary-color: #16213e;
    --secondary-color: #0f3460;
    --accent-color: #e94560;
    --font-color: #dcdcdc;
    --border-radius: 12px;
    --shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}
body {
    font-family: 'Noto Sans SC', sans-serif;
    background-color: var(--bg-color);
    color: var(--font-color);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}
.container {
    width: 100%;
    max-width: 1200px;
    background-color: var(--primary-color);
    padding: 20px 40px;
    margin: 20px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--secondary-color);
    flex-grow: 1;
}
h1, h2 {
    text-align: center;
    color: #fff;
    font-weight: 500;
    letter-spacing: 1px;
    margin-bottom: 30px;
}
h1 { font-size: 2.5em; text-shadow: 0 0 10px var(--accent-color); }
h2 { border-top: 1px solid var(--secondary-color); padding-top: 30px; }
.action-tabs { display: flex; margin-bottom: 30px; background-color: var(--secondary-color); border-radius: var(--border-radius); padding: 5px; }
.tab { flex: 1; display: flex; align-items: center; justify-content: center; padding: 15px; cursor: pointer; border-radius: 8px; transition: background-color 0.3s ease, color 0.3s ease; gap: 10px; font-weight: 500; }
.tab:hover { background-color: rgba(255, 255, 255, 0.1); }
.tab.active { background-color: var(--accent-color); color: #fff; box-shadow: 0 0 15px rgba(233, 69, 96, 0.6); }
.tab.active svg { stroke: #fff; }
.form-group { margin-bottom: 25px; }
label { display: block; margin-bottom: 10px; font-weight: 400; color: var(--font-color); }
textarea { width: 100%; padding: 15px; border: 1px solid var(--secondary-color); border-radius: 8px; box-sizing: border-box; font-size: 16px; background-color: var(--secondary-color); color: var(--font-color); resize: vertical; transition: all 0.3s ease; }
textarea:focus { outline: none; border-color: var(--accent-color); box-shadow: 0 0 10px rgba(233, 69, 96, 0.5); }
input[type="file"] { display: none; }
.custom-file-upload { border: 1px dashed var(--secondary-color); border-radius: 8px; display: inline-block; padding: 15px 25px; cursor: pointer; background-color: var(--secondary-color); transition: all 0.3s ease; text-align: center; width: 100%; box-sizing: border-box; }
.custom-file-upload:hover { border-color: var(--accent-color); }
.submit-btn { width: 100%; padding: 18px; background: linear-gradient(45deg, #e94560, #a10f2d); color: white; border: none; border-radius: 8px; font-size: 18px; font-weight: 500; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 5px 15px rgba(233, 69, 96, 0.4); }
.submit-btn:hover:not(:disabled) { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(233, 69, 96, 0.6); }
.submit-btn:disabled { background: #555; cursor: not-allowed; box-shadow: none; }
#loading { text-align: center; margin-top: 30px; }
.spinner { border: 4px solid rgba(255, 255, 255, 0.2); border-top: 4px solid var(--accent-color); border-radius: 50%; width: 40px; height: 40px; animation: spin 1s linear infinite; margin: 0 auto 10px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.modal { display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0, 0, 0, 0.7); backdrop-filter: blur(5px); animation: fadeIn 0.3s ease; }
.modal-content { position: relative; margin: 5% auto; padding: 30px; width: 80%; max-width: 900px; background-color: var(--primary-color); border-radius: var(--border-radius); border: 1px solid var(--secondary-color); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4); animation: slideIn 0.4s ease-out; }
#modal-body { display: flex; gap: 20px; }
#modal-image { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 8px; }
.download-btn, .delete-btn { position: absolute; bottom: 10px; background-color: rgba(0, 0, 0, 0.6); color: white; padding: 6px 12px; border-radius: 6px; text-decoration: none; font-size: 12px; font-weight: 500; opacity: 1; transition: all 0.3s ease; z-index: 2; cursor: pointer; border: none; }
.download-btn { right: 10px; background-color: rgba(52, 152, 219, 0.8); }
.delete-btn { left: 10px; background-color: rgba(233, 69, 96, 0.8); }
.modal-details { flex-grow: 1; }
.modal-details h3 { color: var(--accent-color); margin-top: 0; border-bottom: 1px solid var(--secondary-color); padding-bottom: 10px; }
#modal-prompt { font-size: 16px; line-height: 1.6; word-wrap: break-word; background: var(--secondary-color); padding: 15px; border-radius: 8px; }
.close-btn { color: #aaa; float: right; font-size: 38px; font-weight: bold; position: absolute; top: 10px; right: 25px; transition: color 0.3s; }
.close-btn:hover, .close-btn:focus { color: var(--accent-color); text-decoration: none; cursor: pointer; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-50px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .container {
        padding: 15px;
        margin: 10px;
    }
    h1 {
        font-size: 1.8em;
    }
    .action-tabs {
        flex-direction: column;
        gap: 5px;
    }
    .tab {
        padding: 12px;
    }
    textarea {
        padding: 12px;
        font-size: 14px;
    }
    .submit-btn {
        padding: 15px;
        font-size: 16px;
    }
    #modal-body {
        flex-direction: column;
    }
    #modal-image {
        width: 100%;
    }
    .modal-content {
        width: 90%;
        padding: 20px;
    }
    .welcome-header {
        flex-direction: column;
        gap: 20px;
    }
    .user-info {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px !important;
    }
    .history-list-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .history-title {
        white-space: normal;
    }
    .admin-container table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}
