/* Enhanced Merchandise Form Styles */
.form-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    min-height: 100vh;
}

.order-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.order-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
    position: relative;
}

.order-header h1 {
    margin: 0 0 8px 0;
    font-size: 2.5rem;
    font-weight: 700;
}

.order-header p {
    margin: 0 0 20px 0;
    font-size: 1.1rem;
    opacity: 0.9;
}

.order-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    margin-top: 20px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
}

.order-content {
    padding: 0;
}

/* Enhanced Tab Styles */
.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    overflow-x: auto;
    white-space: nowrap;
}

.tab {
    background: none;
    border: none;
    padding: 16px 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #6c757d;
    border-bottom: 3px solid transparent;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: fit-content;
}

.tab:hover {
    color: #495057;
    background: #e9ecef;
}

.tab.active {
    color: #007bff;
    background: white;
    border-bottom-color: #007bff;
}

.tab-badge {
    background: #dc3545;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    display: none;
}

.tab.active .tab-badge {
    background: #007bff;
}

/* Order Controls */
.order-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: white;
    border-bottom: 1px solid #e9ecef;
    gap: 20px;
    flex-wrap: wrap;
}

.search-container {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 8px 12px;
    flex: 1;
    max-width: 400px;
}

.search-container input {
    background: none;
    border: none;
    outline: none;
    flex: 1;
    padding: 4px;
    font-size: 14px;
}

.search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    padding: 4px;
}

.filter-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-container select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    font-size: 14px;
}

.refresh-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    color: #6c757d;
    transition: all 0.2s ease;
}

.refresh-btn:hover {
    background: #e9ecef;
}

/* Loading State */
.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #6c757d;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tab Content */
.tab-content {
    display: none;
    padding: 30px;
    min-height: 400px;
}

.tab-content.active {
    display: block;
}

/* Enhanced Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 1.5rem;
}

.empty-state p {
    margin: 0 0 24px 0;
    font-size: 1rem;
}

.shop-now-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.shop-now-btn:hover {
    background: #0056b3;
}

/* Enhanced Order Cards */
.order-card {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.order-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.order-card.pending {
    border-left: 4px solid #ffc107;
}

.order-card.paid {
    border-left: 4px solid #17a2b8;
}

.order-card.processing {
    border-left: 4px solid #007bff;
}

.order-card.shipped {
    border-left: 4px solid #6f42c1;
}

.order-card.delivered {
    border-left: 4px solid #28a745;
}

.order-card.cancelled {
    border-left: 4px solid #dc3545;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid #f8f9fa;
}

.order-info h4 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
}

.order-date {
    display: block;
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 8px;
}

.order-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.order-status-badge.pending {
    background: #fff3cd;
    color: #856404;
}

.order-status-badge.paid {
    background: #d1ecf1;
    color: #0c5460;
}

.order-status-badge.processing {
    background: #cce5ff;
    color: #004085;
}

.order-status-badge.shipped {
    background: #e2e3e5;
    color: #383d41;
}

.order-status-badge.delivered {
    background: #d4edda;
    color: #155724;
}

.order-status-badge.cancelled {
    background: #f8d7da;
    color: #721c24;
}

.order-total {
    font-size: 1.25rem;
    font-weight: 700;
    color: #212529;
}

/* Order Items Preview */
.order-items-preview {
    padding: 16px 24px;
}

.item-preview {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f8f9fa;
}

.item-preview:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.item-info {
    flex: 1;
}

.item-name {
    display: block;
    font-weight: 500;
    color: #212529;
    margin-bottom: 4px;
}

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

.more-items {
    font-size: 0.875rem;
    color: #007bff;
    font-style: italic;
    margin: 8px 0 0 0;
}

