/**
 * Frontend Styles
 * WooCommerce Guest Price Hide Plugin
 * 
 * @version 3.1.0
 */

/* Modal Overlay */
.wc-guest-price-hide-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wc-guest-price-hide-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
    animation: fadeIn 0.3s ease-in-out;
}

/* Modal Content */
.wc-guest-price-hide-modal-content {
    position: relative;
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-in-out;
}

/* Close Button */
.wc-guest-price-hide-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
}

.wc-guest-price-hide-modal-close:hover {
    background: #e0e0e0;
    color: #333;
    border-color: #ccc;
}

.wc-guest-price-hide-modal-close:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Modal Header */
.wc-guest-price-hide-modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #eee;
}

.wc-guest-price-hide-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    transition: all 0.3s ease;
}

/* Modal Body */
.wc-guest-price-hide-modal-body {
    padding: 30px;
}

/* Registration Form */
.wc-guest-price-hide-form {
    max-width: 100%;
}

.wc-guest-price-hide-field {
    margin-bottom: 20px;
}

.wc-guest-price-hide-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333;
}

.wc-guest-price-hide-field label .required {
    color: #d94f4f;
}

.wc-guest-price-hide-field input[type="email"],
.wc-guest-price-hide-field input[type="text"],
.wc-guest-price-hide-field input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    box-sizing: border-box;
}

.wc-guest-price-hide-field input[type="email"]:focus,
.wc-guest-price-hide-field input[type="text"]:focus,
.wc-guest-price-hide-field input[type="password"]:focus {
    border-color: #999;
    outline: none;
}

/* Readonly email field (login mode) */
.wc-guest-price-hide-field input.readonly {
    background-color: #f5f5f5;
    color: #666;
    cursor: not-allowed;
}

/* Password field wrapper */
.wc-guest-password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.wc-guest-password-input-wrapper input {
    padding-right: 45px !important;
}

.wc-guest-password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease;
}

.wc-guest-password-toggle:hover {
    color: #333;
}

/* Forgot password link */
.wc-guest-forgot-password {
    margin-top: 8px;
    font-size: 13px;
}

.wc-guest-forgot-password a {
    color: #0073aa;
    text-decoration: none;
}

.wc-guest-forgot-password a:hover {
    text-decoration: underline;
}

/* Checkbox styles */
.wc-guest-price-hide-checkbox label {
    font-weight: normal;
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.wc-guest-price-hide-checkbox input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Submit button - inherits styles from admin settings via inline styles */
.wc-guest-price-hide-submit {
    margin-top: 25px;
}

.wc-guest-price-hide-submit-btn {
    width: 100%;
    padding: 14px 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.wc-guest-price-hide-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Button spinner */
.button-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spinner animation */
@keyframes wc-spinner-rotate {
    100% { transform: rotate(360deg); }
}

@keyframes wc-spinner-dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }
    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }
    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

.spinner-icon {
    animation: wc-spinner-rotate 2s linear infinite;
}

.spinner-circle {
    stroke-linecap: round;
    animation: wc-spinner-dash 1.5s ease-in-out infinite;
}

/* Back link */
.wc-guest-price-hide-back-link {
    text-align: center;
    margin-top: 15px;
}

.wc-guest-price-hide-back-link a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
}

.wc-guest-price-hide-back-link a:hover {
    color: #333;
    text-decoration: underline;
}

/* Message Styles */
.wc-guest-price-hide-message {
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-size: 14px;
}

.wc-guest-price-hide-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wc-guest-price-hide-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.wc-guest-price-hide-message.info {
    background: #e7f3ff;
    color: #004085;
    border: 1px solid #b8daff;
}

/* Trigger Button Styles */
.wc-guest-price-hide-trigger {
    cursor: pointer;
    transition: all 0.3s ease;
}

.wc-guest-price-hide-trigger:hover {
    opacity: 0.8;
}

