/**
 * Anchor Advantage Club Frontend Styles
 *
 * @package Anchor_Advantage_Club
 * @since 1.0.0
 */

/* ============================================
   Hide Page Title (for pages using shortcode)
   ============================================ */

/* Hide page title when AAC content is present */
.page .entry-title,
.page h1.entry-title,
.page .page-title,
.page header.entry-header {
    display: none !important;
}

/* More specific selectors for common themes */
body.page .ast-single-post .entry-header,
body.page article header.entry-header,
body.page .elementor-page-title {
    display: none !important;
}

/* ============================================
   Signup Form Styles
   ============================================ */

.aac-signup-wrapper {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Hero Banner */
.aac-hero-banner {
    width: 100%;
    margin: 0;
    padding: 0;
}

.aac-hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    max-height: 400px;
}

.aac-signup-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.aac-signup-header {
    text-align: center;
    margin-bottom: 30px;
}

.aac-main-headline {
    margin: 0 0 10px 0;
    font-size: 32px;
    color: #333;
    line-height: 1.3;
}

.aac-subheadline {
    font-size: 18px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.aac-description {
    font-size: 16px;
    color: #666;
    margin: 0;
}

/* Benefits Section */
.aac-benefits {
    background: #f7f7f7;
    border-left: 4px solid #3e86f8;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 4px;
}

.aac-benefits h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    color: #333;
}

.aac-benefits-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.aac-benefits-list li {
    padding: 10px 0;
    font-size: 16px;
    color: #555;
    display: flex;
    align-items: center;
}

.aac-benefit-icon {
    display: inline-block;
    width: 24px;
    height: 24px;
    background: #00a32a;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 24px;
    margin-right: 10px;
    font-weight: bold;
    flex-shrink: 0;
}

/* Form Styles */
.aac-signup-form {
    max-width: 600px;
    margin: 0 auto;
}

.aac-form-group {
    margin-bottom: 20px;
}

.aac-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.aac-form-group .required {
    color: #d63638;
}

.aac-form-group input[type="text"],
.aac-form-group input[type="email"],
.aac-form-group input[type="tel"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.aac-form-group input:focus {
    outline: none;
    border-color: #3e86f8;
    box-shadow: 0 0 0 1px #3e86f8;
}

.aac-submit-btn {
    width: 100%;
    padding: 14px;
    background: #3e86f8;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

.aac-submit-btn:hover {
    background: #135e96;
}

.aac-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.aac-btn-loading {
    display: none;
}

.aac-submit-btn.loading .aac-btn-text {
    display: none;
}

.aac-submit-btn.loading .aac-btn-loading {
    display: inline;
}

.aac-form-footer {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-top: 15px;
}

/* Form Messages */
.aac-form-messages {
    margin-bottom: 20px;
}

.aac-form-messages .aac-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.aac-form-messages .aac-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 10px;
}

/* ============================================
   Program Details Section
   ============================================ */

.aac-program-details {
    background: #f9f9f9;
    border-left: 4px solid #3e86f8;
    padding: 25px;
    margin: 30px 0;
    border-radius: 4px;
    line-height: 1.6;
}

.aac-program-details h3 {
    margin: 0 0 20px 0;
    font-size: 22px;
    color: #333;
}

.aac-cashback-info {
    background: #fff;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.aac-cashback-info strong {
    color: #00a32a;
}

.aac-exclusions {
    font-size: 14px;
    color: #555;
}

.aac-exclusions p {
    margin: 10px 0;
}

.aac-exclusions strong {
    color: #333;
}

.aac-additional-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #ddd;
    font-size: 15px;
    color: #555;
}

/* ============================================
   Member Status Display (My Account)
   ============================================ */

.aac-member-status {
    background: #e7f5fe;
    border-left: 4px solid #3e86f8;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.aac-member-status strong {
    font-size: 18px;
    color: #3e86f8;
    display: block;
    margin-bottom: 5px;
}

