/* ==================================================
   🎯 PROPOKIT BUTTON STYLES - CONSOLIDATED
   ==================================================
   
   This file contains ALL button-related styles used throughout the application.
   All other CSS files should reference these styles instead of defining their own.
   
   ORGANIZATION:
   - Base Button Styles
   - Button Variants (Primary, Secondary, etc.)
   - Button Sizes
   - Button States (Hover, Active, Disabled)
   - Modal-specific Button Styles
   - Responsive Button Styles
   ================================================== */

/* ==================================================
   🎯 BASE BUTTON STYLES
   ================================================== */

.btn {
    display: inline-block;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    line-height: 1.4;
    text-align: center;
    position: relative;
    overflow: hidden;
    z-index: 1;
    transform: translateY(0);
    box-shadow: 
        0 8px 25px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    line-height: 1.4;
    backdrop-filter: blur(10px);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.8) 100%);
    font-family: var(--text-font, 'Poppins', sans-serif);
    letter-spacing: 0.5px;
}

/* Prevent slow appearance/disappearance when buttons are shown/hidden */
.btn[style*="display: none"],
.btn.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: none !important;
}

.btn:not([style*="display: none"]):not(.hidden) {
    display: inline-block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* ==================================================
   🎯 BUTTON HOVER EFFECTS
   ================================================== */

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--primary-color, #ffc300);
    transition: left 0.3s ease;
    z-index: -1;
    opacity: 0.9;
}

.btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.btn:hover::after {
    opacity: 1;
}

.btn:hover::before {
    left: 0;
}