/* Delivery Info */
.order-delivery-info {
    padding: 16px 24px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.order-delivery-info p {
    margin: 4px 0;
    font-size: 0.875rem;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Order Actions */
.order-actions {
    padding: 20px 24px;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.btn {
    padding: 8px 16px;
    border: 1px solid;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
}

.btn-primary {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.btn-success {
    background: #28a745;
    border-color: #28a745;
    color: white;
}

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

.btn-secondary {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #545b62;
    border-color: #545b62;
}

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

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

.btn-outline {
    background: transparent;
    border-color: #6c757d;
    color: #6c757d;
}

.btn-outline:hover {
    background: #6c757d;
    color: white;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-btn:hover {
    color: #212529;
    background: #f8f9fa;
}

.modal-body {
    padding: 24px;
}

/* Order Detail Modal */
.order-detail-section {
    margin-bottom: 32px;
}

.order-detail-section:last-child {
    margin-bottom: 0;
}

.order-detail-section h4 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #212529;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.detail-item label {
    font-size: 0.875rem;
    font-weight: 500;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.detail-item span {
    font-size: 1rem;
    color: #212529;
}

.order-items-detail {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.order-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #f8f9fa;
}

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

.item-info {
    flex: 1;
}

.item-name {
    display: block;
    font-weight: 500;
    color: #212529;
    margin-bottom: 4px;
}

.item-quantity {
    display: block;
    font-size: 0.875rem;
    color: #6c757d;
}

.item-pricing {
    text-align: right;
}

.item-price {
    display: block;
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 4px;
}

.item-total {
    display: block;
    font-weight: 600;
    color: #212529;
}

.items-total {
    padding: 16px;
    background: #f8f9fa;
    text-align: right;
    font-size: 1.1rem;
}

/* Payment Modal */
.payment-info {
    margin-bottom: 24px;
}

.payment-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
}

.payment-items {
    margin: 12px 0;
}

.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

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

.payment-total {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 2px solid #dee2e6;
    font-size: 1.1rem;
}

.payment-methods h4 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.payment-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

.payment-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-option:hover {
    border-color: #007bff;
    background: #f8f9fa;
}

.payment-option input {
    display: none;
}

.payment-option input:checked + .payment-logo + span {
    color: #007bff;
    font-weight: 600;
}

.payment-option input:checked + .payment-logo {
    transform: scale(1.1);
}

.payment-option:has(input:checked) {
    border-color: #007bff;
    background: #e7f3ff;
}

.payment-logo {
    font-size: 1.5rem;
    margin-bottom: 8px;
    transition: transform 0.2s ease;
}

.payment-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Review Modal */
.review-form {
    max-width: 100%;
}

.review-item h4 {
    margin: 0 0 12px 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.review-items p {
    margin: 4px 0;
    color: #6c757d;
}

.rating-section {
    margin: 24px 0;
}

.rating-section h4 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
}

.star-rating {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
}

.star {
    font-size: 2rem;
    cursor: pointer;
    color: #e0e0e0;
    transition: color 0.2s ease;
}

.star:hover {
    color: #ffc107;
}

.review-text-section h4 {
    margin: 0 0 12px 0;
    font-size: 1rem;
    font-weight: 600;
}

.review-text-section textarea {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
}

.review-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 300px;
    animation: slideInRight 0.3s ease-out;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.info {
    background: #17a2b8;
}

.notification button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0;
    opacity: 0.8;
}

.notification button:hover {
    opacity: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-container {
        padding: 10px;
    }

    .order-header {
        padding: 20px;
    }

    .order-header h1 {
        font-size: 2rem;
    }

    .order-stats {
        flex-direction: column;
        gap: 20px;
    }

    .stat-item {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
    }

    .stat-number {
        font-size: 1.5rem;
        margin-bottom: 0;
    }

    .tabs {
        flex-wrap: wrap;
        padding: 0 10px;
    }

    .tab {
        flex: 1;
        min-width: auto;
        padding: 12px 8px;
        font-size: 12px;
    }

    .order-controls {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
        gap: 15px;
    }

    .search-container {
        max-width: none;
    }

    .filter-container {
        justify-content: space-between;
    }

    .tab-content {
        padding: 20px 15px;
    }

    .order-card {
        margin-bottom: 16px;
    }

    .order-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 16px 20px;
    }

    .order-total {
        text-align: center;
        font-size: 1.1rem;
    }

    .order-actions {
        flex-direction: column;
        padding: 16px 20px;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .order-item-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px;
    }

    .item-pricing {
        text-align: left;
        width: 100%;
    }

    .payment-options {
        grid-template-columns: repeat(2, 1fr);
    }

    .payment-actions,
    .review-actions {
        flex-direction: column;
    }

    .modal-content {
        width: 95%;
        margin: 20px 10px;
        max-height: 85vh;
    }

    .modal-header,
    .modal-body {
        padding: 20px;
    }

    .notification {
        left: 10px;
        right: 10px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .order-header h1 {
        font-size: 1.5rem;
    }

    .tab {
        padding: 10px 6px;
        font-size: 11px;
    }

    .tab span:first-child {
        display: none;
    }

    .tab::before {
        content: attr(data-tab-short);
    }

    .order-controls {
        padding: 10px;
    }

    .tab-content {
        padding: 15px 10px;
    }

    .empty-icon {
        font-size: 3rem;
    }

    .empty-state h3 {
        font-size: 1.2rem;
    }

    .order-card {
        border-radius: 8px;
    }

    .order-header {
        padding: 12px 16px;
    }

    .order-info h4 {
        font-size: 1rem;
    }

    .order-total {
        font-size: 1rem;
    }

    .item-preview {
        margin-bottom: 8px;
        padding-bottom: 8px;
    }

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

    .item-details {
        font-size: 12px;
    }

    .order-delivery-info {
        padding: 12px 16px;
    }

    .order-actions {
        padding: 12px 16px;
        gap: 8px;
    }

    .btn {
        padding: 10px 12px;
        font-size: 12px;
        min-width: 80px;
    }

    .modal-content {
        border-radius: 8px;
    }

    .payment-options {
        grid-template-columns: 1fr;
    }

    .payment-option {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
        padding: 12px;
    }

    .payment-logo {
        margin-bottom: 0;
        font-size: 1.2rem;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .form-container {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .order-container {
        background: #2d2d2d;
    }

    .order-content {
        background: #2d2d2d;
    }

    .tabs {
        background: #3a3a3a;
        border-bottom-color: #4a4a4a;
    }

    .tab {
        color: #b0b0b0;
    }

    .tab:hover {
        color: #e0e0e0;
        background: #4a4a4a;
    }

    .tab.active {
        background: #2d2d2d;
        color: #4fc3f7;
        border-bottom-color: #4fc3f7;
    }

    .order-controls {
        background: #2d2d2d;
        border-bottom-color: #4a4a4a;
    }

    .search-container {
        background: #3a3a3a;
        border-color: #4a4a4a;
    }

    .order-card {
        background: #2d2d2d;
        border-color: #4a4a4a;
    }

    .order-card:hover {
        box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    }

    .modal-content {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    .modal-header {
        border-bottom-color: #4a4a4a;
    }

    .order-delivery-info {
        background: #3a3a3a;
        border-top-color: #4a4a4a;
    }

    .payment-summary {
        background: #3a3a3a;
    }

    .payment-option {
        border-color: #4a4a4a;
        color: #e0e0e0;
    }

    .payment-option:hover {
        border-color: #4fc3f7;
        background: #3a3a3a;
    }

    .payment-option:has(input:checked) {
        border-color: #4fc3f7;
        background: #1a2a3a;
    }

    .review-text-section textarea {
        background: #3a3a3a;
        border-color: #4a4a4a;
        color: #e0e0e0;
    }
}

/* Print styles */
@media print {
    .order-controls,
    .order-actions,
    .modal-overlay {
        display: none !important;
    }

    .order-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .order-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
        margin-bottom: 20px;
    }

    .tabs {
        display: none;
    }

    .tab-content {
        display: block !important;
        padding: 20px 0;
    }
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-up {
    animation: slideUp 0.3s ease-out;
}

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

/* Accessibility improvements */
.tab:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.btn:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.search-container:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .order-card {
        border: 2px solid #000;
    }

    .btn {
        border-width: 2px;
    }

    .order-status-badge {
        border: 1px solid currentColor;
    }
}