/**
 * Divi-Compatible Button Styles
 * Matches the main Sunny Jetsun website button styling
 * Uses Divi theme button classes and structure
 */

/* ============================================================
   Base Button Wrapper Structure
   ============================================================ */

.et_pb_button_module_wrapper {
    display: inline-block;
    margin: var(--spacing-md, 15px) 0;
}

.et_pb_button_module_wrapper.et_pb_button_alignment_left {
    text-align: left;
}

.et_pb_button_module_wrapper.et_pb_button_alignment_center {
    text-align: center;
}

.et_pb_button_module_wrapper.et_pb_button_alignment_right {
    text-align: right;
}

/* ============================================================
   Base Button Classes
   ============================================================ */

.et_pb_button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 32px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.et_pb_button:focus {
    outline: 2px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* ============================================================
   Hover Effects with et_hover_enabled
   ============================================================ */

.et_pb_button.et_hover_enabled:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.et_pb_button.et_hover_enabled:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ============================================================
   Primary Button Styles (Default)
   ============================================================ */

.et_pb_button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.et_pb_button:hover {
    color: #ffffff;
}

.et_pb_button.et_hover_enabled:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4090 100%);
    color: #ffffff;
}

/* ============================================================
   Light Background Layout
   ============================================================ */

.et_pb_button.et_pb_bg_layout_light {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.et_pb_button.et_pb_bg_layout_light:hover {
    color: #ffffff;
}

.et_pb_button.et_pb_bg_layout_light.et_hover_enabled:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4090 100%);
    color: #ffffff;
}

/* ============================================================
   Dark Background Layout
   ============================================================ */

.et_pb_button.et_pb_bg_layout_dark {
    background: #ffffff;
    color: #667eea;
    border: 2px solid #e0e0e0;
}

.et_pb_button.et_pb_bg_layout_dark:hover {
    color: #667eea;
}

.et_pb_button.et_pb_bg_layout_dark.et_hover_enabled:hover {
    background: #f5f5f5;
    border-color: #667eea;
    color: #667eea;
}

/* ============================================================
   Specific Button Variants
   ============================================================ */

/* Primary Action Buttons */
.et_pb_button_0,
.et_pb_button_1,
.et_pb_button_2,
.et_pb_button_3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.et_pb_button_0.et_hover_enabled:hover,
.et_pb_button_1.et_hover_enabled:hover,
.et_pb_button_2.et_hover_enabled:hover,
.et_pb_button_3.et_hover_enabled:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a4090 100%);
}

/* Secondary Action Buttons */
.et_pb_button.et_pb_button_secondary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.et_pb_button.et_pb_button_secondary.et_hover_enabled:hover {
    background: #667eea;
    color: #ffffff;
    border-color: #667eea;
}

/* ============================================================
   Navigation Buttons (Previous/Next)
   ============================================================ */

.et_pb_button.nav-btn {
    padding: 14px 28px;
    font-weight: 600;
    font-size: 15px;
}

.et_pb_button.nav-btn.et_hover_enabled:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 32px rgba(102, 126, 234, 0.3);
}

/* ============================================================
   Action Buttons (Share, Print, etc.)
   ============================================================ */

.et_pb_button.action-btn {
    background: #f9f9f9;
    color: #333333;
    border: 1px solid #e0e0e0;
    padding: 10px 20px;
}

.et_pb_button.action-btn.et_hover_enabled:hover {
    background: #ffffff;
    border-color: #667eea;
    color: #667eea;
}

/* ============================================================
   Search Button
   ============================================================ */

.et_pb_button.btn-search {
    padding: 11px 24px;
    background: #0073aa;
    color: #ffffff;
    border: none;
}

.et_pb_button.btn-search.et_hover_enabled:hover {
    background: #005a87;
    transform: translateY(-2px);
}

/* ============================================================
   Reset/Cancel Link
   ============================================================ */

.et_pb_button.btn-reset {
    background: transparent;
    color: #0073aa;
    border: none;
    padding: 10px 0;
    text-decoration: none;
}

.et_pb_button.btn-reset.et_hover_enabled:hover {
    text-decoration: underline;
    transform: none;
    box-shadow: none;
}

/* ============================================================
   Back Button
   ============================================================ */

.et_pb_button.back-btn {
    background: #f9f9f9;
    color: #333333;
    border: 1px solid #e0e0e0;
    padding: 10px 20px;
}

