/* AI Story Maker Public Styles for API Gateway */

/* WordPress Admin Wrapper Styles */
.wp-admin .wrap {
    margin: 10px 0 0 2px;
    max-width: none;
}

.wp-admin .wrap h1 {
    font-size: 23px;
    font-weight: 400;
    margin: 0;
    padding: 9px 0 4px 0;
    line-height: 1.3;
}

.wp-admin .wrap h2 {
    font-size: 1.3em;
    margin: .83em 0;
}

/* WordPress Admin Nav Tab Styles */
.wp-admin .nav-tab-wrapper {
    border-bottom: 1px solid #c3c4c7;
    margin: 16px 0;
    padding-top: 0;
}

.wp-admin .nav-tab {
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-bottom: none;
    color: #50575e;
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    margin: 0 5px -1px 0;
    padding: 8px 12px;
    text-decoration: none;
    transition: background-color .1s ease-in-out;
}

.wp-admin .nav-tab:hover {
    background-color: #fff;
    color: #135e96;
}

.wp-admin .nav-tab-active,
.wp-admin .nav-tab-active:hover {
    background-color: #fff;
    border-bottom-color: #fff;
    color: #000;
}

/* WordPress Admin Form Table Styles */
.wp-admin .form-table {
    border-collapse: collapse;
    margin-top: 0.5em;
    width: 100%;
    clear: both;
}

.wp-admin .form-table td {
    margin-bottom: 9px;
    padding: 15px 10px;
    line-height: 1.3;
    vertical-align: middle;
}

.wp-admin .form-table th {
    color: #23282d;
    font-weight: 600;
    text-align: left;
    padding: 20px 10px 20px 0;
    width: 200px;
    vertical-align: top;
}

.wp-admin .form-table th label {
    font-weight: 600;
}

/* WordPress Admin Button Styles */
.wp-admin .button {
    border: 1px solid #2271b1;
    border-radius: 3px;
    background: #2271b1;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    text-decoration: none;
    font-size: 13px;
    line-height: 2.15384615;
    min-height: 30px;
    margin: 0;
    padding: 0 10px;
    text-shadow: none;
    font-weight: 400;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.2), 0 1px 0 rgba(0,0,0,.15);
    vertical-align: top;
}

.wp-admin .button:hover {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

.wp-admin .button-primary {
    background: #2271b1;
    border-color: #2271b1;
    color: #fff;
    text-shadow: none;
}

.wp-admin .button-primary:hover {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

.wp-admin .button-secondary {
    background: #f6f7f7;
    border-color: #dcdcde;
    color: #50575e;
}

.wp-admin .button-secondary:hover {
    background: #f0f0f1;
    border-color: #c3c4c7;
    color: #000;
}

/* Main container styles - WordPress Admin compatible */
.exaig-subscribe {
    max-width: none;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    background: #fff;
}

/* WordPress admin specific overrides */
.wp-admin .exaig-subscribe h1 {
    font-size: 23px;
    font-weight: 400;
    margin: 0;
    padding: 9px 0 4px 0;
    line-height: 1.3;
    color: #23282d;
    text-align: left;
}

.wp-admin .exaig-subscribe h2 {
    font-size: 14px;
    font-weight: 600;
    margin: 16px 0;
    color: #23282d;
    text-align: left;
}

/* WordPress Admin Form styles */
#exaig-subscribe-form {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 0;
    padding: 20px;
    box-shadow: none;
    margin-bottom: 20px;
}

.form-section {
    margin-bottom: 25px;
    padding-bottom: 0;
    border-bottom: none;
}

/* WordPress Admin Form Field Styles */
.wp-admin .form-field {
    margin-bottom: 20px;
}

.wp-admin .form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #23282d;
}

.wp-admin .form-field input[type="text"],
.wp-admin .form-field input[type="email"],
.wp-admin .form-field select {
    border: 1px solid #ddd;
    border-radius: 3px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.07);
    background-color: #fff;
    color: #32373c;
    outline: 0;
    transition: .05s border-color ease-in-out;
    font-size: 14px;
    line-height: 2;
    padding: 0 8px;
    min-height: 30px;
    max-width: 25rem;
    width: 100%;
}

