/* FileMove - Modern, clean styling */

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --background: #f8fafc;
    --card-background: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

nav {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

nav a {
    padding: 10px 24px;
    text-decoration: none;
    color: var(--text-primary);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

nav a:hover {
    background: var(--background);
}

nav a.active {
    background: var(--primary-color);
    color: white;
}

/* Upload Section */
.upload-section {
    background: var(--card-background);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
}

input[type="password"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* File Drop Area */
.file-drop-area {
    border: 3px dashed var(--border-color);
    border-radius: 12px;
    padding: 50px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.file-drop-area:hover,
.file-drop-area.dragover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.file-drop-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.file-drop-area p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.file-drop-area input[type="file"] {
    position: absolute;
    opacity: 0;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.browse-btn {
    padding: 10px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.3s ease;
}

.browse-btn:hover {
    background: var(--primary-hover);
}

.file-info {
    margin-top: 15px;
    padding: 12px;
    background: #f0fdf4;
    border-left: 4px solid var(--success-color);
    border-radius: 4px;
    display: none;
}

.file-info.show {
    display: block;
}

/* Progress Bar */
.progress-section {
    margin: 25px 0;
}

.progress-bar {
    width: 100%;
    height: 30px;
    background: var(--background);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--success-color));
    width: 0%;
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.progress-text {
    text-align: center;
    margin-top: 10px;
    font-weight: 600;
    color: var(--primary-color);
}

/* Upload Button */
.upload-btn {
    width: 100%;
    padding: 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-btn:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.upload-btn:disabled {
    background: var(--border-color);
    cursor: not-allowed;
}

/* Messages */
.message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 8px;
    display: none;
}

.message.show {
    display: block;
}

.message.success {
    background: #f0fdf4;
    color: #166534;
    border-left: 4px solid var(--success-color);
}

.message.error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
}

/* Browse Section */
.browse-section {
    background: var(--card-background);
    padding: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.files-header h2 {
    font-size: 1.8rem;
    color: var(--text-primary);
}

.refresh-btn {
    padding: 10px 20px;
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.refresh-btn:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

/* File Cards */
.files-grid {
    display: grid;
    gap: 20px;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: var(--background);
    border-radius: 10px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.file-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow);
}

.file-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
}

.file-name {
    font-size: 1.1rem;
    margin-bottom: 5px;
    word-break: break-word;
}

.file-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    gap: 15px;
}

.file-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.download-btn {
    padding: 10px 20px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.download-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.delete-btn {
    padding: 10px 15px;
    background: transparent;
    border: 2px solid var(--danger-color);
    color: var(--danger-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.delete-btn:hover {
    background: var(--danger-color);
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.empty-state p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

.upload-link {
    display: inline-block;
    padding: 12px 30px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.upload-link:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* Login Page */
.login-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-card {
    background: var(--card-background);
    padding: 50px 40px;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 420px;
    text-align: center;
}

.login-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.login-card h1 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-secondary);
    margin-bottom: 30px;
}

.login-error {
    background: #fef2f2;
    color: #991b1b;
    border-left: 4px solid var(--danger-color);
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    text-align: left;
}

.login-btn {
    width: 100%;
    padding: 14px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

/* Selected file list */
.file-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.file-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
}

.file-list-icon { flex-shrink: 0; }

.file-list-name {
    flex: 1;
    word-break: break-word;
    font-weight: 500;
}

.file-list-size {
    color: var(--text-secondary);
    font-size: 0.85rem;
    flex-shrink: 0;
}

.file-list-remove {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
    padding: 2px 6px;
    border-radius: 4px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.file-list-remove:hover {
    background: #fef2f2;
    color: var(--danger-color);
}

/* Success list */
.success-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: left;
}

.success-file-item {
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    word-break: break-word;
}

.success-file-item--ok {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.success-file-item--fail {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

/* Upload Success Panel */
.success-panel {
    text-align: center;
    padding: 50px 20px;
}

.success-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: pop 0.3s ease;
}

@keyframes pop {
    0% { transform: scale(0.5); opacity: 0; }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

.success-title {
    font-size: 1.8rem;
    color: var(--success-color);
    margin-bottom: 10px;
}

.success-filename {
    font-family: monospace;
    font-size: 1rem;
    color: var(--text-secondary);
    background: var(--background);
    padding: 8px 16px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 30px;
    word-break: break-all;
}

.success-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.browse-files-btn {
    display: inline-block;
    padding: 16px 24px;
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.browse-files-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Public badge and URL row */
.public-badge {
    background: #dcfce7;
    color: #166534;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.public-url-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.public-url-input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--background);
    min-width: 0;
}

.copy-btn {
    padding: 6px 10px;
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.copy-btn:hover {
    border-color: var(--primary-color);
    background: #eff6ff;
}

/* Share / public toggle button */
.share-btn {
    padding: 10px 15px;
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.share-btn:hover {
    border-color: var(--success-color);
    color: var(--success-color);
    background: #f0fdf4;
}

.share-btn--active {
    border-color: var(--success-color);
    color: var(--success-color);
    background: #f0fdf4;
}

.file-card--public {
    border-color: #86efac;
    background: #f0fdf4;
}

/* Nav logout link */
nav a.nav-logout {
    color: var(--text-secondary);
    margin-left: auto;
}

nav a.nav-logout:hover {
    color: var(--danger-color);
    background: #fef2f2;
}

/* Nav sign-in link (public page) */
nav a.nav-signin {
    margin-left: auto;
    background: var(--primary-color);
    color: white !important;
    border-radius: 8px;
}

nav a.nav-signin:hover {
    background: var(--primary-hover);
}

/* Section titles on manage page */
.section-title {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
}

.browse-section {
    margin-top: 30px;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .upload-section,
    .browse-section {
        padding: 25px;
    }
    
    .file-card {
        flex-direction: column;
        text-align: center;
    }
    
    .file-meta {
        justify-content: center;
    }
    
    .file-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .download-btn,
    .delete-btn {
        width: 100%;
    }
}
