/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header styles */
header {
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px 0;
    margin-bottom: 30px;
}

header h1 {
    color: #3498db;
    margin-bottom: 10px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav li {
    margin-right: 20px;
}

nav a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    transition: color 0.3s;
}

nav a:hover, nav a.active {
    color: #3498db;
}

/* Main content styles */
main {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-bar {
    display: flex;
    flex: 1;
    max-width: 400px;
}

.search-bar input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
    font-size: 14px;
}

.search-bar button {
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-bar button:hover {
    background-color: #2980b9;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.button {
    display: inline-block;
    padding: 10px 15px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
}

.button:hover {
    background-color: #2980b9;
}

.button-secondary {
    background-color: #95a5a6;
}

.button-secondary:hover {
    background-color: #7f8c8d;
}

.button-small {
    padding: 5px 10px;
    font-size: 12px;
}

.button-danger {
    background-color: #e74c3c;
}

.button-danger:hover {
    background-color: #c0392b;
}

/* Product list styles */
.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    min-height: 400px;
}

.product-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    background-color: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.1);
}

.product-image {
    height: 200px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info {
    padding: 15px;
}

.product-info h3 {
    margin-bottom: 8px;
    font-size: 16px;
    color: #333;
}

.product-info p {
    color: #666;
    font-size: 14px;
    margin-bottom: 3px;
}

.product-status {
    margin-top: 8px;
}

/* Form styles */
form h2 {
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="password"],
.form-group input[type="email"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.moq-surcharge-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.moq-surcharge-container input[type="number"] {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.moq-surcharge-container span {
    font-size: 14px;
    color: #666;
}

.form-group input[type="file"] {
    padding: 5px 0;
    font-size: 14px;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

#typeToggle:checked + .slider {
    background-color: #2ecc71;
}

#typeToggle + .slider {
    background-color: #3498db;
}

input:focus + .slider {
    box-shadow: 0 0 1px #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Price tiers section */
.price-tiers-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.price-tiers-section h3 {
    margin-bottom: 10px;
}

.helper-text {
    font-size: 12px;
    color: #777;
    margin-bottom: 15px;
    display: block;
}

.price-tiers {
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.tier-header {
    background-color: #f9f9f9;
    display: flex;
    padding: 10px 15px;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
}

.tier-row {
    display: flex;
    border-bottom: 1px solid #ddd;
    padding: 10px 15px;
}

.tier-cell {
    flex: 1;
    padding-right: 10px;
}

.tier-cell input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.tier-actions {
    flex: 0 0 100px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.add-tier-button {
    margin-top: 10px;
    text-align: right;
}

/* Table styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

table th,
table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background-color: #f9f9f9;
    font-weight: 600;
}

table tbody tr:hover {
    background-color: #f5f5f5;
}

table .quantity-input {
    width: 70px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Status indicators */
.status {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    color: white;
}

.status-completed {
    background-color: #2ecc71;
}

.status-pending {
    background-color: #f39c12;
}

.status-processing {
    background-color: #3498db;
}

.status-produced {
    background-color: #27ae60;
}

.status-non-produced {
    background-color: #e74c3c;
}

.status-bulk-produce {
    background-color: #9b59b6;
}

.status-sample-produce {
    background-color: #f1c40f;
}

.status-ink {
    background-color: #3498db;
}

.status-silicon {
    background-color: #e67e22;
}

.status-small {
    font-size: 11px;
    padding: 2px 6px;
}

.text-right {
    text-align: right;
}

.order-total-row {
    font-weight: bold;
    background-color: #f9f9f9;
}

.order-subtotal-row,
.order-moq-surcharge-row {
    background-color: #f9f9f9;
    font-style: italic;
}

.product-header {
    margin-bottom: 20px;
}

.product-content {
    display: flex;
    gap: 30px;
}

.product-image-large {
    flex: 0 0 300px;
    height: 300px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    overflow: hidden;
}

.product-image-large img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-info-detailed {
    flex: 1;
}

.product-info-detailed p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.price-tiers-table {
    margin-top: 30px;
}

.price-tiers-table h3 {
    margin-bottom: 15px;
    color: #333;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}

.price-tiers-table table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.price-tiers-table th,
.price-tiers-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.price-tiers-table th {
    background-color: #f9f9f9;
    font-weight: 600;
}

.price-tiers-table tr:hover {
    background-color: #f5f5f5;
}

.product-results {
    margin: 15px 0;
}

.product-item {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.product-item:hover {
    background-color: #f5f5f5;
}

.selected-products {
    margin-top: 20px;
}

.order-header {
    margin-bottom: 20px;
}

.order-items {
    margin-bottom: 30px;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #777;
    font-style: italic;
}

.error {
    color: #e74c3c;
    margin-top: 5px;
    font-size: 13px;
}

/* Alert styles */
.alert {
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* User menu styles */
.user-menu {
    margin-left: auto;
    display: flex;
    gap: 15px;
}

/* Footer styles */
footer {
    text-align: center;
    padding: 20px 0;
    color: #777;
    font-size: 14px;
}

/* Login page */
.login-container {
    max-width: 400px;
    margin: 50px auto;
    padding: 30px;
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.login-container h2 {
    text-align: center;
    margin-bottom: 25px;
    color: #3498db;
}

/* Print styles */
@media print {
    header, 
    footer,
    .action-buttons,
    .controls,
    form {
        display: none;
    }
    
    body, main {
        background: white;
        padding: 0;
        margin: 0;
    }
    
    .container {
        width: 100%;
        max-width: none;
        padding: 0;
        margin: 0;
    }
    
    .print-header {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .print-header h2 {
        font-size: 24px;
        margin-bottom: 5px;
    }
    
    .order-header {
        margin-bottom: 20px;
    }
    
    .order-header h3 {
        font-size: 18px;
        margin-bottom: 5px;
    }
    
    .order-items h4 {
        font-size: 16px;
        margin: 15px 0 10px;
    }
    
    .order-subtotal-row,
    .order-moq-surcharge-row {
        background-color: transparent !important;
        font-style: italic;
        border-top: 1px solid #ddd;
    }
    
    .order-total-row {
        font-weight: bold;
        border-top: 2px solid #ddd;
    }
}

/* Responsive styles */
@media (max-width: 1200px) {
    .product-list {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
}

@media (max-width: 992px) {
    .product-list {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .search-bar {
        max-width: 100%;
        margin-bottom: 10px;
    }
    
    .product-list {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .product-content {
        flex-direction: column;
    }
    
    .product-image-large {
        width: 100%;
        flex: 0 0 auto;
    }
    
    .tier-row, 
    .tier-header {
        flex-wrap: wrap;
    }
    
    .tier-cell {
        flex: 0 0 100%;
        margin-bottom: 5px;
    }
    
    .pagination {
        padding: 10px 0;
    }
    
    .pagination-number {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
}

@media (max-width: 576px) {
    .product-list {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .product-info h3 {
        font-size: 14px;
    }
    
    .product-info p {
        font-size: 12px;
    }
    
    .status-small {
        font-size: 10px;
        padding: 1px 4px;
    }
}

/* Search container styles */
#product-search-container {
    position: relative;
    display: flex;
    width: 100%;
}

#product-search {
    flex: 1;
    padding: 10px 35px 10px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
}

/* Loading indicator styles */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.loading:before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    margin-right: 10px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Search results styles */
#search-results-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
    margin-top: 10px;
}

.search-results-header {
    background-color: #f5f5f5;
    padding: 8px 12px;
    font-size: 14px;
    color: #555;
    border-bottom: 1px solid #eee;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.4);
}

.modal-content {
    position: relative;
    background-color: #fefefe;
    margin: 10% auto;
    padding: 0;
    border: 1px solid #888;
    width: 50%;
    max-width: 500px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
    border-radius: 5px;
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from {opacity: 0; transform: translateY(-20px);}
    to {opacity: 1; transform: translateY(0);}
}

.modal-header {
    padding: 15px;
    background-color: #f8f8f8;
    border-bottom: 1px solid #ddd;
    border-radius: 5px 5px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.modal-body {
    padding: 20px;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: #333;
    text-decoration: none;
}

@media (max-width: 768px) {
    .modal-content {
        width: 90%;
    }
}

/* Turnstile styles */
.turnstile-widget {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}

.cf-turnstile {
    margin: 0 auto;
}

/* Pagination styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 30px;
    padding: 15px 0;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
    margin: 0 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-btn:hover {
    background-color: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.pagination-btn i {
    margin: 0 5px;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 10px;
}

.pagination-number {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    background-color: #f8f8f8;
    color: #555;
    text-decoration: none;
    border-radius: 4px;
    transition: all 0.3s;
    font-weight: 500;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
}

.pagination-number:hover {
    background-color: #e9e9e9;
    transform: translateY(-2px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.pagination-number.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}

.pagination-ellipsis {
    color: #999;
    margin: 0 2px;
    font-weight: bold;
}

@media (max-width: 768px) {
    .pagination {
        flex-direction: column;
        gap: 15px;
    }
    
    .pagination-numbers {
        order: 1;
        margin: 10px 0;
    }
    
    .pagination-btn {
        width: 100%;
        justify-content: center;
        margin: 0;
    }
}

/* Page info for pagination */
.page-info {
    text-align: center;
    color: #777;
    font-size: 14px;
    margin-bottom: 10px;
    padding: 5px 0;
} 