/* Reset en basis styling */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header h1 i {
    color: #3498db;
}

.header-stats {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-card {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 150px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Controls */
.controls {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.search-filter {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.search-filter input,
.search-filter select {
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.search-filter input:focus,
.search-filter select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-filter input {
    min-width: 300px;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
    transform: translateY(-2px);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #229954;
    transform: translateY(-2px);
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

/* Table */
.table-container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

.facturen-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.facturen-table th,
.facturen-table td {
    padding: 15px 12px;
    text-align: left;
    border-bottom: 1px solid #e1e8ed;
}

.facturen-table th {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.facturen-table tbody tr {
    transition: all 0.3s ease;
}

.facturen-table tbody tr:hover {
    background: rgba(52, 152, 219, 0.05);
    transform: scale(1.01);
}

.facturen-table td {
    font-size: 14px;
}

/* Status badges */
.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-aankoop {
    background: #f39c12;
    color: white;
}

.status-verkocht {
    background: #27ae60;
    color: white;
}

.status-in_behandeling {
    background: #3498db;
    color: white;
}

.missing-info {
    background: #fff3cd !important;
    color: #8a6d3b !important;
    font-weight: 700;
}

/* Verhoogde specificiteit voor tabelcellen */
.facturen-table td.missing-info {
    background: #fff3cd !important;
    color: #8a6d3b !important;
    font-weight: 700;
    border-left: 3px solid #f0c36d;
}

/* BTW Badge */
.btw-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.btw-badge.btw-ja {
    background: #27ae60;
    color: white;
}

.btw-badge.btw-nee {
    background: #95a5a6;
    color: white;
}

/* Winst/Verlies styling */
.winst {
    color: #27ae60;
    font-weight: 600;
}

.verlies {
    color: #e74c3c;
    font-weight: 600;
}

.break-even {
    color: #95a5a6;
    font-weight: 600;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.pagination button {
    padding: 10px 15px;
    border: 2px solid #e1e8ed;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination button:hover {
    border-color: #3498db;
    background: #3498db;
    color: white;
}

.pagination button.active {
    background: #3498db;
    border-color: #3498db;
    color: white;
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Dropdown styling for result buttons */
.dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    background: #fff;
    min-width: 200px;
    border: 1px solid #dce4ec;
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
    border-radius: 10px;
    padding: 6px 0;
    z-index: 20;
}

.dropdown.open .dropdown-menu {
    display: block;
}

.dropdown-item {
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
}

.dropdown-item:hover {
    background: #f2f6ff;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    overflow-y: auto;
    padding: 20px 10px;
}

.modal-content {
    background: white;
    margin: 0 auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 25px;
    border-radius: 15px 15px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.close {
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.close:hover {
    opacity: 0.7;
    transform: scale(1.1);
}

.modal-body {
    padding: 30px;
    flex: 1;
    overflow-y: auto;
    max-height: calc(92vh - 190px); /* header + footer */
}

/* Form styling */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    flex: 1;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e1e8ed;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

/* Upload area */
.upload-area {
    border: 3px dashed #3498db;
    border-radius: 10px;
    padding: 40px;
    text-align: center;
    background: rgba(52, 152, 219, 0.05);
    transition: all 0.3s ease;
    cursor: pointer;
}

.upload-area:hover {
    background: rgba(52, 152, 219, 0.1);
    border-color: #2980b9;
}

.upload-area i {
    font-size: 3rem;
    color: #3498db;
    margin-bottom: 15px;
}

.upload-area p {
    color: #7f8c8d;
    font-size: 16px;
}

#file-input {
    display: none;
}

.uploaded-files {
    margin-top: 20px;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.file-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    background: #ffffff;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.file-icon {
    color: #3498db;
    font-size: 28px;
    width: 35px;
    text-align: center;
}

.file-icon.fa-file-pdf {
    color: #e74c3c;
}

.file-icon.fa-file-image {
    color: #9b59b6;
}

.file-icon.fa-file-word {
    color: #2980b9;
}

.file-name {
    font-weight: 600;
    color: #2c3e50;
    word-break: break-word;
}

.file-size {
    color: #7f8c8d;
    font-size: 12px;
    margin-top: 3px;
}

.file-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.file-actions .btn {
    padding: 8px 12px;
    font-size: 14px;
    min-width: 40px;
}

.btn-info {
    background: #3498db;
}

.btn-info:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
}

.btn-success:hover {
    background: #229954;
}

.remove-file {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Loading overlay */
.loading-overlay {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.loading-overlay.show {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Message container */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
}

.message {
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: messageSlideIn 0.3s ease;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.message.success {
    background: #27ae60;
    color: white;
}

.message.error {
    background: #e74c3c;
    color: white;
}

.message.info {
    background: #3498db;
    color: white;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .header {
        flex-direction: column;
        text-align: center;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .header-stats {
        justify-content: center;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-filter {
        flex-direction: column;
    }
    
    .search-filter input {
        min-width: auto;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .facturen-table {
        font-size: 12px;
    }
    
    .facturen-table th,
    .facturen-table td {
        padding: 8px 6px;
    }
    
    .modal-content {
        width: 95%;
        margin: 0 auto;
        max-height: 92vh;
    }
    
    .modal-body {
        padding: 20px;
        max-height: calc(92vh - 170px);
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.5rem;
    }
    
    .stat-card {
        min-width: 120px;
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .btn {
        padding: 10px 16px;
        font-size: 12px;
    }
}