.wp-admin .form-field input[type="text"]:focus,
.wp-admin .form-field input[type="email"]:focus,
.wp-admin .form-field select:focus {
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

#exaig-subscribe-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

#exaig-subscribe-form input[type="text"],
#exaig-subscribe-form input[type="email"] {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

#exaig-subscribe-form input[type="text"]:focus,
#exaig-subscribe-form input[type="email"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#exaig-subscribe-form input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* Domain display styles */
.domain-display .email-display {
    margin-bottom: 20px;
}

.domain-display label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.domain-value .email-value{
    display: inline-block;
    padding: 10px 15px;
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    color: #2c3e50;
    font-weight: 600;
    font-family: monospace;
    font-size: 14px;
}

/* Domain and email on same line */
.domain-email-line {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 20px;
}

.domain-display,
.email-display {
    flex: 1;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.domain-display label,
.email-display label {
    display: inline-block;
    margin-bottom: 0;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
    white-space: nowrap;
}

.domain-value,
.email-value {
    display: inline-block;
    padding: 4px 8px;
    background: #f6f7f7;
    border: 1px solid #c3c4c7;
    border-radius: 3px;
    color: #23282d;
    font-weight: 400;
    font-family: monospace;
    font-size: 13px;
}

.email-display input[type="email"] {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.email-display input[type="email"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* WordPress Admin Package selection container */
.package-selection-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.package-options {
    flex: 1;
    display: flex;
    flex-direction: row;
    gap: 15px;
    flex-wrap: wrap;
}

/* Make all package option boxes the same size */
.package-option {
    flex: 1;
    min-width: 250px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
}

/* WordPress Admin Metabox Style for Description Panel */
.package-description-panel {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 0;
    padding: 20px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    min-height: 200px;
    display: flex;
    flex-direction: column;
}

.package-description-panel h3 {
    font-size: 14px;
    margin: 0 0 15px 0;
    padding: 0;
    color: #23282d;
    font-weight: 600;
    border-bottom: 1px solid #c3c4c7;
    padding-bottom: 10px;
}

#package-description-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    flex-grow: 1;
}

.package-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.select-package-message {
    text-align: center;
    color: #95a5a6;
    font-style: italic;
    margin-top: 150px;
    font-size: 16px;
}

/* WordPress Admin Package option styles */
.package-option {
    position: relative;
    margin-bottom: 10px;
}

.package-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
    margin: 0;
}

/* Visual selection state on the card when the hidden radio is checked */
.package-option input[type="radio"]:checked + .package-option-label {
    outline: 2px solid #2271b1;
    outline-offset: 0;
    border-color: #2271b1;
    background: #f6f7f7;
}

/* Keyboard focus style when tabbing to label */
.package-option-label:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

.package-option-label {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 25px;
    border: 2px solid #e1e1e1;
    border-radius: 12px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    margin-top: 0;
    min-height: 350px;
    justify-content: flex-start;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

/* Top accent bar to match Page1 */
.package-option-label::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ef06d4, #20c997);
}

.package-option input[type="radio"]:checked + .package-option-label {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15), 0 8px 16px rgba(0, 0, 0, 0.08);
}

.package-option-label:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.15);
    border-color: #0073aa;
}

.package-option-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.package-option-header h3 {
    font-size: 14px;
    font-weight: 600;
    color: #23282d;
    margin: 0;
    line-height: 1.4;
}

.package-option-header .package-price {
    font-size: 14px;
    font-weight: 600;
    color: #2271b1;
}

/* Package content styling */
.package-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 10px;
}

.package-option-label .package-credits {
    font-size: 12px;
    color: #50575e;
    background: #f6f7f7;
    padding: 3px 6px;
    border-radius: 3px;
    display: inline-block;
    border: 1px solid #c3c4c7;
    align-self: flex-start;
}

.package-tagline {
    font-size: 12px;
    color: #646970;
    font-style: italic;
    margin: 0;
    line-height: 1.4;
}

.package-features {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 11px;
    color: #50575e;
    flex: 1;
}

.package-features li {
    padding: 2px 0;
    position: relative;
    padding-left: 15px;
    line-height: 1.4;
}

