/* static/style.css */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f9;
    color: #333;
    margin: 0;
    padding: 20px;
}
.container {
    max-width: 90%;
    margin: 0 auto;
    background: #fff;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}
header {
    text-align: center;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
    padding-bottom: 10px;
}
.order-form fieldset {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 20px;
}
.order-form legend {
    font-weight: 600;
    padding: 0 10px;
    color: #0056b3;
}
.form-group, .form-group-inline {
    margin-bottom: 15px;
}
.form-group label, .form-group-inline label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}
.form-group input, .form-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.form-group-inline input, .form-group-inline select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 10px;
}
.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}
.form-actions .btn {
    flex: 1;
}
.btn {
    display: inline-block;
    width: 100%;
    padding: 12px;
    background-color: #007bff;
    color: white;
    text-align: center;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}
.btn:hover {
    background-color: #0056b3;
}
.btn-primary {
    background-color: #007bff;
}
.btn-primary:hover {
    background-color: #0056b3;
}
.btn-secondary {
    background-color: #6c757d;
}
.btn-secondary:hover {
    background-color: #545b62;
}
.btn-small {
    padding: 5px 10px;
    font-size: 11px;
    width: auto;
    margin: 1px;
    border-radius: 4px;
    font-weight: 500;
    border: 1px solid transparent;
    min-width: 60px;
    text-align: center;
    white-space: nowrap;
}
.btn-info {
    background-color: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}
.btn-info:hover {
    background-color: #e9ecef;
    color: #495057;
}
.btn-warning {
    background-color: #f8f9fa;
    color: #856404;
    border: 1px solid #ffeaa7;
}
.btn-warning:hover {
    background-color: #fff3cd;
    color: #856404;
}
.btn-success {
    background-color: #28a745;
    color: white;
}
.btn-success:hover {
    background-color: #218838;
    color: white;
}
.btn-danger {
    background-color: #dc3545;
    color: white;
}
.btn-danger:hover {
    background-color: #c82333;
    color: white;
}
.flashes {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}
.flash-success {
    padding: 15px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
}
.flash-danger {
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
}
.flash-warning {
    padding: 15px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
}
.flash-info {
    padding: 15px;
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-radius: 4px;
}
.result-container {
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.result-details p {
    font-size: 16px;
    line-height: 1.6;
}
.label-container {
    margin-top: 30px;
    text-align: center;
}
.label-container iframe {
    border: 1px solid #ccc;
}
.label-note {
    color: #6c757d;
    font-size: 14px;
    font-style: italic;
    margin-top: 10px;
}

/* Orders Table Styles */
.orders-container {
    padding: 15px;
    max-width: 100%;
    overflow-x: auto;
}
.orders-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 15px;
}
.orders-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 600;
}
.header-buttons {
    display: flex;
    gap: 8px;
}
.header-buttons .btn {
    padding: 8px 16px;
    font-size: 14px;
    white-space: nowrap;
}
.table-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 20px;
}
.orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    min-width: 1000px;
}
.orders-table th {
    background: #f7f9fc;
    padding: 12px 8px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.orders-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #f3f4f6;
    vertical-align: middle;
    line-height: 1.4;
}
.orders-table tr:hover {
    background-color: #f9fafb;
}
.orders-table tr:last-child td {
    border-bottom: none;
}
.tracking-number {
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', monospace;
    background: #f1f3f4;
    padding: 3px 6px;
    border-radius: 4px;
    font-size: 11px;
    color: #5f6368;
    font-weight: 500;
}
.tracking-link {
    color: #1a73e8;
    text-decoration: none;
    font-size: 11px;
    font-weight: 500;
}
.tracking-link:hover {
    text-decoration: underline;
}
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.status-awaiting_shipment {
    background: #fef7cd;
    color: #92400e;
    border: 1px solid #fde047;
}
.status-shipped {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}
.status-delivered {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #93c5fd;
}
.action-buttons {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    min-width: 200px;
}
.orders-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}
.orders-summary p {
    margin: 5px 0;
    color: #6c757d;
}
.no-orders {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}
.no-orders p {
    font-size: 18px;
    margin-bottom: 20px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}
