* {
    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;
    padding-bottom: 2rem;
}

.header-bar {
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
}

.header-bar img {
    height: 50px;
    margin-right: 1rem;
}

.header-title {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    letter-spacing: 0.5px;
}

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

/* Upload Card */
.upload-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.section-title {
    font-size: 1.75rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.section-subtitle {
    color: #666;
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

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

.file-input-container {
    width: 100%;
}

.file-input {
    display: none;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 3px dashed #667eea;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-label:hover {
    background: linear-gradient(135deg, #e0e7ff 0%, #c3cfe2 100%);
    border-color: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.file-icon {
    font-size: 2rem;
}

.file-name {
    flex: 1;
    margin: 0 1rem;
    font-weight: 500;
    color: #333;
}

.browse-btn {
    background: #667eea;
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.3s;
}

.browse-btn:hover {
    background: #764ba2;
}

.button-group {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    flex: 1;
    min-width: 150px;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-icon {
    font-size: 1.2rem;
}

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

.btn-primary:hover {
    background: linear-gradient(135deg, #5568d3 0%, #65408b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #e082ea 0%, #e4465b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 87, 108, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: #fff;
}

.btn-success:hover {
    background: linear-gradient(135deg, #3e9bed 0%, #00e1ed 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 172, 254, 0.4);
}

.message {
    display: none;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-top: 1rem;
    font-weight: 500;
    text-align: center;
    animation: slideIn 0.3s ease;
}

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

.message.success {
    background: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
}

.message.error {
    background: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
}

/* Table Card */
.table-card {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

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

.table-info {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.info-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.info-badge strong {
    font-size: 1.1rem;
    margin-left: 0.25rem;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

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

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 3px solid #764ba2;
}

.data-table tbody tr {
    transition: background 0.2s;
}

.data-table tbody tr:nth-child(even) {
    background: #f8f9fa;
}

.data-table tbody tr:hover {
    background: #e7f0ff;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #dee2e6;
    color: #333;
}

.action-column {
    text-align: center;
    width: 100px;
}

.btn-delete {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: #fff;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
}

.btn-delete:hover {
    background: linear-gradient(135deg, #e082ea 0%, #e4465b 100%);
    transform: scale(1.1);
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #666;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-bar {
        padding: 1rem;
    }
    
    .header-title {
        font-size: 1.5rem;
    }
    
    .header-bar img {
        height: 40px;
    }
    
    .upload-card, .table-card {
        padding: 1.5rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
    }
    
    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-input-label {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .file-name {
        margin: 0;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 1.3rem;
    }
    
    .upload-card, .table-card {
        padding: 1rem;
    }
    
    .info-badge {
        font-size: 0.8rem;
    }
}

/* Pagination Styles */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-top: 2px solid #dee2e6;
    border-radius: 0 0 12px 12px;
    flex-wrap: wrap;
    gap: 1rem;
}

.pagination-info {
    color: #495057;
    font-size: 0.95rem;
}

.pagination-info strong {
    color: #7c3aed;
    font-weight: 600;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.2);
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #6d28d9 0%, #5b21b6 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(124, 58, 237, 0.3);
}

.pagination-btn:disabled {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    box-shadow: none;
}

.page-indicator {
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid #7c3aed;
    border-radius: 6px;
    color: #495057;
    font-size: 0.95rem;
}

.page-indicator strong {
    color: #7c3aed;
    font-weight: 600;
}

.per-page-selector {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.per-page-selector label {
    color: #495057;
    font-size: 0.95rem;
    font-weight: 500;
}

.per-page-select {
    padding: 0.5rem 1rem;
    border: 2px solid #7c3aed;
    border-radius: 6px;
    background: white;
    color: #495057;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.per-page-select:hover {
    border-color: #6d28d9;
    box-shadow: 0 2px 4px rgba(124, 58, 237, 0.2);
}

.per-page-select:focus {
    outline: none;
    border-color: #6d28d9;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.1);
}

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

    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pagination-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-content {
    background: white;
    padding: 3rem 4rem;
    border-radius: 20px;
    text-align: center;
    max-width: 500px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

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

/* Spinner Animation */
.spinner {
    width: 60px;
    height: 60px;
    margin: 0 auto 1.5rem;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

#loading-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

#loading-message {
    font-size: 1.1rem;
    color: #d32f2f;
    font-weight: bold;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #ffebee;
    border-radius: 8px;
}

#loading-details {
    font-size: 0.95rem;
    color: #666;
    margin-bottom: 1.5rem;
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 1rem;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.progress-text {
    font-size: 0.9rem;
    color: #667eea;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* Prevent page interaction during upload */
#loading-overlay ~ * {
    pointer-events: none;
}

/* Upload Card with Loading */
.upload-card {
    position: relative;
}
