/* Main Styles for The Leaflet Maker Artwork System */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fc;
    color: #333;
    line-height: 1.6;
}

/* Header & Navigation */
.navbar {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.navbar-brand img {
    max-height: 40px;
}

.step {
    display: none;
}

.step.active {
    display: block;
}

.progress-container {
    margin-top: 20px;
    display: none;
}

/* Cards */
.card {
    border: none;
    box-shadow: 0 0.15rem 0.5rem 0 rgba(50, 50, 50, 0.15);
    margin-bottom: 24px;
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    font-weight: 600;
}

/* Forms */
.form-control:focus {
    border-color: #4e73df;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.btn-primary {
    background-color: #4e73df;
    border-color: #4e73df;
}

.btn-primary:hover {
    background-color: #2e59d9;
    border-color: #2653d4;
}

.btn-success {
    background-color: #1cc88a;
    border-color: #1cc88a;
}

.btn-success:hover {
    background-color: #17a673;
    border-color: #169b6b;
}

.btn-danger {
    background-color: #e74a3b;
    border-color: #e74a3b;
}

.btn-danger:hover {
    background-color: #e02d1b;
    border-color: #d52a1a;
}

label {
    font-weight: 500;
}

.required:after {
    content: " *";
    color: red;
}

/* Enhanced Button Styles */
.btn {
    font-weight: 500;
    border-radius: 0.35rem;
    padding: 0.5rem 1rem;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    letter-spacing: 0.01em;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Primary Button (Upload) */
.btn-primary {
    background: linear-gradient(to bottom, #5a80e6, #4e73df);
    border-color: #4668c5;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    background: linear-gradient(to bottom, #4e73df, #3a64d8);
    border-color: #3a5fc0;
    box-shadow: 0 4px 8px rgba(78, 115, 223, 0.3);
}

.btn-primary:active {
    background: #3a64d8;
}

/* Success Button (Approve) */
.btn-success {
    background: linear-gradient(to bottom, #24d394, #1cc88a);
    border-color: #18b07a;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.btn-success:hover {
    background: linear-gradient(to bottom, #1cc88a, #17a673);
    border-color: #149b6a;
    box-shadow: 0 4px 8px rgba(28, 200, 138, 0.3);
}

.btn-success:active {
    background: #17a673;
}

/* Danger Button (Delete) */
.btn-danger {
    background: linear-gradient(to bottom, #e95c4e, #e74a3b);
    border-color: #d44235;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.btn-danger:hover {
    background: linear-gradient(to bottom, #e74a3b, #e02d1b);
    border-color: #c92a19;
    box-shadow: 0 4px 8px rgba(231, 74, 59, 0.3);
}

.btn-danger:active {
    background: #e02d1b;
}

/* Button with icons */
.btn i {
    font-size: 0.9rem;
}

/* Button group styling */
.btn-group {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 0.35rem;
    overflow: hidden;
}

.btn-group .btn {
    box-shadow: none;
    border-radius: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 0.35rem;
    border-bottom-left-radius: 0.35rem;
}

.btn-group .btn:last-child {
    border-top-right-radius: 0.35rem;
    border-bottom-right-radius: 0.35rem;
}

/* Full-width button styles */
.btn-full-width {
    width: 100%;
    justify-content: center;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
}

/* Full-width button group */
.btn-group-full-width {
    display: flex;
    width: 100%;
}

.btn-group-full-width .btn {
    flex: 1;
    white-space: nowrap;
}

/* Responsive button text */
@media (max-width: 576px) {
    .btn-group-full-width .btn {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* Alerts */
.alert {
    border: none;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 0.5rem 0 rgba(50, 50, 50, 0.15);
}

.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
}

.alert-danger {
    color: #842029;
    background-color: #f8d7da;
}

.alert-warning {
    color: #664d03;
    background-color: #fff3cd;
}

.alert-info {
    color: #055160;
    background-color: #cff4fc;
}

/* Upload Process Steps */
.nav-pills .nav-link {
    border-radius: 0.35rem;
    padding: 0.75rem 1rem;
    font-weight: 500;
}

.nav-pills .nav-link.active {
    background-color: #4e73df;
}

.nav-pills .nav-link.bg-success {
    background-color: #1cc88a !important;
}

/* Upload Box */
.upload-box {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px dashed #ddd;
    padding: 20px 10px 10px 10px;
}

.upload-box:hover {
    border-color: #aaa;
}

.upload-box i {
    font-size: 48px;
    color: #aaa;
    margin-bottom: 15px;
}

.upload-box h5 {
    color: #4e73df;
    margin-bottom: 10px;
}

.upload-box p {
    color: #858796;
}

/* File List */
.file-list {
    margin-top: 15px;
    margin-bottom: 10px;
}

.file-list .btn-remove-file {
    color: #e74a3b; /* Red color */
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    text-decoration: none;
    outline: none;
}

.file-list .btn-remove-file:hover {
    color: #d52a1a;
    text-decoration: none;
    background: none;
    border: none;
    box-shadow: none;
}

.file-list .btn-remove-file:focus,
.file-list .btn-remove-file:active {
    outline: none;
    text-decoration: none;
    box-shadow: none;
    background: none;
    border: none;
}

.file-list .btn-remove-file i {
    font-size: 1rem;
}

.file-list .list-group-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-width: 1px !important;
    margin-top: -1px;
}

.file-info-container {
    flex-grow: 1;
    text-align: left;
    padding-right: 20px;
    min-width: 0; /* Important for text overflow to work */
    overflow: hidden;
}

/* Desktop view */
.filename-desktop {
    display: inline;
}

.filesize-desktop {
    display: inline;
}

/* Mobile view */
.filename-mobile {
    display: none;
}

.filesize-mobile {
    display: none;
}

/* Progress Bar */
.progress {
    height: 20px;
    border-radius: 5px;
    margin-bottom: 10px;
}

.progress-bar {
    background-color: #4e73df;
}

@keyframes progressPulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.progress-bar-pulse {
    animation: progressPulse 2s infinite;
}

/* Proof Viewer */
.proof-viewer {
    width: 100%;
    height: 500px;
    border: 1px solid #ddd;
    margin-bottom: 15px;
    border-radius: 5px;
}

.proof-container {
    margin-bottom: 30px;
    border: 1px solid #ddd;
    padding: 15px;
    border-radius: 5px;
    background-color: #fff;
}

.proof-container h4 {
    margin-top: 0;
    color: #4e73df;
    border-bottom: 1px solid #e3e6f0;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Product Details */
.product-details {
    height: 100%;
    font-size: 0.85rem;
    color: #666;
    background-color: #f9f9f9;
    padding: 0.75rem 2rem;
    border-radius: 0.25rem;
}

/* Product Details Table Styling */
.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table td {
    padding: 3px 0;
    vertical-align: top;
    line-height: 1.2;
}

.specs-table td:first-child {
    width: 45%;
    padding-right: 10px;
}

.specs-table td:last-child {
    width: 55%;
}

/* Product Accordion Card Headers */
#productsAccordion .card-header {
    background: linear-gradient(to right, #f8f9fc, #eef1f8);
    padding: 0;
}

#productsAccordion .card-header button {
    width: 100%;
    text-align: left;
    padding: 15px;
    color: #333;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    transition: all 0.2s ease;
    
    /* Prevent button press effect */
    border: none;
    outline: none;
    box-shadow: none !important;
    transform: none !important;
    margin: 0;
}

#productsAccordion .card-header button:hover {
    background-color: rgba(78, 115, 223, 0.05);
    text-decoration: none;
}

#productsAccordion .card-header button:active,
#productsAccordion .card-header button:focus {
    outline: none;
    box-shadow: none !important;
    transform: none !important;
    border: none;
    margin: 0;
    padding: 15px; /* Keep padding consistent */
}

#productsAccordion .card-header button h4 {
    margin: 0;
    font-size: 1.5rem;
    display: inline-block;
    color: #2e3a59;
    line-height: 1.2;
}

#productsAccordion .card-header .badge {
    margin-left: 20px !important;
    margin-right: 20px !important;
    padding: 5px 10px;
    font-weight: 500;
    border-radius: 20px;
    position: relative;
    top: 2px;
}

#productsAccordion .card-header .badge-success {
    background-color: #1cc88a;
    color: white;
}

#productsAccordion .card-header .badge-warning {
    background-color: #f6c23e;
    color: #212529;
}

#productsAccordion .card-header .badge-secondary {
    background-color: #858796;
    color: white;
}