.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 8px;
    width: 80%;
    max-width: 600px;
    position: relative;
}
.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}
.close:hover {
    color: #000;
}

/* Retry Label Styles */
.retry-container {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.header-buttons {
    display: flex;
    gap: 10px;
}
.order-info {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}
.order-info h3 {
    margin-top: 0;
    color: #495057;
}
.service-selection {
    margin-bottom: 30px;
}
.help-text {
    color: #6c757d;
    font-style: italic;
    margin-bottom: 20px;
}
.service-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.service-option {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}
.service-option:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}
.service-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.service-card {
    padding: 20px;
    background: white;
    border: 1px solid #dee2e6;
    text-align: center;
}
.service-card h4 {
    margin: 0 0 10px 0;
    color: #007bff;
}
.service-card p {
    margin: 0 0 15px 0;
    color: #6c757d;
    font-size: 14px;
}
.try-button {
    display: inline-block;
    padding: 8px 16px;
    background: #007bff;
    color: white;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}
.help-section {
    background: #fff3cd;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
    margin-bottom: 20px;
}
.help-section h3 {
    margin-top: 0;
    color: #856404;
}
.help-content ul {
    margin: 10px 0;
    padding-left: 20px;
}
.help-content li {
    margin-bottom: 5px;
    color: #856404;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px 20px;
    }
    .orders-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    .form-actions {
        flex-direction: column;
    }
    .orders-table {
        font-size: 14px;
    }
    .orders-table th,
    .orders-table td {
        padding: 10px 8px;
    }
    .action-buttons {
        flex-direction: column;
    }
    .service-options {
        grid-template-columns: 1fr;
    }
    .retry-container {
        padding: 15px;
    }
}

/* Edit Order Styles */
.edit-order-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.edit-order-container h2 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.order-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #007bff;
}

.form-note {
    display: block;
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-awaiting_shipment {
    background-color: #fff3cd;
    color: #856404;
}

.status-awaiting_payment {
    background-color: #f8d7da;
    color: #721c24;
}

.status-on_hold {
    background-color: #e2e3e5;
    color: #383d41;
}

.status-shipped {
    background-color: #d4edda;
    color: #155724;
}

.status-cancelled {
    background-color: #f5c6cb;
    color: #721c24;
}

/* Order Items Styles */
.item-row {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.item-fields {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr auto;
    gap: 15px;
    align-items: end;
}

.item-field {
    margin-bottom: 0;
}

.item-field label {
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
}

.item-field input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
    color: white;
}

@media (max-width: 768px) {
    .item-fields {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* Items Display in Orders Table */
.items-column {
    max-width: 200px;
    padding: 8px !important;
}

.items-summary {
    font-size: 12px;
    line-height: 1.3;
}

.item-line {
    margin-bottom: 4px;
    display: block;
}

.item-line strong {
    display: block;
    color: #2c3e50;
    font-size: 13px;
}

.item-details {
    color: #6c757d;
    font-size: 11px;
    display: block;
}

.item-more {
    color: #007bff;
    font-style: italic;
    font-size: 11px;
    margin-top: 4px;
}

.no-items {
    color: #6c757d;
    font-style: italic;
    font-size: 12px;
}

/* Checkbox styling for bill-to address copy feature */
.checkbox-group {
    margin-bottom: 20px;
    padding: 10px 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: 500;
    color: #0056b3;
    margin: 0;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 8px;
    margin-top: 2px;
    width: auto;
    transform: scale(1.1);
}

.checkbox-text {
    user-select: none;
}

/* Compact Order Table Cell Styles */
.order-number {
    font-weight: 600;
    color: #1f2937;
    font-size: 13px;
}

.order-key {
    color: #6b7280;
    font-size: 10px;
    font-family: monospace;
    margin-top: 2px;
}

/* Make action buttons more compact */
.action-buttons .btn-small {
    padding: 4px 8px;
    font-size: 10px;
    margin: 1px;
    min-width: 50px;
}

/* Compact date and email columns */
.orders-table td:nth-child(2),
.orders-table td:nth-child(3) {
    font-size: 13px;
    color: #4b5563;
}

/* Service column styling */
.orders-table td:nth-child(5) {
    font-size: 12px;
    color: #6b7280;
}
