/* Main Styles for S3 Document Access Application */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Center the authentication container */
#auth-container {
    display: flex !important;
    justify-content: center;
    align-items: flex-start;
    min-height: 60vh;
    width: 100%;
    padding: 2rem 1rem;
}

#auth-container > div {
    max-width: 500px;
    width: 100%;
}

header {
    margin-bottom: 3rem;
    position: relative;
    text-align: center;
}

header h1 {
    color: #000;
    font-weight: 900;
    font-size: 3.5rem;
    margin: 0;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #000 0%, #333 50%, #000 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    position: relative;
}

.splash-title {
    animation: fadeInScale 1.2s ease-out;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

header h1::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, transparent, #000, transparent);
    border-radius: 2px;
}

header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, transparent, #666, transparent);
    border-radius: 1px;
}

/* Centered Authentication Card */
.auth-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 3rem 2.5rem;
    margin: 2rem auto;
    border: 1px solid #e9ecef;
    width: 100%;
    max-width: 450px;
    text-align: center;
}

.auth-icon {
    width: 80px;
    height: 80px;
    background: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.auth-icon i {
    font-size: 2.5rem;
    color: #fff;
}

.auth-title {
    color: #000;
    font-weight: 400;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: #666;
    font-size: 1rem;
    margin-bottom: 0;
    line-height: 1.5;
}

/* Primary Authentication Button */
.btn-auth {
    background: #000;
    color: #fff;
    border: 2px solid #000;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-bottom: 1rem;
}

.btn-auth:hover {
    background: #fff;
    color: #000;
    border-color: #000;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-auth i {
    font-size: 1.1rem;
}

.auth-note {
    color: #999;
    font-size: 0.875rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

/* Debug Tools Section */
.debug-tools {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.debug-label {
    color: #999;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.debug-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.btn-debug {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.btn-debug:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #adb5bd;
}

/* File list styling */
.list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-info {
    flex-grow: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.file-meta {
    font-size: 0.85rem;
    color: #6c757d;
}

.file-actions {
    display: flex;
    gap: 10px;
}

/* Authentication state styling */
.auth-container {
    transition: opacity 0.3s ease;
    display: flex !important;
}

.files-container {
    transition: opacity 0.3s ease;
}

/* Loading states */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid transparent;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error and success states */
.alert {
    border-radius: 8px;
}

.alert-danger {
    border-left: 4px solid #dc3545;
}

.alert-info {
    border-left: 4px solid #0dcaf0;
}

.alert-success {
    border-left: 4px solid #198754;
}

/* Refresh button styling */
#refresh-documents {
    display: flex;
    align-items: center;
    gap: 5px;
}

#refresh-documents:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Better spacing for the file actions */
.d-flex.align-items-center.gap-2 {
    gap: 0.5rem !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .auth-status {
        margin-top: 15px;
        width: 100%;
        justify-content: space-between;
    }
    
    .list-group-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .file-actions {
        margin-top: 10px;
        align-self: flex-end;
    }
    
    header h1 {
        font-size: 2.5rem;
        letter-spacing: -0.01em;
    }
    
    header h1::before {
        width: 80px;
        height: 3px;
    }
    
    header h1::after {
        width: 120px;
        height: 2px;
    }
}

@media (max-width: 576px) {
    header h1 {
        font-size: 2rem;
    }
    
    header h1::before {
        width: 60px;
        height: 2px;
    }
    
    header h1::after {
        width: 100px;
        height: 1px;
    }
    
    .auth-card {
        padding: 2rem 1.5rem;
        margin-top: 1rem;
    }
}

/* Dashboard Styles */
.dashboard-navbar {
    background: #000 !important;
    border-bottom: 1px solid #dee2e6;
}

.dashboard-navbar .navbar-brand {
    color: #fff !important;
    font-weight: 500;
}

.dashboard-navbar .navbar-brand:hover {
    color: #f8f9fa !important;
}

.dashboard-navbar .nav-link {
    color: #fff !important;
}

.dashboard-navbar .nav-link:hover {
    color: #f8f9fa !important;
}

.dropdown-menu {
    border: 1px solid #dee2e6;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.dropdown-item {
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #000;
}

/* Welcome card styling */
.welcome-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    border: 1px solid #dee2e6;
}

/* Statistics cards */
.stat-card {
    border: 1px solid #dee2e6;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

/* Documents section */
.documents-card {
    border: 1px solid #dee2e6;
}

.documents-card .card-header {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Folder and file styling for dashboard */
.folder-card {
    transition: all 0.2s ease-in-out;
    border: 1px solid #dee2e6;
}

.folder-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #ffc107;
}

.folder-item:hover {
    background-color: #f8f9fa;
    cursor: pointer;
}

/* Breadcrumb styling */
#breadcrumb-container .breadcrumb {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

#breadcrumb-container .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
    font-weight: bold;
}

#breadcrumb-container .breadcrumb-item a {
    color: #0d6efd;
    text-decoration: none;
}

#breadcrumb-container .breadcrumb-item a:hover {
    color: #0a58ca;
    text-decoration: underline;
}

