﻿/* Table styling */
.styled-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: #fff;
    border-radius: 8px;
    padding: 20px 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

thead {
    background-color: #bababa;
}

    .styled-table th,
    .styled-table td {
        padding: 10px 12px;
        text-align: left;
        border-bottom: 1px solid #eee;
    }

    .styled-table th {
        background: #fafafa;
        font-weight: 600;
        color: #222;
    }

a.add-btn,
a.btn-view,
a.btn-edit,
a.btn-delete {
    text-decoration: none;
    color: white;
    cursor: pointer;
    display: inline-block;
    text-align: center;
    border: none;
    font-family: inherit;
    font-size: inherit;
}

.btn-view,
.btn-delete,
.add-btn {
    padding: 5px 12px;
    border-radius: 4px;
    border: none;
    text-decoration: none;
    color: white;
    font-weight: 500;
    margin-right: 5px;
    display: inline-block;
    cursor: pointer;
    transition: 0.2s;
    /* Add these to ensure consistent appearance */
    line-height: normal;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.btn-view,
.btn-delete {
    padding: 5px 12px;
    border-radius: 4px;
    border: none;
    text-decoration: none;
    color: white;
    font-weight: 500;
    margin-right: 5px;
    display: inline-block;
}

.btn-view {
    background: #2FA4E7;
}

    .btn-view:hover {
        text-decoration: none;
        background: #1867c0;
    }

.btn-edit {
    background: #2FA4E7;
}

    .btn-edit:hover {
        background: #0369a1;
    }

.btn-delete {
    background: #ea580c;
}

    .btn-delete:hover {
        background: #c54b0a;
        text-decoration: none;
    }


/* Header styling */
.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    background: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

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

    .title h2 {
        font-weight: 700;
        margin: 0;
    }

    .title i {
        font-size: 22px;
    }

.add-btn {
    background-color: #2FA4E7;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.2s;
    text-decoration: none;
}

    .add-btn:hover {
        background-color: #1867c0;
        text-decoration: none;
        color: white;
    }


/* Confirmation Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-box {
    background: #fff;
    padding: 20px 25px;
    border-radius: 8px;
    width: 780px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    text-align: center;
}

    .modal-box h3 {
        margin-top: 0;
        color: #ea580c;
    }

.modal-actions {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.btn-confirm {
    background: #ea580c;
    border: none;
    padding: 6px 15px;
    border-radius: 5px;
    color: white;
    font-weight: 600;
    cursor: pointer;
}

    .btn-confirm:hover {
        background: #c54b0a;
    }

.btn-cancel {
    background: #e5e7eb;
    border: none;
    padding: 6px 15px;
    border-radius: 5px;
    cursor: pointer;
}

    .btn-cancel:hover {
        background: #d1d5db;
    }


/* Manufacturer Accordion Styles */
.group-accordion {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.group-item {
    border-bottom: 1px solid #e0e0e0;
}

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

.group-header {
    background: #f8f9fa;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.3s ease;
    border: none;
    width: 100%;
    text-align: left;
}

    .group-header:hover {
        background: #e9ecef;
    }

.group-title {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.group-name {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.model-count {
    background: #2FA4E7;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    min-width: 70px;
    text-align: center;
}

.group-arrow {
    color: #666;
    transition: transform 0.3s ease;
    font-size: 14px;
}

.group-content {
    background: white;
    padding: 0;
    transition: all 0.3s ease;
    overflow: hidden;
}

    .group-content .styled-table {
        margin: 0;
        border: none;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }

        .group-content .styled-table thead {
            background: #f1f3f4;
        }

        .group-content .styled-table th {
            border-top: none;
            font-weight: 600;
            color: #555;
            background: #f1f3f4;
        }

        .group-content .styled-table tbody tr:last-child td {
            border-bottom: none;
        }

/* Model link styling */
.model-link {
    color: #2FA4E7;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

    .model-link:hover {
        color: #1867c0;
        text-decoration: underline;
    }

/* Alert styling for empty state */
.alert.alert-warning.empty-alert {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px 20px;
    border-radius: 8px;
    margin: 20px 0;
}

/* Breadcrumb styling */
.breadcrumb {
    background: #f8f9fa !important;
    padding: 10px 15px !important;
    border-radius: 5px !important;
    margin-bottom: 15px !important;
    border: 1px solid #e9ecef;
}

/* Responsive Design for Manufacturer Accordion */
@media (max-width: 768px) {
    .group-header {
        padding: 12px 15px;
    }

    .group-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .group-name {
        font-size: 14px;
    }

    .model-count {
        font-size: 11px;
        min-width: 60px;
        padding: 3px 8px;
    }

    .group-content .styled-table {
        font-size: 14px;
    }

        .group-content .styled-table th,
        .group-content .styled-table td {
            padding: 8px 10px;
        }
}

/* Animation for smooth expand/collapse */
.group-content {
    animation: fadeIn 0.3s ease-in-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card View Styles */
.view-toggle {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
}

.view-toggle-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

    .view-toggle-btn.active {
        background: #2FA4E7;
        color: white;
        border-color: #2FA4E7;
    }

    .view-toggle-btn:hover {
        border-color: #2FA4E7;
    }

.view-container {
    transition: all 0.3s ease;
}

/* Cards Container */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.manufacturer-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.card-header {
    background: linear-gradient(135deg, #2FA4E7, #1867c0);
    color: white;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

    .card-header i {
        font-size: 24px;
    }

.card-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    flex: 1;
}

.card-badge {
    background: rgba(255,255,255,0.2);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.card-content {
    padding: 0;
}

.model-section {
    border-bottom: 1px solid #f1f3f4;
}

    .model-section:last-child {
        border-bottom: none;
    }

.model-header {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    border-left: 4px solid #2FA4E7;
}

    .model-header i {
        color: #2FA4E7;
        font-size: 16px;
    }

.model-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.frame-count {
    background: #e9ecef;
    color: #666;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.frames-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
    padding: 20px;
}

.frame-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.frame-link {
    text-decoration: none;
    flex: 1;
}

.frame-name {
    font-size: 16px;
    font-weight: 600;
    color: #2FA4E7;
    margin: 0;
    transition: color 0.2s;
}

.frame-card:hover .frame-name {
    color: #1867c0;
}

.frame-actions {
    display: flex;
    gap: 8px;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 4px;
}

/* Accordion Level Styles */
.manufacturer-level .group-header {
    background: linear-gradient(135deg, #2FA4E7, #1867c0);
    color: white;
}

.manufacturer-level .group-name {
    color: white;
    font-size: 18px;
}

.manufacturer-level .model-count {
    background: rgba(255,255,255,0.2);
    color: white;
}

.model-level .group-header {
    background: #f8f9fa;
    border-left: 4px solid #2FA4E7;
}

.model-level .group-name {
    color: #333;
    font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .frames-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 15px;
    }

    .card-header {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .card-title {
        font-size: 18px;
    }

    .model-header {
        padding: 12px 15px;
    }

    .frame-card {
        padding: 12px;
    }

    .view-toggle {
        flex-direction: column;
    }
}



/* Nested Accordion Styles for Engine Grouping */
.manufacturer-level .group-header {
    background: linear-gradient(135deg, #2FA4E7, #1867c0);
    color: white;
    padding: 15px 20px;
}

.manufacturer-level .group-name {
    color: white;
    font-size: 18px;
}

.manufacturer-level .model-count {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
}

.model-level {
    margin: 0 15px 10px 15px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

    .model-level .group-header {
        background: #f8f9fa;
        padding: 12px 15px;
        border-left: 4px solid #2FA4E7;
    }

    .model-level .group-name {
        color: #333;
        font-size: 16px;
    }

    .model-level .model-count {
        background: #2FA4E7;
        color: white;
    }

    .model-level .group-content {
        background: white;
    }

/* Ensure proper nesting and spacing */
.manufacturer-level .group-content {
    padding: 15px 0;
    background: #f8f9fa;
}

.model-level .group-content {
    padding: 0;
}

/* Table adjustments for nested structure */
.model-level .styled-table {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
}

    .model-level .styled-table thead {
        background: #e9ecef;
    }

        .model-level .styled-table thead th {
            border-bottom: 1px solid #dee2e6;
            font-weight: 600;
            color: #495057;
            background: #f1f3f4;
        }

/* No engines message styling */
.no-engines-message {
    padding: 20px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
    background: white;
    margin: 0;
}

/* Smooth transitions for accordion */
.group-content {
    transition: max-height 0.3s ease-out;
    overflow: hidden;
}

.group-arrow {
    transition: transform 0.3s ease;
}

/* Ensure buttons maintain consistent appearance */
.model-level .btn-view,
.model-level .btn-delete {
    padding: 5px 12px;
    border-radius: 4px;
    border: none;
    text-decoration: none;
    color: white;
    font-weight: 500;
    margin-right: 5px;
    display: inline-block;
    cursor: pointer;
    line-height: normal;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* Responsive adjustments for nested accordion */
@media (max-width: 768px) {
    .model-level {
        margin: 0 10px 8px 10px;
    }

    .manufacturer-level .group-header {
        padding: 12px 15px;
    }

    .model-level .group-header {
        padding: 10px 12px;
    }

    .group-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .manufacturer-level .group-name {
        font-size: 16px;
    }

    .model-level .group-name {
        font-size: 14px;
    }

    .model-count {
        font-size: 11px;
        min-width: 60px;
        padding: 3px 8px;
    }
}


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

.modal-box {
    background: white;
    border-radius: 8px;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

    .modal-header h3 {
        margin: 0;
        flex: 1;
    }

.close-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.modal-body {
    padding: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 20px;
    border-top: 1px solid #eee;
}

/* Item Details Styles */
.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

    .detail-row label {
        font-weight: bold;
        color: #666;
    }

.price-highlight {
    color: #f16929;
    font-weight: bold;
    font-size: 1.1em;
}

.quantity-selector {
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
}

    .quantity-selector label {
        display: block;
        margin-bottom: 10px;
        font-weight: bold;
    }

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

.qty-btn {
    background: #f16929;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.qty-input {
    width: 60px;
    text-align: center;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Button Styles */
.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.btn-confirm {
    background: #f16929;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

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

.btn-confirm:hover {
    background: #e55a1a;
}

/* Checkout & Cart Action Buttons (Global) */
.btn-primary {
    background: #2FA4E7;
    color: white;
    padding: 12px 18px;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: inline-block;
    transition: 0.2s;
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
}

    .btn-primary:hover {
        background: #1867c0;
        color: white;
        text-decoration: none;
    }

/* Orange Buttons */
.btn-orange {
    background: #ea580c;
    color: white;
    padding: 12px 18px;
    border-radius: 6px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    display: inline-block;
    transition: 0.2s;
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
}

    .btn-orange:hover {
        background: #c54b0a;
        color: white;
        text-decoration: none;
    }

/* Button Container for nice alignment */
.button-stack {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