.package-features li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #00a32a;
    font-weight: bold;
    font-size: 10px;
}

.package-disclaimer {
    font-size: 10px;
    color: #8c8f94;
    font-style: italic;
    margin: 5px 0 0 0;
    padding: 5px;
    background: #f6f7f7;
    border-radius: 3px;
    border-left: 3px solid #dba617;
    line-height: 1.3;
}

.package-disclaimer small {
    font-size: inherit;
}

/* Package action section */
.package-action-section {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #c3c4c7;
}

.package-select-button {
    width: 100%;
    text-align: center;
    font-size: 12px;
    padding: 6px 12px;
    min-height: 28px;
    line-height: 1.5;
}

/* Subscribed package styles */
.package-subscribed .package-option-label {
    background: #f8f9fa;
    border-color: #95a5a6;
    opacity: 0.8;
}

.package-subscribed .package-option-label:hover {
    border-color: #95a5a6;
    transform: none;
}

.package-subscribed input[type="radio"]:checked + .package-option-label {
    border-color: #95a5a6;
    background: #ecf0f1;
    box-shadow: 0 2px 8px rgba(149, 165, 166, 0.2);
    transform: none;
}

.package-subscribed-badge {
    display: block;
    font-size: 11px;
    color: #00a32a;
    background: #d5f4e6;
    padding: 4px 8px;
    border-radius: 3px;
    margin-top: 8px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    border: 1px solid #00a32a;
}

.package-renewal-info {
    display: block;
    font-size: 11px;
    color: #00a32a;
    background: #d5f4e6;
    padding: 3px 6px;
    border-radius: 3px;
    margin-top: 4px;
    text-align: center;
    font-weight: 500;
    border: 1px solid #00a32a;
}

/* Future plan styles */
.package-future .package-option-label {
    background: #fff3cd;
    border-color: #ffc107;
    opacity: 0.9;
}

.package-future .package-option-label:hover {
    border-color: #ffc107;
    transform: translateY(-1px);
}

.package-future input[type="radio"]:checked + .package-option-label {
    border-color: #ffc107;
    background: #fff8e1;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
    transform: translateY(-2px);
}

.package-future-badge {
    display: block;
    font-size: 11px;
    color: #856404;
    background: #fff3cd;
    padding: 3px 6px;
    border-radius: 3px;
    margin-top: 8px;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
}

.package-future-info {
    display: block;
    font-size: 10px;
    color: #856404;
    background: #fff3cd;
    padding: 2px 6px;
    border-radius: 3px;
    margin-top: 4px;
    text-align: center;
    font-weight: 500;
}

.package-future-notice {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
}

.future-start-date {
    color: #856404;
    font-weight: 600;
    font-size: 13px;
}

/* Cancel subscription section */
.cancel-subscription-section {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
}

.cancel-subscription-section h3 {
    margin-top: 0;
    color: #2c3e50;
    font-size: 18px;
}

.cancel-subscription-section p {
    margin: 10px 0;
    color: #555;
}

.cancel-subscription-section .button-secondary {
    background: #dc3545;
    border-color: #dc3545;
    color: #fff;
}

.cancel-subscription-section .button-secondary:hover {
    background: #c82333;
    border-color: #bd2130;
}

.renewal-date {
    color: #27ae60;
    font-weight: 600;
    font-size: 13px;
}

.package-subscribed-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 15px;
    text-align: center;
}

/* Form actions */
.form-actions {
    margin-top: 30px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
}

.form-actions .button {
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
}

.form-actions .button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* Individual package styles */
.exaig-package {
    flex: 0 0 350px;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    padding: 25px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin: 10px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.exaig-package:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    border-color: #3498db;
}

.exaig-package h3 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    color: #2c3e50;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.exaig-package .package-tagline {
    font-size: 14px;
    color: #7f8c8d;
    text-align: center;
    margin-bottom: 15px;
    font-style: italic;
}

.exaig-package .package-separator {
    text-align: center;
    color: #bdc3c7;
    margin: 15px 0;
    font-size: 12px;
}