/* Single Product Button */
.wc-guest-price-hide-single-button {
    margin-bottom: 20px;
}

.wc-guest-price-hide-single-button .wc-guest-price-hide-trigger {
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
}

/* Price Button Wrapper */
.wc-guest-price-hide-button-wrapper {
    margin: 10px 0;
}

.wc-guest-price-hide-button-wrapper .wc-guest-price-hide-trigger {
    display: inline-block;
}

/* Gravity Forms Styling Inside Modal */
.wc-guest-price-hide-modal-body .gform_wrapper {
    margin: 0;
}

.wc-guest-price-hide-modal-body .gform_wrapper form {
    margin: 0;
}

.wc-guest-price-hide-modal-body .gform_body {
    margin: 0;
}

.wc-guest-price-hide-modal-body .gfield {
    margin-bottom: 20px;
}

.wc-guest-price-hide-modal-body .gfield_label {
    font-weight: 600;
    margin-bottom: 8px;
    display: block;
}

.wc-guest-price-hide-modal-body input[type="text"],
.wc-guest-price-hide-modal-body input[type="email"],
.wc-guest-price-hide-modal-body input[type="tel"],
.wc-guest-price-hide-modal-body textarea,
.wc-guest-price-hide-modal-body select {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.wc-guest-price-hide-modal-body input[type="text"]:focus,
.wc-guest-price-hide-modal-body input[type="email"]:focus,
.wc-guest-price-hide-modal-body input[type="tel"]:focus,
.wc-guest-price-hide-modal-body textarea:focus,
.wc-guest-price-hide-modal-body select:focus {
    border-color: #999;
    outline: none;
}

.wc-guest-price-hide-modal-body .gform_footer {
    margin-top: 20px;
    padding: 0;
}

.wc-guest-price-hide-modal-body .gform_button {
    width: 100%;
    padding: 12px 24px;
    font-size: 16px;
    cursor: pointer;
}

/* Validation Messages */
.wc-guest-price-hide-modal-body .gfield_error {
    background-color: #fef7f1;
    border: 1px solid #f9c2a0;
    padding: 10px;
    border-radius: 4px;
}

.wc-guest-price-hide-modal-body .validation_message {
    color: #d94f4f;
    font-size: 13px;
    margin-top: 5px;
}

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

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

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    .wc-guest-price-hide-modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 4px;
    }

    .wc-guest-price-hide-modal-header {
        padding: 20px 20px 15px;
    }

    .wc-guest-price-hide-modal-header h2 {
        font-size: 20px;
        padding-right: 30px;
    }

    .wc-guest-price-hide-modal-body {
        padding: 20px;
    }

    .wc-guest-price-hide-modal-close {
        top: 10px;
        right: 10px;
        font-size: 28px;
        width: 28px;
        height: 28px;
    }

    .wc-guest-price-hide-single-button .wc-guest-price-hide-trigger {
        padding: 10px 20px;
        font-size: 14px;
    }

    .wc-guest-price-hide-modal-body .gform_button {
        padding: 10px 20px;
        font-size: 14px;
    }
}

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

    .wc-guest-price-hide-modal-header h2 {
        font-size: 18px;
    }

    .wc-guest-price-hide-modal-body input[type="text"],
    .wc-guest-price-hide-modal-body input[type="email"],
    .wc-guest-price-hide-modal-body input[type="password"],
    .wc-guest-price-hide-modal-body input[type="tel"],
    .wc-guest-price-hide-modal-body textarea,
    .wc-guest-price-hide-modal-body select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* Loading State */
.wc-guest-price-hide-modal-body.loading {
    opacity: 0.6;
    pointer-events: none;
}

.wc-guest-price-hide-modal-body.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Accessibility */
.wc-guest-price-hide-modal:focus {
    outline: none;
}

.wc-guest-price-hide-trigger:focus {
    outline: 2px solid #333;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .wc-guest-price-hide-modal {
        display: none !important;
    }
}
