/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 0 0 20px 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo i {
    font-size: 2.5rem;
    color: #667eea;
}

.logo-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    line-height: 1.2;
}

.company-name {
    color: #667eea;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.logo h1 {
    color: #333;
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0;
}

.tagline {
    color: #888;
    font-size: 0.75rem;
    font-weight: 500;
    font-style: italic;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #667eea;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: #667eea;
    border-radius: 1px;
}

/* User Menu */
.user-menu {
    position: relative;
}

.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.login-btn:hover {
    background: #5a67d8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

.user-info {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 25px;
    transition: background 0.3s ease;
}

.user-info:hover {
    background: rgba(102, 126, 234, 0.1);
}

.user-info i {
    font-size: 1.5rem;
    color: #667eea;
}

.user-name {
    font-weight: 500;
    color: #333;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-info:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.logout-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logout-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.logout-link i {
    font-size: 1rem;
}

/* Authentication Prompt */
.auth-prompt {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    padding: 40px 20px;
    background: linear-gradient(180deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    border-radius: 12px;
}

.auth-prompt-overlay {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-prompt-content {
    text-align: center;
    max-width: 380px;
    padding: 35px 30px;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.15);
    border: 1px solid rgba(102, 126, 234, 0.08);
    backdrop-filter: blur(10px);
}

.auth-prompt-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
    border-radius: 50%;
    color: #667eea;
}

.auth-prompt-icon i {
    font-size: 28px;
}

.auth-prompt-content h3 {
    color: #333;
    font-size: 22px;
    margin-bottom: 10px;
    font-weight: 600;
    letter-spacing: -0.3px;
}

.auth-prompt-content p {
    color: #666;
    margin-bottom: 25px;
    font-size: 14px;
    line-height: 1.5;
}

.auth-prompt-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
    border: none;
    cursor: pointer;
}

.auth-prompt-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 28px rgba(102, 126, 234, 0.4);
}

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

.auth-prompt-btn i {
    font-size: 16px;
}

/* Ensure Tables section centers the auth prompt properly */
#tablesList .auth-prompt,
.tables-grid .auth-prompt {
    width: 100%;
    margin: 0 auto;
}

/* Hero Section */
.hero {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 50px;
    margin-bottom: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.2;
}

.hero-content p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

.hero-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.feature {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.feature:hover {
    transform: translateY(-2px);
}

.feature i {
    font-size: 1.5rem;
    color: #667eea;
}

.hero-image {
    text-align: center;
}

.hero-image i {
    font-size: 8rem;
    color: rgba(102, 126, 234, 0.3);
}

/* Section Headers */
.section-header {
    text-align: center;
    margin-bottom: 40px;
}

.section-header h3 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.section-header h3 i {
    color: #667eea;
}

.section-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Upload Section */
.upload-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.upload-area {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 30px;
}

.upload-form {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 15px;
    border: 2px dashed #e9ecef;
    min-height: 300px;
}

/* Auth prompt in upload form */
#uploadForm .auth-prompt {
    min-height: auto;
    padding: 20px;
    background: transparent;
}

#uploadForm .auth-prompt-content {
    max-width: 350px;
    padding: 40px 30px;
}

.form-group {
    margin-bottom: 25px;
}

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

.form-group input[type="text"],
.form-group input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input[type="file"] {
    cursor: pointer;
}

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

.file-info {
    margin-top: 5px;
}

.file-info small {
    color: #666;
    font-size: 0.9rem;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    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, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.upload-info h4 {
    margin-bottom: 20px;
    color: #333;
}

.format-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.format-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.format-item:hover {
    transform: translateY(-2px);
}

.format-item i {
    font-size: 2rem;
    color: #667eea;
}

.format-item strong {
    display: block;
    color: #333;
    margin-bottom: 5px;
}

.format-item p {
    color: #666;
    font-size: 0.9rem;
}

/* Upload Progress */
.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

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

.progress-text {
    text-align: center;
    color: #666;
    font-weight: 500;
}

/* Upload Results */
.upload-results {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #28a745;
}

.results-header {
    margin-bottom: 15px;
}

.results-header h4 {
    color: #333;
}

/* Tables Section */
.tables-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.tables-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* When auth prompt is the only child, display as block for proper centering */
.tables-grid:has(.auth-prompt:only-child) {
    display: block;
}

.tables-grid .auth-prompt {
    grid-column: 1 / -1;
    width: 100%;
    margin: 0 auto;
}

.table-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
}

.table-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.table-card i {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 15px;
}

.table-card h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.table-card p {
    color: #666;
    font-size: 0.9rem;
}

/* Recent Uploads */
.recent-uploads {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.uploads-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

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

.upload-item:hover {
    background: #e9ecef;
}

.upload-item-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.upload-item-info i {
    font-size: 1.5rem;
    color: #667eea;
}

.upload-item-details h5 {
    color: #333;
    margin-bottom: 5px;
}

.upload-item-details p {
    color: #666;
    font-size: 0.9rem;
}

.upload-item-meta {
    text-align: right;
    color: #666;
    font-size: 0.9rem;
}

/* 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);
}

.modal-content {
    background: white;
    margin: 5% auto;
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.3s ease;
}

.modal-content.large {
    max-width: 1200px;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    transition: color 0.3s ease;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
    max-height: 70vh;
    overflow-y: auto;
}

/* Table Controls */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    display: flex;
    gap: 10px;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    font-size: 0.9rem;
}

.search-box button {
    padding: 8px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filters select {
    padding: 8px 12px;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    font-size: 0.9rem;
    min-width: 150px;
}

.filters button {
    padding: 8px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
}

.filters .btn-secondary {
    background: #6c757d;
    color: white;
}

.table-info {
    color: #666;
    font-size: 0.9rem;
}

/* Data Table */
.table-container {
    overflow-x: auto;
    margin-bottom: 20px;
}

#dataTable {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#dataTable th,
#dataTable td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

#dataTable th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
}

#dataTable tbody tr:hover {
    background: #f8f9fa;
}

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

#pageInfo {
    color: #666;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 30px;
    }

    .upload-area {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .nav {
        gap: 20px;
    }

    .hero-features {
        grid-template-columns: 1fr;
    }

    .table-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .modal-content {
        width: 95%;
        margin: 10% auto;
    }

    .modal-body {
        padding: 20px;
    }
}

/* Reports Section */
.reports-section {
    margin-bottom: 50px;
}

.reports-container {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.report-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    font-size: 0.9rem;
}

.filter-group select {
    padding: 10px 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.9rem;
    background: white;
}

.report-results {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.report-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.report-header h4 {
    margin: 0;
    color: #333;
}

.download-buttons {
    display: flex;
    gap: 10px;
}

.download-buttons .btn {
    padding: 8px 12px;
    font-size: 0.85rem;
}

.report-stats {
    display: flex;
    justify-content: space-around;
    padding: 20px;
    background: #e3f2fd;
    border-bottom: 1px solid #e9ecef;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 5px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #1976d2;
}

@media (max-width: 768px) {
    .report-filters {
        grid-template-columns: 1fr;
    }

    .report-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .download-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    .report-stats {
        flex-direction: column;
        gap: 15px;
    }

    .stat-item {
        padding: 10px 0;
        border-bottom: 1px solid #e9ecef;
    }

    .stat-item:last-child {
        border-bottom: none;
    }
}

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

    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    .nav {
        gap: 15px;
    }

    .hero-content h2 {
        font-size: 2rem;
    }

    .section-header h3 {
        font-size: 1.5rem;
    }

    .upload-form {
        padding: 20px;
    }

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