/* Archive button container - positioned in top-right */
.archm-archive-button-container {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
    flex-shrink: 0;
}

/* Override WordPress default button styles */
.archm-archive-order-btn.button,
.archm-archive-order-btn.button:focus,
.archm-archive-order-btn.button:active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
    min-height: 0 !important;
}

/* Order header wrapper for flexbox layout */
.archm-order-header-wrapper {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100%;
    margin-bottom: 15px;
}

/* Archive Order button - Transparent style matching image */
.archm-archive-order-btn {
    background: transparent !important;
    color: #000 !important;
    border: none !important;
    text-shadow: none !important;
    font-size: 13px !important;
    height: auto !important;
    line-height: 1.5 !important;
    padding: 0 !important;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-weight: 400;
    transition: color 0.2s ease;
    white-space: nowrap;
    text-decoration: none;
}

.archm-archive-order-btn:hover {
    background: transparent !important;
    color: #2271b1 !important;
    border: none !important;
    box-shadow: none !important;
}

.archm-archive-order-btn:active {
    background: transparent !important;
    color: #135e96 !important;
    border: none !important;
    box-shadow: none !important;
}

.archm-archive-order-btn:focus {
    outline: 1px dotted #2271b1;
    outline-offset: 2px;
}

.archm-archive-order-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
    vertical-align: middle;
    margin-top: -1px;
    color: #000;
    display: inline-block;
    transition: color 0.2s ease;
}

.archm-archive-order-btn:hover .dashicons {
    color: #2271b1;
}

/* Help icon - Light grey as shown in image */
.archm-help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    cursor: help;
    color: #999 !important;
    position: relative;
    vertical-align: middle;
    transition: color 0.2s;
    flex-shrink: 0;
    margin-left: 4px;
}

.archm-help-icon .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
    color: #999;
}

.archm-help-icon:hover {
    color: #666 !important;
}

.archm-help-icon:hover .dashicons {
    color: #666;
}

/* Tooltip styles - Only for help icon */
.archm-help-icon[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e1e1e;
    color: #fff;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 1.5;
    white-space: normal;
    max-width: 350px;
    width: max-content;
    z-index: 100000;
    box-shadow: 0 3px 12px rgba(0,0,0,0.4);
    pointer-events: none;
    text-align: left;
    word-wrap: break-word;
}

.archm-help-icon[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid #1e1e1e;
    z-index: 100001;
}

/* Ensure header rows can use flexbox */
.woocommerce-order-data__header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100%;
}

/* Archive Confirmation Modal Styles */
.archm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100001;
    animation: archm-fade-in 0.2s ease-out;
}

@keyframes archm-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.archm-archive-confirm-modal {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: archm-slide-up 0.2s ease-out;
    position: relative;
    overflow: hidden;
}

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

.archm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
}

.archm-modal-title {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 20px;
    font-weight: 700;
    font-style: normal;
    line-height: 100%;
    letter-spacing: 0%;
    color: #111827;
}

.archm-modal-close {
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #787c82;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
    margin-left: 16px;
}

.archm-modal-close:hover {
    color: #1d2327;
}

.archm-modal-close:focus {
    outline: 1px solid #2271b1;
    outline-offset: 2px;
    border-radius: 2px;
}

.archm-modal-body {
    padding: 20px 24px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    font-style: normal;
    color: #111827;
    flex: 1;
    overflow-y: auto;
}

.archm-modal-footer {
    display: flex;
    justify-content: stretch;
    gap: 12px;
    padding: 16px 24px;
}

.archm-modal-btn {
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
}

.archm-modal-btn-primary {
    background-color: #f97316;
    color: #ffffff;
}

.archm-modal-btn-primary:hover {
    background-color: #ea580c;
    color: #ffffff;
}

.archm-modal-btn-secondary {
    background-color: #F1F5F9;
    color: #1d2327;
}

.archm-modal-btn-secondary:hover {
    background-color: #f6f7f7;
    color: #1d2327;
}

.archm-modal-btn-secondary:focus {
    outline: 1px solid #2271b1;
    outline-offset: 2px;
    box-shadow: 0 0 0 1px #2271b1;
}

.archm-modal-btn:active {
    transform: translateY(1px);
}

/* Responsive adjustments */
@media screen and (max-width: 782px) {
    .archm-order-header-wrapper,
    .woocommerce-order-data__header {
        flex-direction: column;
        align-items: flex-start !important;
    }
    
    .archm-archive-button-container {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
        justify-content: flex-start;
    }
    
    .archm-archive-order-btn {
        width: auto;
    }

    .archm-archive-confirm-modal {
        width: 95%;
        max-width: none;
        margin: 20px;
    }

    .archm-modal-header {
        padding: 16px 20px;
    }

    .archm-modal-body {
        padding: 16px 20px;
    }

    .archm-modal-footer {
        padding: 12px 20px;
        flex-direction: column-reverse;
    }

    .archm-modal-btn {
        width: 100%;
    }
}