.btn:hover {
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    border-color: var(--primary-color, #ffc300);
    color: var(--text-light, #FFFFFF);
    transform: translateY(-2px);
    transition: box-shadow 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

/* ==================================================
   🎯 BUTTON ACTIVE STATE
   ================================================== */

.btn:active {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.1s ease, transform 0.1s ease;
    transform: translateY(0);
}

/* ==================================================
   🎯 BUTTON FOCUS STATES
   ================================================== */

.btn:focus-visible {
    outline: 3px solid var(--primary-color, #ffc300);
    outline-offset: 4px;
    border-radius: 8px;
}

/* ==================================================
   🎯 BUTTON VARIANTS
   ================================================== */

.btn-primary {
    background-color: #667eea;
    color: white;
    border: none;
}

.btn-primary:hover {
    background-color: #5a67d8;
    color: white;
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background-color: #5a5d63;
    color: white;
}

.btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    background: transparent;
}

.btn-outline-primary:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.btn-outline-danger {
    border: 2px solid #dc3545;
    color: #dc3545;
    background: transparent;
}

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

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

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

.btn-success {
    background-color: #10b981;
    color: white;
    border: none;
}

.btn-success:hover {
    background-color: #059669;
    color: white;
}

.btn-link {
    background: transparent;
    color: #667eea;
    border: none;
    box-shadow: none;
    text-decoration: underline;
    padding: 0;
}

.btn-link:hover {
    color: #5a67d8;
    background: transparent;
    transform: none;
    box-shadow: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.875rem;
}

.btn-dark { 
    background: var(--dark-bg, #1A202C); 
    color: var(--text-light, #E2E8F0); 
    border-color: var(--dark-bg, #1A202C);
}

.btn-dark:hover { 
    color: var(--text-dark, #1A202C);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(255, 191, 35, 0.3);
}

.btn-light { 
    background: var(--light-bg, #FFFFFF); 
    color: var(--dark-bg, #1A202C); 
    border-color: var(--dark-bg, #1A202C);
}

.btn-light:hover { 
    color: var(--text-light, #E2E8F0);
    box-shadow: var(--shadow-lg), 0 0 20px rgba(255, 191, 35, 0.3);
}

/* ==================================================
   🎯 BUTTON SIZES
   ================================================== */

.btn-large {
    padding: 16px 36px;
    font-size: 1.1rem;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* ==================================================
   🎯 BUTTON LOADING STATE
   ================================================== */

.btn.loading {
    pointer-events: none;
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==================================================
   🎯 MODAL-SPECIFIC BUTTON STYLES
   ================================================== */

/* All modal footer buttons - centralized styling */
/* Reset base .btn hover pseudo-elements so modal buttons don't get gold overlay */
.modal-footer .btn::before,
.modal-footer .btn::after,
#laborCostModal .modal-footer .btn::before,
#laborCostModal .modal-footer .btn::after,
#downPaymentModal .modal-footer .btn::before,
#downPaymentModal .modal-footer .btn::after {
    display: none !important;
    content: none !important;
}

.modal-footer .btn,
.company-modal-footer .btn,
.qr-modal-footer .btn,
#companyIntroCropModal .modal-footer .btn,
#editFooterModal .modal-footer .btn,
#customerInfoModal .modal-footer .btn,
#laborCostModal .modal-footer .btn,
#downPaymentModal .modal-footer .btn {
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: box-shadow 0.2s ease, transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    margin-left: 10px;
    min-width: 100px;
}

/* Prevent slow transitions when buttons are shown/hidden */
.modal-footer .btn[style*="display: none"],
.modal-footer .btn.hidden,
#customerInfoModal .modal-footer .btn[style*="display: none"],
#customerInfoModal .modal-footer .btn.hidden {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: none !important;
    transform: none !important;
}

.modal-footer .btn:not([style*="display: none"]):not(.hidden),
#customerInfoModal .modal-footer .btn:not([style*="display: none"]):not(.hidden) {
    display: flex !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.modal-footer .btn:first-child,
.company-modal-footer .btn:first-child,
.qr-modal-footer .btn:first-child,
#companyIntroCropModal .modal-footer .btn:first-child,
#editFooterModal .modal-footer .btn:first-child,
#customerInfoModal .modal-footer .btn:first-child,
#laborCostModal .modal-footer .btn:first-child,
#downPaymentModal .modal-footer .btn:first-child {
    margin-left: 0;
}

.modal-footer .btn:hover:not(:disabled),
.company-modal-footer .btn:hover:not(:disabled),
.qr-modal-footer .btn:hover:not(:disabled),
#companyIntroCropModal .modal-footer .btn:hover:not(:disabled),
#editFooterModal .modal-footer .btn:hover:not(:disabled),
#customerInfoModal .modal-footer .btn:hover:not(:disabled),
#laborCostModal .modal-footer .btn:hover:not(:disabled),
#downPaymentModal .modal-footer .btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* Modal button variants */
.modal-footer .btn-primary,
.company-modal-footer .btn-primary,
.qr-modal-footer .btn-primary,
#companyIntroCropModal .modal-footer .btn-primary,
#editFooterModal .modal-footer .btn-primary,
#customerInfoModal .modal-footer .btn-primary {
    background: #667eea;
    color: white;
}

.modal-footer .btn-primary:hover,
.company-modal-footer .btn-primary:hover,
.qr-modal-footer .btn-primary:hover,
#companyIntroCropModal .modal-footer .btn-primary:hover,
#editFooterModal .modal-footer .btn-primary:hover,
#customerInfoModal .modal-footer .btn-primary:hover {
    background: #5a67d8;
}

.modal-footer .btn-secondary,
.company-modal-footer .btn-secondary,
.qr-modal-footer .btn-secondary,
#companyIntroCropModal .modal-footer .btn-secondary,
#editFooterModal .modal-footer .btn-secondary,
#customerInfoModal .modal-footer .btn-secondary {
    background: #6b7280;
    color: white;
}

.modal-footer .btn-secondary:hover,
.company-modal-footer .btn-secondary:hover,
.qr-modal-footer .btn-secondary:hover,
#companyIntroCropModal .modal-footer .btn-secondary:hover,
#editFooterModal .modal-footer .btn-secondary:hover,
#customerInfoModal .modal-footer .btn-secondary:hover {
    background: #5a5d63;
}

.modal-footer .btn-success,
.company-modal-footer .btn-success,
.qr-modal-footer .btn-success,
#companyIntroCropModal .modal-footer .btn-success,
#editFooterModal .modal-footer .btn-success,
#customerInfoModal .modal-footer .btn-success {
    background: #10b981;
    color: white;
}

.modal-footer .btn-success:hover,
.company-modal-footer .btn-success:hover,
.qr-modal-footer .btn-success:hover,
#companyIntroCropModal .modal-footer .btn-success:hover,
#editFooterModal .modal-footer .btn-success:hover,
#customerInfoModal .modal-footer .btn-success:hover {
    background: #059669;
}

.modal-footer .btn-outline-secondary,
.company-modal-footer .btn-outline-secondary,
.qr-modal-footer .btn-outline-secondary,
#companyIntroCropModal .modal-footer .btn-outline-secondary,
#editFooterModal .modal-footer .btn-outline-secondary,
#customerInfoModal .modal-footer .btn-outline-secondary {
    border: 2px solid #6b7280;
    color: #6b7280;
    background: transparent;
    box-shadow: none;
}

.modal-footer .btn-outline-secondary:hover,
.company-modal-footer .btn-outline-secondary:hover,
.qr-modal-footer .btn-outline-secondary:hover,
#companyIntroCropModal .modal-footer .btn-outline-secondary:hover,
#editFooterModal .modal-footer .btn-outline-secondary:hover,
#customerInfoModal .modal-footer .btn-outline-secondary:hover {
    background: #6b7280;
    color: white;
}

.modal-footer .btn-outline-primary,
.company-modal-footer .btn-outline-primary,
.qr-modal-footer .btn-outline-primary,
#companyIntroCropModal .modal-footer .btn-outline-primary,
#editFooterModal .modal-footer .btn-outline-primary,
#customerInfoModal .modal-footer .btn-outline-primary {
    border: 2px solid #667eea;
    color: #667eea;
    background: transparent;
    box-shadow: none;
}

