* {
    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;
    position: relative;
}

.back-button {
    position: absolute;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

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

.back-button i {
    font-size: 1rem;
}

.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: 160px;
    padding: 1rem 1.75rem;
    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.65rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
}

.btn i {
    font-size: 1.1rem;
    transition: transform 0.3s ease;
}

.btn:hover i {
    transform: scale(1.1);
}

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

.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(-3px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

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

.btn-danger:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: #fff;
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 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 Controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-container {
    flex: 1;
    min-width: 250px;
    max-width: 500px;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.search-field-select {
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    background: #f8f9fa;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 150px;
}

.search-field-select:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input::placeholder {
    color: #999;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e0e0e0;
    background: #fff;
}

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

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

.data-table th {
    padding: 1.2rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: none;
    white-space: nowrap;
}

.data-table th:first-child {
    border-top-left-radius: 12px;
}

.data-table th:last-child {
    border-top-right-radius: 12px;
}

.data-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #f0f0f0;
}

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

.data-table tbody tr:hover {
    background: #f0f4ff;
    transform: scale(1.001);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #e8e8e8;
    color: #495057;
    font-size: 0.95rem;
    vertical-align: middle;
}

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

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

.btn-delete {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
}

.btn-delete i {
    font-size: 0.95rem;
}

.btn-delete:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(220, 53, 69, 0.3);
}

.btn-delete:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(220, 53, 69, 0.2);
}

.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 0.5rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    
    .back-button {
        position: static;
        order: -1;
        width: 100%;
        justify-content: center;
        padding: 0.65rem 1rem;
        font-size: 0.95rem;
    }
    
    .header-bar img {
        height: 40px;
        margin-right: 0.5rem;
    }
    
    .header-title {
        font-size: 1.5rem;
    }
    
    .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;
        gap: 1rem;
    }
    
    .table-controls {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .search-container {
        flex-direction: column;
        max-width: 100%;
        gap: 0.75rem;
        position: relative;
    }
    
    .search-field-select {
        width: 100%;
        min-width: 0;
    }
    
    .search-icon {
        position: absolute;
        left: 1rem;
        bottom: 0.75rem;
        top: auto;
        transform: none;
    }
    
    .search-input {
        width: 100%;
        padding-left: 2.75rem;
    }
    
    .per-page-selector {
        width: 100%;
        justify-content: space-between;
    }
    
    .file-input-label {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .file-name {
        margin: 0;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .pagination-controls {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .header-bar {
        padding: 0.75rem 0.5rem;
    }
    
    .back-button {
        padding: 0.6rem 0.85rem;
        font-size: 0.85rem;
    }
    
    .back-button i {
        font-size: 0.85rem;
    }
    
    .header-title {
        font-size: 1rem;
        text-align: center;
    }
    
    .header-bar img {
        height: 30px;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .upload-card, .table-card {
        padding: 0.75rem;
    }
    
    .info-badge {
        font-size: 0.75rem;
        padding: 0.4rem 0.8rem;
    }
    
    .search-field-select,
    .search-input {
        font-size: 0.9rem;
        padding: 0.65rem 0.85rem;
    }
    
    .search-input {
        padding-left: 2.5rem;
    }
    
    .search-icon {
        left: 0.85rem;
        bottom: 0.65rem;
        font-size: 0.9rem;
    }
    
    .btn {
        font-size: 0.9rem;
        padding: 0.65rem 1rem;
    }
    
    .table-controls {
        padding: 0.75rem;
    }
    
    .per-page-select {
        font-size: 0.85rem;
        padding: 0.5rem 0.75rem;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.6rem 0.5rem;
    }
    
    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }
    
    .page-indicator {
        font-size: 0.85rem;
    }
}

/* 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.6rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-btn i {
    font-size: 1rem;
}

.pagination-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #5568d3 0%, #65408b 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.35);
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.2);
}

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

.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;
    white-space: nowrap;
}

.per-page-selector span {
    color: #495057;
    font-size: 0.95rem;
    white-space: nowrap;
}

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

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

/* Table Loading Overlay */
.table-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    border-radius: 12px;
}

.table-loading-content {
    text-align: center;
}

.table-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 1rem;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.table-loading-content p {
    color: #667eea;
    font-weight: 600;
    font-size: 1rem;
}
