/* Custom Button Styling for DSR Web Application using Bootstrap */

/* Actions Container */
.customer-actions, .action-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    max-width: 220px;
    padding: 5px;
}

/* Global Button Styling for all pages */

/* Delete Button - Professional Style */
.btn-danger, .customer-actions .btn-danger {
    background: linear-gradient(to right, #e81500, #c51200) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(232, 21, 0, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.btn-danger:hover, .customer-actions .btn-danger:hover {
    background: linear-gradient(to right, #f52c17, #d41300) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(232, 21, 0, 0.25) !important;
}

/* Edit Button - Professional Style */
.btn-warning, .customer-actions .btn-warning {
    background: linear-gradient(to right, #f76400, #e05d00) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(247, 100, 0, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.btn-warning:hover, .customer-actions .btn-warning:hover {
    background: linear-gradient(to right, #ff7417, #f06000) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(247, 100, 0, 0.25) !important;
}

/* All Orders Button - Professional Style */
.btn-info, .customer-actions .btn-info {
    background: linear-gradient(to right, #0061f2, #0052cc) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0, 97, 242, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.btn-info:hover, .customer-actions .btn-info:hover {
    background: linear-gradient(to right, #1a75ff, #0057db) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 97, 242, 0.25) !important;
}

/* Account Statement Button - Professional Style */
.btn-success, .customer-actions .btn-success {
    background: linear-gradient(to right, #00ac69, #00965a) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0, 172, 105, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.btn-success:hover, .customer-actions .btn-success:hover {
    background: linear-gradient(to right, #00c676, #00a161) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 172, 105, 0.25) !important;
}

/* Common Button Styling */
.btn {
    /* display: flex; */
    align-items: center;
    padding: 8px 12px;
    border-radius: 6px;
    font-weight: 500;
    font-size: 14px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Add spacing between icon and text */
.btn i, .btn svg {
    margin-right: 8px;
}

.customer-actions .btn {
    text-align: left;
    padding: 10px 14px;
    width: 100%;
}

/* Category page specific button styling */
table .btn {
    padding: 4px 8px;
    font-size: 12px;
    justify-content: center;
    min-height: 26px;
    width: auto;
    min-width: 60px;
    margin: 2px;
    display: inline-flex;
}

table .btn i {
    margin-right: 4px;
    font-size: 12px;
    width: 12px;
}

/* Ensure table cells with buttons have proper spacing */
table td:last-child {
    padding: 4px !important;
    width: 130px !important;
    text-align: center;
    vertical-align: middle;
}

/* Fix the Actions column header alignment */
table th:last-child {
    text-align: center !important;
    width: 130px !important;
}

/* Button Icons */
.btn i, .btn .fa {
    margin-right: 8px;
    font-size: 16px;
    width: 18px;
    text-align: center;
    opacity: 0.9;
}

/* Account Statement Page Button Styling */
.no-print .btn {
    margin: 0 5px;
    display: inline-block;
    min-width: 120px;
}

/* Print Statement Button */
.no-print .btn-primary {
    background: linear-gradient(to right, #0061f2, #0052cc) !important;
    border: none !important;
    color: white !important;
    margin-right: 10px !important;
}

/* Back to Customers Button */
.no-print .btn-secondary {
    background: linear-gradient(to right, #6900c7, #5800a9) !important;
    border: none !important;
    color: white !important;
    margin-left: 10px !important;
}

/* Sales Page Button Styling */
#datatablesSimple td:last-child .btn-group {
    width: auto !important;
    padding: 0 !important;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
}


/* Ensure the actions column is wide enough */
#datatablesSimple th:last-child,
#datatablesSimple td:last-child {
    min-width: 150px !important;
    max-width: 250px !important;
    width: 250px !important;
}

/* Fix the More button styling */
#datatablesSimple td:last-child .btn-secondary,
#datatablesSimple td:last-child .dropdown-toggle {
    border-radius: 0.25rem !important;
    background: linear-gradient(to right, #0061f2, #0052cc) !important;
    border: none !important;
    color: white !important;
    padding: 4px 6px !important;
}

/* Ensure the actions column is wide enough on customer page */
#datatablesSimple th:last-child,
#datatablesSimple td:last-child {
    min-width: 150px !important;
    max-width: 250px !important;
    width: 250px !important;
    overflow: hidden !important;
}

#datatablesSimple td:last-child .btn-secondary:hover,
#datatablesSimple td:last-child .dropdown-toggle:hover {
    background: linear-gradient(to right, #0052cc, #0043a8) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 97, 242, 0.3) !important;
}

.customer-actions .btn i {
    margin-right: 10px;
    width: 20px;
}

/* Active State */
.btn:active {
    transform: translateY(1px) !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1) !important;
}

/* Button Ripple Effect */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(25, 25);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(40, 40);
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .customer-actions {
        max-width: 100%;
    }
    
    .customer-actions .btn {
        padding: 12px 16px;
        font-size: 15px;
    }
}

/* Add styles for other Bootstrap buttons too */
.btn-teal, .btn-primary {
    background: linear-gradient(to right, #0061f2, #0052cc) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(0, 97, 242, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.btn-teal:hover, .btn-primary:hover {
    background: linear-gradient(to right, #1a75ff, #0057db) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 97, 242, 0.25) !important;
}

.btn-purple {
    background: linear-gradient(to right, #6900c7, #5800a9) !important;
    border: none !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(105, 0, 199, 0.2) !important;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
}

.btn-purple:hover {
    background: linear-gradient(to right, #7b00e6, #6200bd) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(105, 0, 199, 0.25) !important;
}

.btn-purple:hover {
    background: linear-gradient(to right, #7b00e6, #6200bd) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(105, 0, 199, 0.25) !important;
}

/* Add specific styles for category dropdown in product add page */
select.form-control {
    height: auto !important;
    min-height: 40px !important;
    padding-top: 8px !important;
    padding-bottom: 8px !important;
    white-space: normal !important;
    text-overflow: ellipsis !important;
}
