/**
 * StoreDash Waitlist Widget Styles
 *
 * Minimal, performant styles for back-in-stock notification widget
 */

/* Widget Container */
.storedash-waitlist-widget {
    margin: 20px 0;
}

/* Form Container */
.storedash-waitlist-form {
    background-color: #f8f8f8;
    padding: 20px;
    border-radius: 5px;
}

/* Form Title */
.storedash-waitlist-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
}

/* Form Description */
.storedash-waitlist-description {
    margin: 0 0 15px 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* Form Fields */
.storedash-waitlist-form-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.storedash-waitlist-field {
    width: 100%;
}

/* Input Fields */
.storedash-waitlist-input {
    width: 100%;
    padding: 10px 15px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.storedash-waitlist-input:focus {
    outline: none;
    border-color: #0073aa;
}

.storedash-waitlist-input::placeholder {
    color: #999;
}

/* Privacy Notice */
.storedash-waitlist-privacy {
    margin: 0;
    font-size: 12px;
    color: #666;
    line-height: 1.4;
}

/* Button */
.storedash-waitlist-button {
    display: inline-block;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background-color: #0073aa;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    text-align: center;
    transition: background-color 0.2s ease, transform 0.1s ease;
    -webkit-appearance: none;
    width: 100%;
}

.storedash-waitlist-button:hover {
    background-color: #005177;
}

.storedash-waitlist-button:active {
    transform: scale(0.98);
}

.storedash-waitlist-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Message */
.storedash-waitlist-message {
    padding: 10px 15px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 3px;
    margin-top: 10px;
}

.storedash-waitlist-message.success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.storedash-waitlist-message.error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* Modal Styles */
.storedash-waitlist-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

.storedash-waitlist-modal-content {
    position: relative;
    background-color: #fff;
    margin: 10% auto;
    padding: 0;
    width: 90%;
    max-width: 500px;
    border-radius: 5px;
    animation: slideIn 0.3s ease;
}

.storedash-waitlist-modal-content .storedash-waitlist-form {
    background-color: #fff;
}

/* Close button */
.storedash-waitlist-close {
    position: absolute;
    right: 15px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    z-index: 1;
    transition: color 0.2s ease;
}

.storedash-waitlist-close:hover,
.storedash-waitlist-close:focus {
    color: #000;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 600px) {
    .storedash-waitlist-modal-content {
        width: 95%;
        margin: 20% auto;
    }

    .storedash-waitlist-form {
        padding: 15px;
    }

    .storedash-waitlist-button {
        padding: 10px 20px;
    }
}

/* Loading state */
.storedash-waitlist-button.loading {
    position: relative;
    color: transparent;
}

.storedash-waitlist-button.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.6s linear infinite;
}

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