/* ============================================
   CUSTOMER PORTAL SPECIFIC STYLES
   Styles unique to customer-facing portal
   ============================================ */

/* Override body background for customer portal */
body {
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Customer Portal Container - MUCH WIDER - More specific selector to override shared-styles.css */
body .container {
    max-width: 1100px; /* Increased from 600px to 1100px */
    width: 100%;
    margin: 0 auto;
    padding: 20px; /* Override the 0 40px from shared-styles */
}

/* Customer Portal Cards - More specific to override shared-styles.css */
body .card {
    background: #000000;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    padding: 40px;
    margin-bottom: 24px;
    color: #ffffff;
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 32px;
}

.logo {
    width: 80px;
    height: auto;
    margin-bottom: 16px;
}

.company-name {
    font-size: 24px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.tagline {
    font-size: 14px;
    color: #cccccc;
}

/* Section Titles */
.section-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Input Group */
.input-group {
    margin-bottom: 24px;
}

/* Labels in customer portal - override shared-styles.css */
body .card label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 500;
    font-size: 16px;
}

/* Lock icon styling */
.locked-icon {
    display: inline-block;
    margin-right: 6px;
    font-size: 20px;
    color: #FFD700;
}

/* Override input styles for customer portal */
input[type="text"],
input[type="password"] {
    padding: 14px 16px;
    border: 2px solid #444444;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
    background: #ffffff;
    color: #000000;
}

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

/* Upload Area */
.upload-area {
    border: 3px dashed #555555;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #1a1a1a;
    position: relative;
}

.upload-area:hover {
    border-color: #667eea;
    background: #2a2a2a;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #2a2a2a;
    transform: scale(1.02);
}

.upload-area.has-file {
    border-color: #4CAF50;
    background: #f1f8f4;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.upload-text {
    color: #cccccc;
    font-size: 15px;
    margin-bottom: 8px;
}

.upload-subtext {
    color: #999999;
    font-size: 13px;
}

.file-input {
    display: none;
}

/* Selected File Display */
.selected-file {
    margin-top: 16px;
    padding: 16px;
    background: #1a4d1a;
    border-radius: 8px;
    border: 1px solid #4CAF50;
    display: none;
}

.file-name {
    font-weight: 600;
    color: #4CAF50;
    margin-bottom: 4px;
}

.file-size {
    font-size: 13px;
    color: #cccccc;
}

/* Customer Portal Buttons */
.btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

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

.btn:disabled {
    background: #cccccc;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    text-transform: none;
    letter-spacing: normal;
}

.btn-secondary:hover {
    background: #e0e0e0;
    box-shadow: none;
    transform: none;
}

/* Progress Bar (Customer Portal) */
.progress-container {
    display: none;
    margin-top: 20px;
}

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

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

.progress-text {
    text-align: center;
    margin-top: 12px;
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

/* Message Animations */
.message {
    margin-top: 20px;
    padding: 16px;
    border-radius: 8px;
    animation: slideIn 0.3s;
    background: #f5f5f5;
    color: #333333;
    border: 2px solid #d0d0d0;
}

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

.message.success {
    background: #e8f5e9 !important;
    color: #2e7d32 !important;
    border: 2px solid #81c784;
}

.message.error {
    background: #ffebee !important;
    color: #c62828 !important;
    border: 2px solid #ef5350;
}

/* Divider */
.divider {
    height: 2px;
    background: linear-gradient(to right, transparent, #e0e0e0, transparent);
    margin: 32px 0;
}

/* Files Section */
.files-section {
    display: none;
}

.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* SCROLLABLE FILE LISTS - NEW */
.file-list-scrollable {
    max-height: 400px; /* Maximum height before scrolling */
    overflow-y: auto;
    padding-right: 8px; /* Space for scrollbar */
}

/* Custom scrollbar styling */
.file-list-scrollable::-webkit-scrollbar {
    width: 8px;
}

.file-list-scrollable::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.file-list-scrollable::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 4px;
}

.file-list-scrollable::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.file-list {
    list-style: none;
}

.file-item {
    padding: 20px; /* More padding */
    background: #fafafa;
    border-radius: 8px;
    margin-bottom: 12px;
    display: grid; /* Changed from flex to grid */
    grid-template-columns: 1fr auto; /* File info takes remaining space, button takes what it needs */
    gap: 20px; /* Space between columns */
    align-items: center;
    border: 1px solid #e5e5e5;
    transition: all 0.2s;
}

.file-item:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
    transform: translateX(4px);
}

.file-info {
    min-width: 0; /* Allow text truncation */
    overflow: hidden; /* Prevent overflow */
}

.file-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 14px;
    word-wrap: break-word; /* Allow long filenames to wrap */
    overflow-wrap: break-word;
    line-height: 1.4;
}

.file-meta {
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

.download-btn {
    padding: 12px 24px; /* Even bigger button */
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px; /* Slightly larger text */
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Montserrat', sans-serif;
    white-space: nowrap;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.download-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* Search/Filter Bar */
.search-filter-bar {
    margin-bottom: 20px;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    font-size: 13px;
    margin-top: 24px;
    opacity: 0.9;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .container {
        max-width: 100%;
    }

    .card {
        padding: 24px;
    }

    .company-name {
        font-size: 20px;
    }

    .upload-area {
        padding: 30px 15px;
    }

    .file-item {
        grid-template-columns: 1fr; /* Stack on mobile */
        gap: 12px;
    }

    .download-btn {
        width: 100%;
        justify-self: stretch; /* Full width on mobile */
    }

    .file-list-scrollable {
        max-height: 300px; /* Shorter on mobile */
    }

    .file-title {
        white-space: normal; /* Allow wrapping on mobile */
    }
}

@media (max-width: 640px) {
    .files-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .btn-secondary {
        width: 100%;
    }
}