/* --- Global Reset & Variables --- */
:root {
    --bg-main: #282a36;
    --bg-panel: #21222c;
    --bg-code: #1e1f29;
    --border: #44475a;
    --text-main: #f8f8f2;
    --text-muted: #6272a4;
    --accent-cyan: #8be9fd;
    --accent-purple: #bd93f9;
    --accent-green: #50fa7b;
    --accent-red: #ff5555;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.5;
}

/* --- Navigation --- */
.top-nav {
    padding: 12px 32px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: color 0.2s;
}

.back-link:hover {
    color: var(--text-main);
}

/* Right-side auth cluster in the nav bar */
.nav-auth {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-status {
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-nav-auth {
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: transparent;
    color: var(--text-main);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    white-space: nowrap;
    flex: none;
}

.btn-nav-auth:hover {
    border-color: var(--accent-purple);
    background: rgba(189, 147, 249, 0.08);
    color: var(--accent-purple);
}

/* Profile state for nav auth button */
.btn-nav-auth.btn-profile {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 220px;
    overflow: hidden;
}

.btn-nav-auth.btn-profile span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-avatar {
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border-radius: 999px;
    object-fit: cover;
    display: block;
}

/* --- Layout --- */
.submit-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 30px;
}

.submit-header {
    text-align: center;
    margin-bottom: 30px;
}

.submit-header h1 {
    font-size: 2.2rem;
    margin: 0 0 10px 0;
    color: var(--text-main);
    font-weight: 700;
}

.submit-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin: 0;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 40px;
}

.info-section {
    background: var(--bg-panel);
    border-radius: 8px;
    padding: 25px 30px;
    border: 1px solid var(--border);
}

.upload-section {
    background: var(--bg-panel);
    border-radius: 8px;
    padding: 25px 30px;
    border: 1px solid var(--border);
    
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    height: auto; 
    min-height: 450px; 
}

.info-section h2, .upload-section h2 {
    color: var(--text-main);
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    font-weight: 600;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-bottom: 15px;
}

/* --- Code Block --- */
.format-example {
    background: var(--bg-code);
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-bottom: 20px;
    overflow-x: auto;
}

.format-example pre {
    margin: 0;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--text-main);
}

.format-example .comment { color: var(--text-muted); }
.format-example .keyword { color: var(--accent-purple); }

.format-divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 15px 0;
}

/* --- Help List --- */
.help-section h3 {
    font-size: 0.95rem;
    color: var(--accent-purple); 
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.help-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.95rem; 
    color: var(--text-main);
    line-height: 1.7;
}

.help-section li {
    margin-bottom: 16px; 
}

.help-section strong {
    color: var(--accent-green);
    font-size: 1rem;
    margin-right: 4px;
}

.help-section code {
    background: #343746;
    padding: 3px 6px;
    border-radius: 4px;
    color: var(--accent-cyan); 
    border: 1px solid #44475a;
    font-family: 'Menlo', 'Monaco', monospace;
    font-size: 0.85rem;
}

/* --- Drop Zone --- */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg-main);
    margin-bottom: 20px;
    flex-shrink: 0;
}

.drop-zone:hover {
    border-color: var(--text-muted);
    background: var(--bg-code);
}

.drop-zone.active {
    border-color: var(--accent-cyan);
    background: rgba(139, 233, 253, 0.05);
}

.drop-zone-icon {
    color: var(--text-muted);
    margin-bottom: 15px;
}

.drop-zone-icon svg {
    transition: color 0.2s;
}

.drop-zone:hover .drop-zone-icon svg, .drop-zone.active .drop-zone-icon svg {
    color: var(--accent-cyan);
}

.drop-zone-text {
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1rem;
}

.drop-zone-subtext {
    color: var(--text-muted);
    font-size: 0.85rem;
}

#typ-file {
    display: none;
}

/* --- File Info & Buttons --- */
.file-info {
    background: var(--bg-code);
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid var(--accent-cyan);
    margin-bottom: 20px;
    display: none;
}

.file-info.show {
    display: block;
}

.file-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.file-details .name {
    color: var(--text-main);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70%;
}

.file-details .size {
    color: var(--text-muted);
}

.button-group {
    display: flex;
    gap: 12px;
}

button {
    flex: 1;
    padding: 10px 16px;
    font-size: 0.9rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-submit {
    background: var(--accent-purple);
    color: var(--bg-main);
}

.btn-submit:hover:not(:disabled) {
    background: #d5a8ff;
}

.btn-submit:disabled {
    background: var(--border);
    color: var(--text-muted);
    cursor: not-allowed;
}

.btn-clear {
    background: var(--border);
    color: var(--text-main);
    flex: 0.4;
}

.btn-clear:hover {
    background: var(--text-muted);
}

/* --- Status Messages --- */
.status-message {
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
    word-wrap: break-word;
}

.status-message.show { display: block; }

.status-message.success {
    background: rgba(80, 250, 123, 0.1);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

.status-message.error {
    background: rgba(255, 85, 85, 0.1);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

.status-message.loading {
    background: rgba(139, 233, 253, 0.1);
    color: var(--accent-cyan);
    border: 1px solid var(--accent-cyan);
    display: flex;
    align-items: center;
    gap: 10px;
}

.loading-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(139, 233, 253, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-cyan);
    animation: spin 0.8s linear infinite;
}

.pr-link-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background-color: rgba(80, 250, 123, 0.2);
    color: #50fa7b;
    border: 1px solid #50fa7b;
    border-radius: 4px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s ease;
}

.pr-link-btn:hover {
    background-color: rgba(80, 250, 123, 0.4);
}

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

/* --- Responsive --- */
@media (max-width: 768px) {
    .content-wrapper { grid-template-columns: 1fr; }
    .submit-container { padding: 0 15px 40px; }
    .top-nav { padding: 15px; }
}
