@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
    --bg-dark: #050505;
    --bg-card: #0f0f12;
    --accent: #3b82f6;
    --accent-glow: rgba(59, 130, 246, 0.5);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --danger: #ef4444;
    --success: #22c55e;
    --glass: rgba(15, 15, 18, 0.8);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 0% 100%, rgba(139, 92, 246, 0.1) 0%, transparent 40%);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2rem 1rem;
}

.container {
    width: 100%;
    max-width: 900px;
    background: var(--glass);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    background: linear-gradient(
        to right, 
        #fff 20%, 
        var(--accent) 40%, 
        #8b5cf6 60%, 
        #fff 80%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-align: left;
    animation: shine 4s linear infinite;
}

@keyframes shine {
    to {
        background-position: 200% center;
    }
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
}

/* Auth Pages Specific */
.auth-container {
    max-width: 420px;
    margin-top: 5vh;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    text-align: center;
    background-size: 200% auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Navbar Style Action */
.nav-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.logout-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
    border: 1px solid var(--border);
}

.logout-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

/* Sections */
.upload-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2.5rem;
}

.files-section {
    width: 100%;
}

/* Forms */
.form-field {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-field label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

input[type="text"],
input[type="email"],
input[type="password"] {
    width: 100%;
    background: #000;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: white;
    font-size: 0.95rem;
    transition: all 0.2s;
}

/* File Input Custom Styling */
.file-input-wrapper {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

input[type="file"] {
    display: none;
}

.custom-file-upload {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed var(--border);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-primary);
    transition: all 0.2s;
    white-space: nowrap;
}

.custom-file-upload:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
}

.file-name-display {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.file-name-display.active {
    color: var(--accent);
}

input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Custom Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 1rem;
}

/* Buttons */
button, .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    gap: 0.5rem;
}

button:active {
    transform: scale(0.98);
}

.btn-primary, button[onclick^="handleUpload"], button[type="submit"] {
    background: var(--accent);
    color: white;
    width: 100%;
    margin-top: 0.5rem;
}

.btn-primary:hover, button[onclick^="handleUpload"]:hover {
    background: #2563eb;
    box-shadow: 0 0 20px var(--accent-glow);
}

/* Table */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 0.5rem;
}

th {
    text-align: left;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
    color: var(--text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Actions in Table */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.action-buttons button {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
}

button[onclick^="handleDownload"] {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

button[onclick^="handleDownload"]:hover {
    background: var(--accent);
    color: white;
}

button[onclick^="copyShareLink"] {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

button[onclick^="copyShareLink"]:hover {
    background: #8b5cf6;
    color: white;
}

button[onclick^="deleteFile"] {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

button[onclick^="deleteFile"]:hover {
    background: var(--danger);
    color: white;
}

/* Status Messages */
#uploadStatus {
    margin-top: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'JetBrains Mono', monospace;
    padding: 0.5rem;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.2);
}

/* Shared Page Specific */
.share-card {
    max-width: 500px;
    text-align: center;
}

.share-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

#password-form {
    margin-top: 2rem;
}

/* Utility */
.text-center { text-align: center; }
.mt-4 { margin-top: 1rem; }

.switch-link {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.switch-link a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.switch-link a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    td, th {
        padding: 0.75rem 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
    }
}
