/**
 * Custom CSS for STL Upload System
 * Bootstrap 5 overrides and additional styles
 */

/* ===================================
   General Styles
   =================================== */

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    flex: 1;
}

/* ===================================
   Navbar Styles
   =================================== */

.navbar-brand {
    font-weight: 600;
    font-size: 1.25rem;
}

.navbar-brand i {
    margin-right: 0.5rem;
}

.navbar-black {
    background-color: #000000;
}

.navbar-logo {
    height: 40px;
    width: auto;
    display: block;
}

@media (max-width: 768px) {
    .navbar-logo {
        height: 32px;
    }
}

/* ===================================
   Card Styles
   =================================== */

.card {
    border-radius: 0.5rem;
    margin-bottom: 2rem;
}

.card-header {
    border-radius: 0.5rem 0.5rem 0 0 !important;
    font-weight: 600;
}

.card-header i {
    margin-right: 0.5rem;
}

/* ===================================
   Dropzone Styles
   =================================== */

.dropzone {
    border: 3px dashed #0d6efd;
    border-radius: 0.5rem;
    background-color: #f8f9fa;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dropzone:hover {
    border-color: #0b5ed7;
    background-color: #e7f1ff;
}

.dropzone.dz-drag-hover {
    border-color: #198754;
    background-color: #d1e7dd;
}

.dropzone .dz-message {
    margin: 0;
    padding: 1rem;
}

.dropzone .dz-message h5 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.dropzone .dz-preview {
    margin: 1rem;
}

.dropzone .dz-preview .dz-image {
    border-radius: 0.5rem;
}

.dropzone .dz-preview .dz-details {
    padding: 0.5rem;
}

.dropzone .dz-preview .dz-progress {
    height: 8px;
    border-radius: 4px;
}

.dropzone .dz-preview .dz-progress .dz-upload {
    background: linear-gradient(to right, #0d6efd, #0b5ed7);
}

.dropzone .dz-preview.dz-success .dz-success-mark {
    color: #198754;
}

.dropzone .dz-preview.dz-error .dz-error-mark {
    color: #dc3545;
}

/* ===================================
   Files List Styles
   =================================== */

#uploaded-files {
    margin-top: 2rem;
}

#files-list .list-group-item {
    border-left: 4px solid #0d6efd;
    transition: all 0.3s ease;
}

#files-list .list-group-item:hover {
    background-color: #f8f9fa;
    border-left-color: #0b5ed7;
}

#files-list .list-group-item .btn-remove-file {
    transition: all 0.3s ease;
}

#files-list .list-group-item .btn-remove-file:hover {
    transform: scale(1.1);
}

/* ===================================
   Progress Indicator Styles
   =================================== */

.progress {
    border-radius: 0.5rem;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* ===================================
   Table Styles
   =================================== */

.table-responsive {
    border-radius: 0.5rem;
    overflow: hidden;
}

.table thead {
    background-color: #212529;
    color: white;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.02);
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

/* ===================================
   Form Styles
   =================================== */

.form-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.5rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-control.is-invalid:focus,
.form-select.is-invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

.invalid-feedback {
    display: block;
}

/* ===================================
   Button Styles
   =================================== */

.btn {
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn i {
    margin-right: 0.25rem;
}

.btn-lg i {
    margin-right: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

/* ===================================
   Alert Styles
   =================================== */

.alert {
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.alert-success {
    border-left-color: #198754;
}

.alert-danger {
    border-left-color: #dc3545;
}

.alert-warning {
    border-left-color: #ffc107;
}

.alert-info {
    border-left-color: #0dcaf0;
}

.alert i {
    margin-right: 0.5rem;
}

/* ===================================
   Breadcrumb Styles
   =================================== */

.breadcrumb {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.25rem;
}

.breadcrumb-item.active {
    font-weight: 600;
}

/* ===================================
   Footer Styles
   =================================== */

footer {
    margin-top: auto;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

footer .text-muted {
    color: #6c757d !important;
}

/* ===================================
   Success Page Styles
   =================================== */

.border-success {
    border: 2px solid #198754 !important;
}

.bg-success {
    background-color: #198754 !important;
}

.text-success {
    color: #198754 !important;
}

.fa-check-circle {
    animation: checkmark 0.5s ease-in-out;
}

@keyframes checkmark {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ===================================
   Responsive Styles
   =================================== */

@media (max-width: 768px) {
    .navbar-brand {
        font-size: 1rem;
    }

    .card-header h4 {
        font-size: 1.25rem;
    }

    .table {
        font-size: 0.875rem;
    }

    .btn {
        font-size: 0.875rem;
    }

    .dropzone {
        min-height: 200px;
        padding: 1rem;
    }

    #files-list .list-group-item {
        flex-direction: column;
        align-items: flex-start !important;
    }

    #files-list .list-group-item .btn-remove-file {
        margin-top: 0.5rem;
        align-self: flex-end;
    }
}

/* ===================================
   Loading Spinner
   =================================== */

.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.spinner-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}

/* ===================================
   Utility Classes
   =================================== */

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important;
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cursor-pointer {
    cursor: pointer;
}

.hover-shadow:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
    transition: box-shadow 0.3s ease;
}

/* ===================================
   Print Styles
   =================================== */

@media print {
    .navbar,
    footer,
    .btn,
    .breadcrumb {
        display: none;
    }

    .card {
        border: 1px solid #dee2e6;
        box-shadow: none;
    }
}
