/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    --bg-color: #f8fafc;
    --text-color: #1e293b;
    --border-color: #e2e8f0;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background-color: white;
    box-shadow: var(--shadow);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 600;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-menu a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.nav-user {
    color: var(--secondary-color);
    font-weight: 500;
}

.btn-logout {
    color: var(--error-color) !important;
}

/* Main Content */
main {
    flex: 1;
    padding: 2rem 0;
}

/* Messages/Alerts */
.messages {
    margin-bottom: 2rem;
}

.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.alert-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid var(--success-color);
}

.alert-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid var(--error-color);
}

.alert-warning {
    background-color: #fef3c7;
    color: #92400e;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid var(--info-color);
}

/* Auth Container (Login) */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

.auth-card {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: 1.75rem;
}

.subtitle {
    color: var(--secondary-color);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group input[type="text"],
.form-group input[type="password"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group input[type="file"] {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background-color: white;
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    width: 100%;
    transition: border-color 0.2s, background-color 0.2s;
    font-weight: 500;
}

.file-label:hover {
    border-color: var(--primary-color);
    background-color: #eff6ff;
}

.help-text {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--secondary-color);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s, transform 0.1s;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    margin-left: 0.5rem;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-download {
    background-color: var(--success-color);
    color: white;
}

.btn-download:hover {
    background-color: #059669;
}

.btn-delete {
    background-color: var(--error-color);
    color: white;
    margin-left: 0.5rem;
}

.btn-delete:hover {
    background-color: #dc2626;
}

/* Upload Container */
.upload-container {
    max-width: 700px;
    margin: 0 auto;
}

.upload-container h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.info-box {
    background-color: #eff6ff;
    border-left: 4px solid var(--info-color);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.info-box p {
    margin: 0.5rem 0;
}

/* Files Container */
.files-container {
    max-width: 1000px;
    margin: 0 auto;
}

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.files-header h2 {
    font-size: 2rem;
}

.files-count {
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

/* Table */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.files-table {
    width: 100%;
    border-collapse: collapse;
}

.files-table thead {
    background-color: #f1f5f9;
}

.files-table th {
    text-align: left;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    border-bottom: 2px solid var(--border-color);
}

.files-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.files-table tbody tr:last-child td {
    border-bottom: none;
}

.files-table tbody tr:hover {
    background-color: #f8fafc;
}

.file-name {
    font-weight: 500;
    color: var(--text-color);
}

.actions {
    white-space: nowrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.empty-state p {
    color: var(--secondary-color);
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
}

/* Footer */
footer {
    background-color: white;
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 3rem;
    text-align: center;
    color: var(--secondary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .files-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .table-container {
        overflow-x: auto;
    }

    .files-table {
        font-size: 0.875rem;
    }

    .files-table th,
    .files-table td {
        padding: 0.75rem 1rem;
    }

    .auth-card {
        padding: 2rem;
    }
}