.modal-footer .btn-outline-primary:hover,
.company-modal-footer .btn-outline-primary:hover,
.qr-modal-footer .btn-outline-primary:hover,
#companyIntroCropModal .modal-footer .btn-outline-primary:hover,
#editFooterModal .modal-footer .btn-outline-primary:hover,
#customerInfoModal .modal-footer .btn-outline-primary:hover {
    background: #667eea;
    color: white;
}

.modal-footer .btn-danger,
.company-modal-footer .btn-danger,
.qr-modal-footer .btn-danger,
#companyIntroCropModal .modal-footer .btn-danger,
#editFooterModal .modal-footer .btn-danger,
#customerInfoModal .modal-footer .btn-danger {
    background: #dc3545;
    color: white;
}

.modal-footer .btn-danger:hover,
.company-modal-footer .btn-danger:hover,
.qr-modal-footer .btn-danger:hover,
#companyIntroCropModal .modal-footer .btn-danger:hover,
#editFooterModal .modal-footer .btn-danger:hover,
#customerInfoModal .modal-footer .btn-danger:hover,
#laborCostModal .modal-footer .btn-danger:hover,
#downPaymentModal .modal-footer .btn-danger:hover {
    background: #c82333;
}

/* Outline danger (Clear / Reset) in modal footers */
.modal-footer .btn-outline-danger,
#laborCostModal .modal-footer .btn-outline-danger,
#downPaymentModal .modal-footer .btn-outline-danger {
    border: 2px solid #dc3545;
    color: #dc3545;
    background: transparent;
    box-shadow: none;
}
.modal-footer .btn-outline-danger:hover:not(:disabled),
#laborCostModal .modal-footer .btn-outline-danger:hover:not(:disabled),
#downPaymentModal .modal-footer .btn-outline-danger:hover:not(:disabled) {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.35);
}

/* Step Navigation Buttons */
.step-navigation .btn {
    margin: 0 5px;
    min-width: 80px;
}

/* Specific modal overrides - all use centralized styles above */
/* All modals now use the same button styles for consistency */

/* Disabled state for all modals */
.modal-footer .btn:disabled,
.company-modal-footer .btn:disabled,
.qr-modal-footer .btn:disabled,
#companyIntroCropModal .modal-footer .btn:disabled,
#editFooterModal .modal-footer .btn:disabled,
#customerInfoModal .modal-footer .btn:disabled {
    background: #cccccc !important;
    cursor: not-allowed !important;
    transform: none !important;
    opacity: 0.6;
}

/* ==================================================
   🎯 PRICING CARD BUTTONS
   ================================================== */

.pricing-card .btn {
    width: 100%;
    margin-top: 20px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==================================================
   🎯 RESPONSIVE BUTTON STYLES
   ================================================== */

@media (max-width: 768px) {
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .btn-large {
        padding: 14px 28px;
        font-size: 1rem;
    }
    
    .modal-footer .btn,
    .company-modal-footer .btn,
    .qr-modal-footer .btn,
    #editFooterModal .modal-footer .btn,
    #editTextModal .modal-footer .btn,
    #combinedImageModal .modal-footer .btn,
    #companyIntroCropModal .modal-footer .btn,
    #customerInfoModal .modal-footer .btn {
        margin: 5px;
        min-width: 80px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 8px 16px;
        font-size: 0.85rem;
    }
    
    .modal-footer .btn,
    .company-modal-footer .btn,
    .qr-modal-footer .btn,
    #editFooterModal .modal-footer .btn,
    #editTextModal .modal-footer .btn,
    #combinedImageModal .modal-footer .btn,
    #companyIntroCropModal .modal-footer .btn,
    #customerInfoModal .modal-footer .btn {
        margin: 3px;
        min-width: 70px;
    }
}

/* ==================================================
   🎯 ANIMATIONS
   ================================================== */

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