#productsAccordion .card-header button::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

#productsAccordion .card-header button.collapsed::after {
    transform: translateY(-50%) rotate(-90deg);
}

/* Ensure consistent padding on hover/focus/active states */
#productsAccordion .card-header button:hover,
#productsAccordion .card-header button.collapsed:hover,
#productsAccordion .card-header button:active,
#productsAccordion .card-header button.collapsed:active {
    padding: 15px;
    margin: 0;
}

/* Upload form processing styles */
.artwork-upload-form.processing {
    position: relative;
}

.form-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.7);
    z-index: 10;
    cursor: not-allowed;
}

.processing-message {
    font-weight: bold;
    color: #007bff;
}

button:disabled,
input:disabled,
.btn-remove-file[disabled],
.upload-box.disabled {
    cursor: not-allowed !important;
}

/* Footer */
.card-footer {
    background-color: #f8f9fc;
    border-top: 1px solid #e3e6f0;
}

/* Overlay Styles */
.overlay-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.overlay-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s ease-out;
}

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

.overlay-header {
    padding: 15px 20px;
    border-bottom: 1px solid #e3e6f0;
    background-color: #f8f9fc;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.overlay-header h4 {
    margin: 0;
    color: #2e3a59;
}

.overlay-body {
    padding: 20px;
    overflow-y: auto;
    max-height: 60vh;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
}

