/* ==========================
   Algemene instellingen
========================== */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    margin: 0;
    color: #333;
    min-height: 100vh;
}

a {
    color: #2563eb;
    text-decoration: none;
    transition: color 0.2s;
}
a:hover { color: #1d4ed8; }

/* ==========================
   Header
========================== */
header {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}
header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #2563eb, #60a5fa, #2563eb);
}
header h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
}
header a { 
    color: #fff; 
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: background 0.2s;
}
header a:hover { 
    background: rgba(255,255,255,0.1); 
}

/* ==========================
   Containers & Cards
========================== */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 1rem;
}

.card {
    background: #fff;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    margin-bottom: 2.5rem;
    border: 1px solid rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    opacity: 0;
    transform: translateY(20px);
    animation: cardFadeIn 0.6s ease-out forwards;
}
.card:nth-child(2) { animation-delay: 0.1s; }
.card:nth-child(3) { animation-delay: 0.2s; }

@keyframes cardFadeIn {
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* ==========================
   Headings
========================== */
h2 {
    color: #1f2937;
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

h3 {
    color: #374151;
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    font-weight: 600;
}

/* ==========================
   Buttons
========================== */
button, a.button {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}
button:hover, a.button:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.button.danger {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}
.button.danger:hover {
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.4);
}

.button.secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
}

/* ==========================
   Forms & Inputs
========================== */
form {
    margin: 1.5rem 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
}

input, select, textarea {
    width: 100%;
    padding: 0.875rem;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: #fafafa;
}
input:focus, select:focus, textarea:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    transform: translateY(-1px);
}

/* ==========================
   Tables
========================== */
.users-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.users-table th {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    color: #374151;
    font-weight: 700;
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 2px solid #e5e7eb;
}

.users-table td {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.users-table tr:hover td {
    background: #f8fafc;
}

.users-table tr:last-child td {
    border-bottom: none;
}

/* ==========================
   File Lists
========================== */
.files-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.3s ease;
    border-radius: 10px;
    margin-bottom: 0.5rem;
    background: #fafafa;
}
.file-item:hover {
    background: #f0f4ff;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.file-item:last-child {
    border-bottom: none;
}

.file-info {
    flex: 1;
}

.filename {
    font-weight: 600;
    color: #1f2937;
    display: block;
    margin-bottom: 0.25rem;
}

.file-meta {
    font-size: 0.875rem;
    color: #6b7280;
}

.file-owner {
    font-size: 0.875rem;
    color: #2563eb;
    font-weight: 500;
}

.file-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ==========================
   Action Areas
========================== */
.actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.actions form {
    margin: 0;
}

.muted {
    color: #9ca3af;
    font-style: italic;
}

/* ==========================
   Progress bars
========================== */
.progress-container {
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    margin: 1rem 0;
    height: 24px;
    display: none;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #2563eb, #60a5fa);
    text-align: center;
    color: white;
    font-weight: 600;
    line-height: 24px;
    transition: width 0.4s ease;
    position: relative;
    overflow: hidden;
}
.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ==========================
   Drag & Drop Zone
========================== */
.drop-zone {
    border: 2px dashed #60a5fa;
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    color: #2563eb;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 1.5rem 0;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
}
.drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(96, 165, 250, 0.1), transparent);
    transition: left 0.5s;
}
.drop-zone:hover::before {
    left: 100%;
}
.drop-zone.dragover {
    background: #eff6ff;
    border-color: #2563eb;
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.15);
}

/* ==========================
   Messages & Alerts
========================== */
.error-message, .success-message {
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideIn 0.5s ease-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
@keyframes slideIn {
    from { 
        opacity: 0; 
        transform: translateX(-20px); 
    }
    to { 
        opacity: 1; 
        transform: translateX(0); 
    }
}

.error-message {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #dc2626;
    border-left: 4px solid #dc2626;
}

.success-message {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #16a34a;
    border-left: 4px solid #16a34a;
}

/* ==========================
   Admin Panel Specific
========================== */
.admin-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.admin-section {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #e5e7eb;
}

/* ==========================
   Login Page
========================== */
.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #60a5fa 100%);
    position: relative;
    overflow: hidden;
}
.login-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="%23ffffff" fill-opacity="0.05" points="0,1000 1000,0 1000,1000"/></svg>');
}
.login-container {
    position: relative;
    z-index: 1;
}
.login-page .card {
    max-width: 420px;
    width: 90vw;
    text-align: center;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(20px);
    transform: scale(0.9);
    opacity: 0;
    animation: loginFadeIn 0.6s ease-out forwards;
}
@keyframes loginFadeIn {
    to { 
        transform: scale(1); 
        opacity: 1; 
    }
}
.login-page h2 { 
    margin-bottom: 2rem; 
    color: #1f2937;
    font-size: 2rem;
}
.login-page input {
    border-radius: 12px;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid #e5e7eb;
    margin-bottom: 1.25rem;
    background: #fafafa;
}
.login-page input:focus {
    border-color: #2563eb;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
.login-page button {
    width: 100%;
    padding: 1rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}
.login-page button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.5);
}

/* ==========================
   Footer
========================== */
footer {
    text-align: center;
    padding: 2rem;
    color: #6b7280;
    font-size: 0.9rem;
    margin-top: 3rem;
    border-top: 1px solid #e5e7eb;
}

/* ==========================
   Responsive Design
========================== */
@media (max-width: 768px) {
    header { 
        flex-direction: column; 
        align-items: flex-start; 
        gap: 1rem;
    }
    header h1 { 
        margin-bottom: 0; 
        font-size: 1.5rem;
    }
    
    .card {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .file-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .users-table {
        font-size: 0.875rem;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.875rem 0.5rem;
    }
    
    main {
        padding: 0.5rem;
        margin: 1rem auto;
    }
}

@media (max-width: 480px) {
    .login-page .card {
        padding: 2rem 1.5rem;
    }
    
    .button, button {
        padding: 0.875rem 1rem;
        font-size: 0.85rem;
    }
    
    h2 {
        font-size: 1.3rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
}

/* ==========================
   Utility Classes
========================== */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 2rem; }
.mt-2 { margin-top: 2rem; }
.flex { display: flex; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.gap-2 { gap: 2rem; }
.w-full { width: 100%; }

/* ==========================
   Loading States
========================== */
.loading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}
.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: -10px;
    margin-top: -10px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}