.aac-member-status em {
    color: #555;
    font-style: normal;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .aac-signup-container {
        padding: 20px;
    }

    .aac-signup-header h2 {
        font-size: 24px;
    }

    .aac-benefits {
        padding: 15px;
    }

    .aac-form-group input[type="text"],
    .aac-form-group input[type="email"],
    .aac-form-group input[type="tel"] {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

@media (max-width: 480px) {
    .aac-signup-container {
        padding: 15px;
    }

    .aac-signup-header h2 {
        font-size: 20px;
    }

    .aac-benefits-list li {
        font-size: 14px;
    }
}

/* ============================================
   Page Template Styles (v1.2.0)
   ============================================ */

.aac-page-wrapper {
    width: 100%;
    margin: 0 auto;
}

.aac-page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

/* Signup Section (Prominent at top) */
.aac-signup-section {
    background: #fff;
    border: 2px solid #3e86f8;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 50px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.aac-signup-section .aac-main-headline {
    text-align: center;
    margin: 0 0 10px 0;
    font-size: 36px;
    color: #3e86f8;
}

.aac-signup-section .aac-subheadline {
    text-align: center;
    font-size: 18px;
    color: #666;
    margin: 0 0 30px 0;
}

/* 3-Column Form Layout */
.aac-form-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

@media (max-width: 992px) {
    .aac-form-row {
        grid-template-columns: 1fr;
    }
}

/* Benefits Section */
.aac-benefits-section {
    background: #f7f7f7;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 40px;
}

.aac-benefits-section h2 {
    margin: 0 0 5px 0;
    font-size: 28px;
    color: #333;
    text-align: center;
}

.aac-benefits-disclaimer {
    text-align: center;
    font-size: 11px;
    color: #888;
    margin: 0 0 20px 0;
    font-style: italic;
}

.aac-benefits-section .aac-benefits-list {
    max-width: 800px;
    margin: 0 auto;
}

.aac-benefit-content {
    flex: 1;
}

.aac-benefit-content strong {
    font-size: 18px;
    color: #3e86f8;
}

/* Program Details Section */
.aac-program-details-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 40px;
    margin-bottom: 40px;
}

.aac-program-details-section.aac-no-content {
    display: none;
}

.aac-program-details-section h2 {
    margin: 0 0 25px 0;
    font-size: 26px;
    color: #333;
}

/* Terms & Conditions */
.aac-terms-section {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 40px;
    margin-top: 0;
    padding: 40px;
}

.aac-terms-header {
    margin: 0 0 20px 0;
    padding: 0;
    font-size: 26px;
    color: #3e86f8;
}

.aac-terms-content {
    padding: 0;
    line-height: 1.8;
    color: #555;
}

.aac-terms-content h3 {
    margin: 25px 0 15px 0;
    font-size: 20px;
    color: #333;
}

.aac-terms-content p {
    margin: 15px 0;
}

.aac-terms-content ul,
.aac-terms-content ol {
    margin: 15px 0;
    padding-left: 30px;
}

.aac-terms-content li {
    margin: 8px 0;
}

.aac-terms-updated {
    font-size: 13px;
    color: #999;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

/* Manual Linking Form (My Account) */
.aac-link-membership-notice {
    background: #e7f5fe;
    border-left: 4px solid #3e86f8;
    padding: 20px;
    margin-bottom: 25px;
}

.aac-show-link-form {
    margin-left: 10px;
}

.aac-manual-link-form {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

.aac-link-message {
    font-weight: 600;
}

.aac-link-message.error {
    color: #d63638;
}

.aac-link-message.success {
    color: #00a32a;
}

/* Print Styles for Terms */
@media print {
    .aac-signup-section,
    .aac-benefits-section,
    .aac-program-details-section {
        display: none;
    }

    .aac-terms-content {
        display: block !important;
    }

}

/* Responsive Page Template */
@media (max-width: 768px) {
    .aac-page-container {
        padding: 20px 15px;
    }

    .aac-signup-section {
        padding: 25px 20px;
    }

    .aac-signup-section .aac-main-headline {
        font-size: 28px;
    }

    .aac-benefits-section,
    .aac-program-details-section {
        padding: 25px 20px;
    }

    .aac-terms-section {
        padding: 25px 20px;
    }

    .aac-terms-header {
        font-size: 22px;
        margin-bottom: 15px;
    }

    .aac-benefits-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   Logo Display (v1.3.0)
   ============================================ */

.aac-club-logo-wrapper {
    text-align: center;
    margin: 0 0 20px 0;
}

.aac-club-logo-wrapper a {
    display: inline-block;
    text-decoration: none;
    border: none;
    outline-offset: 2px;
}

.aac-club-logo-wrapper a:hover {
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.aac-club-logo {
    height: auto;
    width: 100%;
    display: block;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .aac-club-logo {
        max-width: 200px !important;
    }
}

/* ============================================
   Improved Benefits Grid (v1.3.0)
   ============================================ */

.aac-benefits-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 25px;
}

/* Tablet portrait: 4 columns with tighter spacing */
@media (max-width: 1024px) and (min-width: 641px) {
    .aac-benefits-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 15px;
    }
}

/* Mobile: 2 columns for phones */
@media (max-width: 640px) {
    .aac-benefits-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

.aac-benefit-item {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    border-left: 4px solid #091546;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

/* Tablet optimization for better fit */
@media (max-width: 1024px) and (min-width: 641px) {
    .aac-benefits-section {
        padding: 30px 20px;
    }

    .aac-benefits-section h2 {
        font-size: 24px;
        margin-bottom: 20px;
    }

    .aac-benefit-item {
        padding: 16px 12px;
    }

    .aac-benefit-icon {
        font-size: 28px;
        margin-bottom: 8px;
    }

    .aac-benefit-title {
        font-size: 16px;
        margin-bottom: 6px;
    }

    .aac-benefit-description {
        font-size: 13px;
        line-height: 1.4;
    }
}

/* iPad Air specific (820px portrait) - compact for above fold */
@media (max-width: 820px) and (min-width: 641px) {
    .aac-signup-section {
        padding: 30px 25px;
        margin-bottom: 30px;
    }

    .aac-signup-section .aac-main-headline {
        font-size: 30px;
        margin-bottom: 8px;
    }

    .aac-signup-section .aac-subheadline {
        font-size: 16px;
        margin-bottom: 20px;
    }

    .aac-form-row {
        gap: 12px;
    }

    .aac-benefits-section {
        padding: 20px 15px;
        margin-bottom: 25px;
    }

    .aac-benefits-section h2 {
        font-size: 22px;
        margin-bottom: 12px;
    }

    .aac-benefits-grid {
        gap: 10px;
        margin-top: 15px;
    }

    .aac-benefit-item {
        padding: 12px 8px;
    }

    .aac-benefit-icon {
        font-size: 24px;
        margin-bottom: 5px;
    }

    .aac-benefit-title {
        font-size: 14px;
        margin-bottom: 4px;
    }

    .aac-benefit-description {
        font-size: 11px;
        line-height: 1.3;
    }

    .aac-terms-section {
        margin-top: 0;
        padding: 20px 15px;
    }

    .aac-terms-header {
        font-size: 20px;
        margin-bottom: 15px;
    }
}

.aac-benefit-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.aac-benefit-icon {
    font-size: 36px;
    margin-bottom: 15px;
    display: block;
    color: #091546;
    line-height: 1;
}

.aac-benefit-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #091546;
}

.aac-benefit-description {
    font-size: 15px;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

/* ============================================
   Marketing Agreement Checkbox (v1.3.0)
   ============================================ */

.aac-marketing-agreement {
    margin: 20px 0;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.aac-marketing-agreement label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    margin: 0;
}

.aac-marketing-agreement input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.aac-marketing-agreement span {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.aac-marketing-agreement a {
    color: #3e86f8;
    text-decoration: underline;
}

.aac-marketing-agreement a:hover {
    color: #135e96;
}

/* ============================================
   Button Customization (v1.3.0)
   ============================================ */

.aac-submit-btn:hover {
    opacity: 0.9;
}

/* ============================================
   Static Program Details Content (v1.3.0)
   ============================================ */

.aac-static-details {
    line-height: 1.8;
    margin-bottom: 20px;
}

.aac-static-details p {
    margin: 15px 0;
}

.aac-static-details strong {
    color: #333;
    font-weight: 600;
}

.aac-static-details ul,
.aac-static-details ol {
    margin: 15px 0;
    padding-left: 30px;
}

.aac-static-details li {
    margin: 8px 0;
}

/* ============================================
   Enhanced Responsive (v1.3.0)
   ============================================ */

@media (max-width: 480px) {
    .aac-benefit-item {
        padding: 20px 15px;
    }

    .aac-benefit-icon {
        font-size: 28px;
    }

    .aac-benefit-title {
        font-size: 18px;
    }

    .aac-benefit-description {
        font-size: 14px;
    }

    .aac-marketing-agreement {
        padding: 12px;
    }

    .aac-marketing-agreement span {
        font-size: 13px;
    }
}

/* ============================================
   How Did You Hear Field Styling (v1.6.0)
   ============================================ */

/* Make "How did you hear" field span full width on desktop */
.aac-form-row.aac-full-width {
    grid-template-columns: 1fr;
    max-width: 600px; /* Match the form max-width */
}

/* Ensure the field and its container span the full available width */
.aac-form-row.aac-full-width .aac-form-group {
    width: 100%;
    max-width: 100%;
}

.aac-form-row.aac-full-width .aac-form-group input[type="text"] {
    width: 100% !important;
    max-width: 100% !important;
}

.aac-form-group .optional {
    color: #999;
    font-weight: normal;
    font-size: 13px;
}

/* ============================================
   Promotional Display Styles (v1.10.0)
   ============================================ */

/* Product Page Promotion */
.aac-product-promotion {
    background: linear-gradient(135deg, #091546 0%, #1e3a8a 100%);
    color: #fff;
    padding: 20px 25px;
    border-radius: 8px;
    margin: 25px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.aac-promotion-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.aac-promotion-icon {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    opacity: 0.9;
}

.aac-promotion-text {
    flex: 1;
}

.aac-promotion-text p {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.5;
}

.aac-promotion-link {
    display: inline-block;
    background: #fff;
    color: #091546;
    padding: 8px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    font-size: 14px;
}

.aac-promotion-link:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Checkout Page Promotion */
.aac-checkout-promotion {
    background: #fff;
    border: 2px solid #091546;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.aac-checkout-promotion h3 {
    margin: 0 0 15px 0;
    font-size: 22px;
    color: #091546;
    border-bottom: 2px solid #091546;
    padding-bottom: 10px;
}

.aac-checkout-promotion-message {
    font-size: 16px;
    color: #333;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.aac-checkout-signup-wrapper {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 6px;
}

.aac-checkout-signup-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    margin-bottom: 0;
}

.aac-checkout-signup-label input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.aac-checkout-signup-label span {
    font-size: 16px;
    font-weight: 600;
    color: #091546;
}

.aac-checkout-signup-fields {
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #ddd;
}

.aac-signup-notice {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.aac-signup-notice p {
    margin: 0;
    font-size: 14px;
    color: #856404;
}

.aac-signup-notice strong {
    color: #533f03;
}

.aac-marketing-consents {
    margin-bottom: 20px;
}

.aac-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    cursor: pointer;
}

.aac-consent-label input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.aac-consent-label span {
    font-size: 14px;
    color: #333;
    line-height: 1.6;
}

.aac-consent-label .required {
    color: #d63638;
    font-weight: bold;
}

.aac-additional-fields .form-row {
    margin-bottom: 15px;
}

.aac-additional-fields label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

.aac-additional-fields input[type="tel"],
.aac-additional-fields input[type="date"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Responsive Promotional Styles */
@media (max-width: 768px) {
    .aac-product-promotion {
        padding: 15px 20px;
    }

    .aac-promotion-content {
        flex-direction: column;
        text-align: center;
    }

    .aac-promotion-icon {
        width: 32px;
        height: 32px;
    }

    .aac-promotion-text p {
        font-size: 15px;
    }

    .aac-checkout-promotion {
        padding: 20px 15px;
    }

    .aac-checkout-promotion h3 {
        font-size: 20px;
    }

    .aac-checkout-signup-fields {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .aac-product-promotion {
        padding: 12px 15px;
    }

    .aac-promotion-text p {
        font-size: 14px;
    }

    .aac-promotion-link {
        font-size: 13px;
        padding: 6px 15px;
    }

    .aac-checkout-promotion {
        padding: 15px 12px;
    }

    .aac-checkout-promotion h3 {
        font-size: 18px;
    }

    .aac-checkout-signup-label span {
        font-size: 15px;
    }
}