#breadcrumb-container .breadcrumb-item.active {
    color: #6c757d;
    font-weight: 500;
}

/* Search and sort styling */
#search-docs:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

#sort-docs:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* File type icons with different colors */
.bi-file-earmark-pdf {
    color: #dc3545 !important;
}

.bi-file-earmark-word {
    color: #0d6efd !important;
}

.bi-file-earmark-excel {
    color: #198754 !important;
}

.bi-file-earmark-ppt {
    color: #fd7e14 !important;
}

.bi-file-earmark-image {
    color: #6f42c1 !important;
}

.bi-file-earmark-zip {
    color: #6c757d !important;
}

.bi-file-earmark-text {
    color: #20c997 !important;
}
/* Upload page specific styles */
.upload-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Search autocomplete dropdowns */
.position-relative {
    position: relative;
}

#model-suggestions,
#sku-suggestions {
    position: absolute;
    z-index: 1000;
    top: 100%;
    left: 0;
}

#model-suggestions .dropdown-item,
#sku-suggestions .dropdown-item {
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f0f0f0;
}

#model-suggestions .dropdown-item:last-child,
#sku-suggestions .dropdown-item:last-child {
    border-bottom: none;
}

#model-suggestions .dropdown-item:hover,
#sku-suggestions .dropdown-item:hover {
    background-color: #f8f9fa;
}

#model-suggestions .dropdown-item i,
#sku-suggestions .dropdown-item i {
    margin-right: 0.5rem;
    color: #0d6efd;
}

#model-suggestions .dropdown-item strong,
#sku-suggestions .dropdown-item strong {
    color: #212529;
}

#model-suggestions .dropdown-item small,
#sku-suggestions .dropdown-item small {
    display: block;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* SKU checkbox container */
#sku-checkbox-container {
    max-height: 200px;
    overflow-y: auto;
}

#sku-checkbox-container .form-check {
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

#sku-checkbox-container .form-check:hover {
    background-color: #f8f9fa;
}

.file-upload-zone {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
}

.file-upload-zone:hover {
    border-color: #0d6efd;
    background-color: #f8f9fa;
}

.file-upload-zone.dragover {
    border-color: #0d6efd;
    background-color: #e7f1ff;
}

.upload-icon {
    font-size: 3rem;
    color: #0d6efd;
    margin-bottom: 1rem;
}

.upload-progress {
    min-height: 80px;
}

.progress {
    height: 30px;
}

.progress-bar {
    font-size: 14px;
    line-height: 30px;
}

.file-preview-item {
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #f8f9fa;
}

.file-preview-item .file-name {
    font-weight: 500;
    color: #333;
}

.file-preview-item .file-size {
    color: #6c757d;
    font-size: 0.875rem;
}

.upload-history-item {
    padding: 1rem;
    margin-bottom: 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
}

.upload-history-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Form validation styles */
.form-control:invalid {
    border-color: #dc3545;
}

.form-control:valid {
    border-color: #198754;
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.was-validated .form-control:valid,
.form-control.is-valid {
    border-color: #198754;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}
/* ── Language Switcher ───────────────────────────────────────────────────── */
.lang-switcher .nav-link {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    white-space: nowrap;
}

.lang-dropdown {
    min-width: 130px;
}

.lang-dropdown .lang-option {
    font-size: 0.875rem;
}

.lang-dropdown .lang-option.active {
    background-color: #0d6efd;
    color: #fff;
}

.lang-flag {
    font-size: 1rem;
    line-height: 1;
}