/* Style lists inside overlays */
.overlay-body ul {
    padding-left: 20px;
    margin-bottom: 15px;
}

.overlay-body li {
    margin-bottom: 10px;
    position: relative;
}

.overlay-body p {
    margin-bottom: 15px;
}

.overlay-body strong {
    color: #2e3a59;
}

.overlay-footer {
    padding: 15px 20px;
    border-top: 1px solid #e3e6f0;
    display: flex;
    justify-content: flex-end;
    background-color: #f8f9fc;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.responsive-footer {
    font-size: clamp(0.6rem, 2.5vw, 1rem);
    white-space: nowrap;
}

.responsive-text {
    white-space: nowrap;
    font-size: 1rem;
}

@media (max-width: 1198px) {
    .responsive-text {
        font-size: 0.85rem;
    }
}

@media (max-width: 990px) {
    .responsive-text {
        font-size: 0.65rem;
    }
}

media (max-width: 767px) {
    .responsive-text {
        font-size: 0.75rem;
    }
}

@media (max-width: 575px) {
    .responsive-text {
        font-size: 0.65rem;
    }
}

@media (max-width: 400px) {
    .responsive-text {
        font-size: 0.6rem;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .overlay-content {
        width: 95%;
        max-height: 80vh;
    }
    
    .overlay-header, .overlay-body, .overlay-footer {
        padding: 12px 15px;
    }
    
    /* Make text inside overlays responsive for mobile */
    .overlay-body {
        font-size: 13px;
    }
    
    .overlay-body ul {
        padding-left: 12px;
    }
    
    .overlay-body li {
        margin-bottom: 6px;
    }
    
    /* Increase container width on mobile */
    .container {
        padding-left: 10px;
        padding-right: 10px;
        max-width: 100%;
    }
    
    /* Reduce card padding */
    .card-body {
        padding: 0.75rem;
    }
    
    /* Reduce margins between elements */
    .mb-3, .mb-4 {
        margin-bottom: 0.75rem !important;
    }
    
    /* Make product details more compact */
    .product-details {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    /* Adjust upload box padding */
    .upload-box {
        padding: 15px 5px 5px 5px;
    }
    
    .upload-box i {
        font-size: 36px;
        margin-bottom: 10px;
    }
    
    /* Adjust button padding */
    .btn {
        padding: 0.4rem 0.75rem;
    }
    
    /* Reduce font sizes */
    h4 {
        font-size: 1.25rem;
    }
    
    h5 {
        font-size: 1.1rem;
    }
    
    /* Ensure text doesn't overflow */
    .card-header button h4 {
        font-size: 1.1rem;
        max-width: 80%;
        white-space: normal;
        word-break: break-word;
    }
    
    #productsAccordion .card-header button h4 {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .nav-pills .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .proof-viewer {
        height: 300px;
    }
    
    /* Simplify card appearance */
    .card {
        box-shadow: none;
        border: none;
    }
    
    #productsAccordion .card-header button h4 {
        font-size: 1.2rem;
    }
    
    /* Hide desktop format on mobile */
    .filename-desktop, .filesize-desktop {
        display: none;
    }
    
    /* Show mobile format on mobile */
    .filename-mobile {
        display: block;
        font-size: 0.85rem;
        line-height: 1.5;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .filesize-mobile {
        display: block;
        font-size: 0.75rem;
        color: #6c757d;
    }
    
    /* Grid layout for mobile */
    .file-list .list-group-item {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-gap: 8px;
        align-items: center;
        padding: 8px 12px;
    }
    
    /* Drag handle */
    .file-list .drag-handle {
        grid-column: 1;
        padding: 10px 5px;
    }
    
    /* File info container */
    .file-list .file-info-container {
        grid-column: 2;
        min-width: 0; /* Important for text overflow to work */
        overflow: hidden;
    }
    
    /* Delete button */
    .file-list .btn-remove-file {
        grid-column: 3;
        padding: 8px;
        margin: -8px -5px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Enhanced mobile drag handle */
    .touch-handle {
        padding: 15px 10px !important;
        margin: -10px 0 -10px -10px !important;
    }
    
    .ui-sortable-helper {
        background-color: #f8f9fa;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    }
    
    /* Make text inside overlays responsive for mobile */
    .overlay-body {
        font-size: 14px;
    }
    
    .overlay-body ul {
        padding-left: 15px;
    }
    
    .overlay-body li {
        margin-bottom: 8px;
    }
}

@media (max-width: 980px) {
    /* Stack buttons in step 3 on mobile */
    /* Convert button group to vertical stack */
    .proof-container .btn-group-full-width {
        flex-direction: column;
        width: 100%;
    }
    
    /* Style each button in the stack */
    .proof-container .btn-group-full-width .btn {
        width: 100%;
        margin-right: 0;
        margin-left: 0;
        border-radius: 0.35rem !important; /* Override the button group border radius */
        margin-bottom: 10px; /* Add space between buttons */
        
        /* Handle text overflow */
        white-space: normal; /* Allow text to wrap */
        line-height: 1.3; /* Tighter line height for wrapped text */
        padding: 10px 15px; /* Ensure enough padding for wrapped text */
        text-align: center; /* Center text for better appearance */
        word-wrap: break-word; /* Allow long words to break */
    }
    
    /* Adjust text size based on screen width */
    .proof-container .btn-group-full-width .btn {
        font-size: 0.95rem; /* Slightly smaller font size */
    }
    
    /* Even smaller text on very narrow screens */
    @media (max-width: 576px) {
        .proof-container .btn-group-full-width .btn {
            font-size: 0.85rem;
        }
    }
    
    /* Adjust icon size and spacing */
    .proof-container .btn-group-full-width .btn i {
        font-size: 0.9rem;
        margin-right: 5px; /* Reduce space between icon and text */
    }
    
    /* Remove margin from last button */
    .proof-container .btn-group-full-width .btn:last-child {
        margin-bottom: 0;
    }
    
    /* Fix border radius for all buttons in the group */
    .proof-container .btn-group-full-width .btn:first-child {
        border-bottom-left-radius: 0.35rem !important;
        border-bottom-right-radius: 0.35rem !important;
    }
    
    .proof-container .btn-group-full-width .btn:last-child {
        border-top-left-radius: 0.35rem !important;
        border-top-right-radius: 0.35rem !important;
    }
    
    /* Remove button group styling that might interfere */
    .proof-container .btn-group {
        display: flex;
        flex-direction: column;
        box-shadow: none;
    }
}

