/**
 * Frontend styles for SeekMake widgets.
 *
 * @since      1.0.0
 * @package    SeekMake_Core
 */

/* Modal Base Styles */
.seekmake-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
}

.seekmake-modal.active {
    display: flex;
}

.seekmake-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.seekmake-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.seekmake-modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    width: 40px;
    height: 40px;
    background: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    line-height: 1;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    z-index: 2;
}

.seekmake-modal-close:hover {
    background: #f44336;
    color: #fff;
    transform: scale(1.1);
}

.seekmake-modal-close:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.seekmake-modal-body {
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
}

.seekmake-modal-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 8px;
}

/* Prevent body scroll when modal is open */
body.seekmake-modal-open {
    overflow: hidden;
}

/* Inline Widget Containers */
.seekmake-quote-container,
.seekmake-dashboard-container,
.seekmake-bot-widget {
    position: relative;
    width: 100%;
    margin: 20px 0;
}

.seekmake-embed-iq,
.seekmake-embed-dashboard,
.seekmake-embed-bot {
    width: 100%;
    border: 0;
    min-height: 600px;
}

/* Widget Buttons */
.seekmake-widget-button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.seekmake-widget-button:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Button Styles */
.seekmake-button-primary {
    background: #2271b1;
    color: #fff;
}

.seekmake-button-primary:hover {
    background: #135e96;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.seekmake-button-secondary {
    background: #50575e;
    color: #fff;
}

.seekmake-button-secondary:hover {
    background: #3c434a;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(80, 87, 94, 0.3);
}

.seekmake-button-outline {
    background: transparent;
    color: #2271b1;
    border: 2px solid #2271b1;
}

.seekmake-button-outline:hover {
    background: #2271b1;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.3);
}

.seekmake-button-link {
    background: transparent;
    color: #2271b1;
    text-decoration: underline;
    padding: 8px 16px;
}

.seekmake-button-link:hover {
    color: #135e96;
    text-decoration: none;
}

/* Notification */
.seekmake-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000000;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
    max-width: 400px;
}

.seekmake-notification.active {
    opacity: 1;
    transform: translateX(0);
}

.seekmake-notification-success {
    border-left: 4px solid #46b450;
}

.seekmake-notification-error {
    border-left: 4px solid #dc3232;
}

.seekmake-notification-warning {
    border-left: 4px solid #ffb900;
}

.seekmake-notification-info {
    border-left: 4px solid #2271b1;
}

/* Loading State */
.seekmake-loading-state {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.seekmake-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: seekmake-spin 1s linear infinite;
}

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

/* ===== Cart Redirect Loading Overlay ===== */
.seekmake-cart-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: inherit;
    opacity: 0;
    animation: seekmake-overlay-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes seekmake-overlay-in {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* Cart Icon Container */
.seekmake-cart-overlay-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0066ff 0%, #7c3aed 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 32px rgba(0, 102, 255, 0.3);
    animation: seekmake-icon-pulse 1.6s ease-in-out infinite;
    margin-bottom: 20px;
}

.seekmake-cart-overlay-icon svg {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: #ffffff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@keyframes seekmake-icon-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

/* Text */
.seekmake-cart-overlay-text {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 6px;
    opacity: 0;
    transform: translateY(6px);
    animation: seekmake-text-in 0.35s 0.15s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.seekmake-cart-overlay-sub {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: #64748b;
    margin-bottom: 24px;
    opacity: 0;
    transform: translateY(6px);
    animation: seekmake-text-in 0.35s 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes seekmake-text-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Bar */
.seekmake-cart-progress-track {
    width: 200px;
    height: 3px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    opacity: 0;
    animation: seekmake-text-in 0.3s 0.3s ease forwards;
}

.seekmake-cart-progress-bar {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #0066ff, #7c3aed);
    width: 0%;
    animation: seekmake-progress-fill 1.5s 0.35s linear forwards;
}

@keyframes seekmake-progress-fill {
    0% { width: 0%; }
    100% { width: 100%; }
}

/* Responsive Styles */
@media screen and (max-width: 768px) {
    .seekmake-modal-content {
        width: 95%;
        height: 95vh;
    }

    .seekmake-modal-close {
        top: -10px;
        right: -10px;
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .seekmake-widget-button {
        width: 100%;
        padding: 14px 20px;
    }

    .seekmake-notification {
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

@media screen and (max-width: 480px) {
    .seekmake-modal-content {
        width: 100%;
        height: 100vh;
        border-radius: 0;
    }

    .seekmake-modal-body {
        border-radius: 0;
    }

    .seekmake-modal-iframe {
        border-radius: 0;
    }
}

/* Accessibility */
.seekmake-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Focus Styles */
*:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Widget Container Spacing */
.seekmake-widget-wrapper {
    margin: 30px 0;
}

/* Centered Widget Buttons */
.seekmake-widget-center {
    text-align: center;
}

.seekmake-widget-left {
    text-align: left;
}

.seekmake-widget-right {
    text-align: right;
}
