/**
 * Gated Content Frontend Styles
 */

/* Gate Container */
.gc-gate-container {
    max-width: 500px;
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.gc-gate-container.gc-gate-inline {
    max-width: none;
    margin: 20px 0;
}

/* Gate Header */
.gc-gate-title {
    margin: 0 0 10px;
    font-size: 1.5em;
    color: #333;
    text-align: center;
}

.gc-gate-description {
    margin: 0 0 25px;
    color: #666;
    text-align: center;
    line-height: 1.6;
}

/* Excerpt */
.gc-content-excerpt {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.gc-excerpt-fade {
    position: relative;
}

.gc-excerpt-fade::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(transparent, #fff);
}

/* Form Styles */
.gc-access-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gc-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gc-form-field label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.gc-form-field input[type="text"],
.gc-form-field input[type="password"],
.gc-form-field input[type="email"],
.gc-form-field input[type="tel"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gc-form-field input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
    outline: none;
}

.gc-form-field input.gc-input-error {
    border-color: #dc3545;
}

/* Submit Button */
.gc-submit-btn {
    padding: 14px 25px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.gc-submit-btn:hover {
    background: #005a87;
}

.gc-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.gc-submit-btn.gc-loading {
    position: relative;
    color: transparent;
}

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

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

/* Password Hint */
.gc-password-hint {
    margin: 5px 0 0;
    font-size: 13px;
    color: #666;
    font-style: italic;
}

/* Messages */
.gc-form-message {
    padding: 12px 15px;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

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

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

.gc-form-message.gc-info {
    background: #cce5ff;
    color: #004085;
    border: 1px solid #b8daff;
}

/* SMS Verification */
.gc-sms-step {
    display: none;
}

.gc-sms-step.gc-active {
    display: block;
}

.gc-code-inputs {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.gc-code-inputs input {
    width: 45px;
    height: 50px;
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    border: 2px solid #ddd;
    border-radius: 4px;
}

.gc-code-inputs input:focus {
    border-color: #0073aa;
    outline: none;
}

.gc-resend-link {
    display: block;
    margin-top: 15px;
    text-align: center;
    font-size: 14px;
    color: #0073aa;
    text-decoration: none;
}

.gc-resend-link:hover {
    text-decoration: underline;
}

.gc-resend-link.gc-disabled {
    color: #999;
    pointer-events: none;
}

/* User Login Form */
.gc-login-form .gc-login-links {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    margin-top: -10px;
}

.gc-login-form .gc-login-links a {
    color: #0073aa;
    text-decoration: none;
}

.gc-login-form .gc-login-links a:hover {
    text-decoration: underline;
}

/* Role Restriction Message */
.gc-role-required {
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 15px;
    border-radius: 4px;
    text-align: center;
}

.gc-role-required p {
    margin: 0;
    color: #856404;
}

/* WooCommerce Purchase Gate */
.gc-purchase-gate {
    text-align: center;
}

.gc-product-info {
    margin-bottom: 20px;
}

.gc-product-price {
    font-size: 24px;
    font-weight: bold;
    color: #0073aa;
}

.gc-add-to-cart-btn {
    display: inline-block;
    padding: 14px 30px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background 0.2s;
}

.gc-add-to-cart-btn:hover {
    background: #005a87;
    color: #fff;
}

/* Elementor Form Gate */
.gc-elementor-form-message {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    padding: 20px;
    border-radius: 4px;
    text-align: center;
}

/* AJAX Loading Placeholder */
.gc-ajax-placeholder {
    padding: 50px;
    text-align: center;
    color: #666;
}

.gc-ajax-placeholder .gc-loader {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: gc-spin 0.8s linear infinite;
}

/* Content Reveal Animation */
.gc-content-revealed {
    animation: gc-fadeIn 0.5s ease-out;
}

@keyframes gc-fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* RTL Support */
[dir="rtl"] .gc-gate-container,
.rtl .gc-gate-container {
    text-align: right;
}

[dir="rtl"] .gc-login-form .gc-login-links,
.rtl .gc-login-form .gc-login-links {
    flex-direction: row-reverse;
}

/* Responsive */
@media screen and (max-width: 480px) {
    .gc-gate-container {
        margin: 15px;
        padding: 20px;
    }
    
    .gc-gate-title {
        font-size: 1.3em;
    }
    
    .gc-code-inputs input {
        width: 38px;
        height: 45px;
        font-size: 20px;
    }
}