.et_pb_button.back-btn.et_hover_enabled:hover {
    background: #ffffff;
    border-color: #667eea;
    color: #667eea;
    transform: translateX(-2px);
}

/* ============================================================
   Read More Link
   ============================================================ */

.et_pb_button.read-more-link {
    background: transparent;
    color: #667eea;
    border: none;
    padding: 0;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    margin-top: auto;
}

.et_pb_button.read-more-link.et_hover_enabled:hover {
    color: #764ba2;
    transform: translateX(3px);
    text-decoration: none;
    box-shadow: none;
}

/* ============================================================
   Button Sizes
   ============================================================ */

.et_pb_button.et_pb_button_sm {
    padding: 8px 16px;
    font-size: 12px;
}

.et_pb_button.et_pb_button_md {
    padding: 12px 24px;
    font-size: 14px;
}

.et_pb_button.et_pb_button_lg {
    padding: 16px 40px;
    font-size: 16px;
}

.et_pb_button.et_pb_button_xl {
    padding: 20px 50px;
    font-size: 18px;
}

/* ============================================================
   Button States
   ============================================================ */

.et_pb_button:disabled,
.et_pb_button[disabled] {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.et_pb_button:disabled:hover,
.et_pb_button[disabled]:hover {
    opacity: 0.6;
}

/* ============================================================
   Loading State
   ============================================================ */

.et_pb_button.et_pb_button_loading {
    opacity: 0.8;
    cursor: wait;
}

.et_pb_button.et_pb_button_loading::after {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    margin-left: 8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================
   Responsive Design
   ============================================================ */

@media (max-width: 768px) {
    .et_pb_button {
        padding: 10px 24px;
        font-size: 13px;
    }

    .et_pb_button.nav-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .et_pb_button.et_pb_button_lg {
        padding: 14px 32px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .et_pb_button {
        padding: 10px 16px;
        font-size: 12px;
        width: 100%;
    }

    .et_pb_button_module_wrapper {
        width: 100%;
    }

    .et_pb_button_module_wrapper.et_pb_button_alignment_center {
        text-align: center;
    }
}

/* ============================================================
   Dark Mode Support
   ============================================================ */

@media (prefers-color-scheme: dark) {
    .et_pb_button {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #ffffff;
    }

    .et_pb_button.action-btn {
        background: #2a2a2a;
        color: #f0f0f0;
        border-color: #444;
    }

    .et_pb_button.action-btn.et_hover_enabled:hover {
        background: #333333;
        border-color: #8ab4f8;
        color: #8ab4f8;
    }

    .et_pb_button.back-btn {
        background: #2a2a2a;
        color: #f0f0f0;
        border-color: #444;
    }

    .et_pb_button.back-btn.et_hover_enabled:hover {
        background: #333333;
        border-color: #8ab4f8;
        color: #8ab4f8;
    }

    .et_pb_button.read-more-link {
        color: #8ab4f8;
    }

    .et_pb_button.read-more-link.et_hover_enabled:hover {
        color: #b3d9f2;
    }
}

/* ============================================================
   Search Buttons Wrapper
   ============================================================ */

.sj-search-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 20px;
    margin-bottom: 30px;
}

.sj-search-buttons .et_pb_button_module_wrapper {
    flex: 1;
    min-width: 150px;
}

.sj-search-buttons .et_pb_button {
    width: 100%;
}

@media (max-width: 768px) {
    .sj-search-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .sj-search-buttons .et_pb_button_module_wrapper {
        flex: none;
        width: 100%;
    }
}

/* ============================================================
   Accessibility
   ============================================================ */

.et_pb_button:focus-visible {
    outline: 3px solid #667eea;
    outline-offset: 2px;
}

.et_pb_button::-moz-focus-inner {
    border: 0;
}

/* High contrast mode support */
@media (prefers-contrast: more) {
    .et_pb_button {
        border: 2px solid currentColor;
    }

    .et_pb_button.et_hover_enabled:hover {
        text-decoration: underline;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .et_pb_button {
        transition: color 0.3s ease;
    }

    .et_pb_button.et_hover_enabled:hover {
        transform: none;
    }

    .et_pb_button.et_pb_button_loading::after {
        animation: none;
        border: 2px dashed currentColor;
    }
}