.exaig-package .package-description {
    font-size: 14px;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.exaig-package .package-features {
    margin: 20px 0;
    padding: 0;
    list-style: none;
}

.exaig-package .package-features li {
    padding: 5px 0;
    font-size: 13px;
    color: #555;
    position: relative;
    padding-left: 20px;
}

.exaig-package .package-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

.exaig-package .package-disclaimer {
    font-size: 11px;
    color: #95a5a6;
    font-style: italic;
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #e74c3c;
}

.package-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #ecf0f1;
    border-bottom: 1px solid #ecf0f1;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px;
}

.package-price {
    font-size: 20px;
    color: #2c3e50;
    font-weight: 700;
}

.package-credits {
    font-size: 13px;
    color: #7f8c8d;
    background: #ecf0f1;
    padding: 6px 10px;
    border-radius: 4px;
    font-weight: 600;
}

.package-status {
    font-size: 12px;
    color: #27ae60;
    font-weight: 600;
    text-transform: uppercase;
}

.exaig-package strong {
    color: #2c3e50;
    font-size: 18px;
}

/* Package meta information */
.exaig-package-meta {
    font-size: 13px;
    color: #777;
    margin-top: 15px;
}

.exaig-package-meta span {
    display: block;
    margin-top: 5px;
}

/* Button styles */
.exaig-package button,
.button.button-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 15px;
}

.exaig-package button:hover,
.button.button-primary:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* Free package special styling */
.exaig-package:has(button[value*="free"]) {
    border-color: #27ae60;
}

.exaig-package:has(button[value*="free"])::before {
    background: linear-gradient(90deg, #27ae60, #2ecc71);
}

.exaig-package:has(button[value*="free"]) button {
    background: linear-gradient(135deg, #27ae60, #229954);
}

.exaig-package:has(button[value*="free"]) button:hover {
    background: linear-gradient(135deg, #229954, #1e8449);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

/* Responsive design */
@media (max-width: 768px) {
    .exaig-subscribe {
        padding: 20px 10px;
    }
    
    .exaig-subscribe h2 {
        font-size: 2em;
        margin-bottom: 30px;
    }
    
    .domain-email-line {
        flex-direction: column;
        gap: 15px;
    }
    
    .domain-display,
    .email-display {
        flex: none;
        width: 100%;
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .domain-display label,
    .email-display label {
        display: block;
        margin-bottom: 5px;
        white-space: normal;
    }
    
    .domain-value,
    .email-value {
        width: 100%;
        flex: none;
    }
    
    .package-selection-container {
        flex-direction: column;
        gap: 20px;
    }
    
    .package-options {
        flex-direction: column;
        gap: 10px;
    }
    
    .package-option {
        max-width: none;
        min-width: auto;
    }
    
    .package-description-panel {
        min-height: 300px;
    }
    
    .select-package-message {
        margin-top: 100px;
    }
    
    #exaig-subscribe-form {
        padding: 20px;
    }
}

/* Loading states */
.exaig-package button:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
}

/* Success/Error messages */
.notice {
    padding: 15px;
    margin: 20px 0;
    border-radius: 6px;
    border-left: 4px solid;
}

.notice-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

.notice-error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

.notice-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* Additional utility classes */
.text-center {
    text-align: center;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

/* Animation for package cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.exaig-package {
    animation: fadeInUp 0.6s ease-out;
}

.exaig-package:nth-child(1) { animation-delay: 0.1s; }
.exaig-package:nth-child(2) { animation-delay: 0.2s; }
.exaig-package:nth-child(3) { animation-delay: 0.3s; }
.exaig-package:nth-child(4) { animation-delay: 0.4s; } 

.package-option .cancel-subscription-section {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e1e8ed;
    text-align: center;
}

.package-option .cancel-subscription-section .button-secondary {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.package-option .cancel-subscription-section .button-secondary:hover {
    background: #c0392b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.3);
}

/* Only show cancel button on subscribed packages */
.package-option:not(.package-subscribed) .cancel-subscription-section {
    display: none;
}

/* Package button container in description panel */
.package-button-container {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #e1e8ed;
    text-align: center;
    flex-shrink: 0;
}

.package-action-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 15px 40px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
    display: block;
}

.package-action-button:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

.package-action-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
} 