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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

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

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.header h1 a {
    color: #fff;
    text-decoration: none;
}

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

.nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.nav-link:hover,
.nav-link.active {
    opacity: 0.8;
}

#user-email {
    font-weight: 600;
    margin-right: 1rem;
}

.main {
    padding: 2rem 0;
    min-height: calc(100vh - 140px);
}

.hero {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 2rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #2d3748;
}

.hero p {
    font-size: 1.1rem;
    color: #718096;
    margin-bottom: 1.5rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    text-decoration: none;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-danger {
    background: #e53e3e;
    color: #fff;
}

.files-section {
    margin-top: 2rem;
}

.files-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.file-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

.file-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.file-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-align: center;
}

.file-info h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-meta {
    font-size: 0.875rem;
    color: #718096;
    margin-bottom: 1rem;
}

.file-meta span {
    display: block;
    margin-bottom: 0.25rem;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.file-actions .btn {
    flex: 1;
    padding: 0.5rem;
    font-size: 0.875rem;
}

.file-actions .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.auth-section {
    max-width: 400px;
    margin: 0 auto;
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.auth-section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: #2d3748;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #4a5568;
}

.form-group input {
    padding: 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    color: #718096;
}

.auth-link a {
    color: #667eea;
    text-decoration: none;
}

.error-message {
    color: #e53e3e;
    margin-top: 1rem;
    text-align: center;
}

.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.5);
}

.modal-content {
    background-color: #fff;
    margin: 15% auto;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #333;
}

.modal-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    justify-content: center;
}

.dashboard-section {
    max-width: 900px;
    margin: 0 auto;
}

.dashboard-section h2 {
    margin-bottom: 2rem;
    color: #2d3748;
}

.upload-area {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.upload-area h3 {
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.progress {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
}

.progress-bar {
    flex: 1;
    height: 20px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar div {
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s;
}

.progress-text {
    font-weight: 600;
    color: #667eea;
}

.my-files h3 {
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.admin-section {
    max-width: 1000px;
    margin: 0 auto;
}

.admin-section h2 {
    margin-bottom: 2rem;
    color: #2d3748;
}

.stats-card {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.stats-card h3 {
    margin-bottom: 1.5rem;
    color: #2d3748;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: #f5f7fa;
    border-radius: 8px;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    display: block;
    font-size: 0.875rem;
    color: #718096;
    margin-top: 0.5rem;
}

.admin-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.tab-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    background: #e2e8f0;
    color: #4a5568;
    transition: background 0.3s;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.admin-table {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    overflow: hidden;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.admin-table th {
    background: #f5f7fa;
    font-weight: 600;
    color: #4a5568;
}

.admin-table tr:hover {
    background: #f7fafc;
}

.error-section {
    text-align: center;
    padding: 4rem 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.error-section h2 {
    font-size: 4rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.error-section h3 {
    font-size: 1.5rem;
    color: #2d3748;
    margin-bottom: 1rem;
}

.error-section p {
    color: #718096;
    margin-bottom: 1.5rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: #718096;
}

.footer {
    background: #2d3748;
    color: #a0aec0;
    text-align: center;
    padding: 1rem 0;
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

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

    .hero h2 {
        font-size: 1.8rem;
    }

    .files-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .file-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }

    .hero {
        padding: 2rem 1rem;
    }

    .auth-section,
    .upload-area,
    .stats-card {
        padding: 1.5rem;
    }

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