/* Membership Page Styles */
#membership-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Membership Section */
.membership-section {
    margin-bottom: 40px;
}

.membership-header {
    text-align: center;
    margin-bottom: 40px;
}

.membership-header h1 {
    color: #000000;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.membership-header .subtitle {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

/* Plan Card */
.plan-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(234, 68, 53, 0.1);
    border: 2px solid #f0f0f0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.plan-card:hover {
    box-shadow: 0 12px 48px rgba(234, 68, 53, 0.15);
    border-color: #ea4435;
    transform: translateY(-2px);
}

.plan-header {
    background: linear-gradient(135deg, #ea4435 0%, #ff6b5a 100%);
    color: #ffffff;
    padding: 30px;
    text-align: center;
}

.plan-icon svg {
    color: #ffd052;
    margin-bottom: 15px;
}

.plan-header h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.plan-price {
    margin: 15px 0;
}

.daily-price {
    display: block;
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.annual-price {
    display: block;
    font-size: 2.2rem;
    font-weight: 700;
    color: #ffd052;
}

.plan-description {
    font-size: 1rem;
    opacity: 0.9;
    margin: 15px 0 0 0;
}

/* Benefits Section */
.plan-benefits {
    padding: 0;
}

.benefits-toggle {
    padding: 20px 30px;
    border-bottom: 1px solid #f0f0f0;
}

.benefits-btn {
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ea4435;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.benefits-btn:hover {
    color: #d63384;
}

.benefits-btn .chevron {
    transition: transform 0.3s ease;
}

.benefits-btn.expanded .chevron {
    transform: rotate(180deg);
}

.benefits-list {
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
    background: #fafafa;
}

.benefits-list.expanded {
    max-height: 500px;
    padding: 20px 30px;
}

.benefit-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    padding: 12px;
    background: #ffffff;
    border-radius: 8px;
    border-left: 3px solid #ea4435;
}

.benefit-item:last-child {
    margin-bottom: 0;
}

.benefit-item.special {
    border-left-color: #ffd052;
    background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
}

.check-icon, .star-icon {
    color: #ea4435;
    flex-shrink: 0;
    margin-top: 2px;
}

.benefit-item.special .star-icon {
    color: #ffd052;
}

.benefit-item span {
    color: #333;
    line-height: 1.5;
}

.benefit-item.special span {
    font-style: italic;
    color: #666;
}

/* WebView Back Button */
.webview-back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: none;
}

.webview-back-button.show {
    display: block;
    animation: slideInLeft 0.3s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.back-btn {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-btn:hover {
    background: rgba(234, 68, 53, 0.9);
    transform: translateX(-2px);
}

.back-btn svg {
    flex-shrink: 0;
}

/* PayPal WebView Specific Styles */
.paypal-link.loading-state {
    opacity: 0.8;
    cursor: wait;
    transform: none !important;
}

.paypal-link .spinner {
    animation: spin 1s linear infinite;
}

/* WebView Detection Indicators */
.webview-indicator {
    display: none;
    position: fixed;
    top: 10px;
    right: 10px;
    background: rgba(234, 68, 53, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 1000;
}

body.webview .webview-indicator {
    display: block;
}

/* Action Buttons */
.plan-actions {
    padding: 30px;
}

.action-buttons {
    display: grid;
    gap: 15px;
    grid-template-columns: 1fr 1fr;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    text-align: center;
}

.btn-primary {
    background: #ea4435;
    color: #ffffff;
    border-color: #ea4435;
}

.btn-primary:hover {
    background: #d63384;
    border-color: #d63384;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #ffffff;
    color: #ea4435;
    border-color: #ea4435;
}

.btn-secondary:hover {
    background: #ea4435;
    color: #ffffff;
    transform: translateY(-1px);
}

.btn-icon {
    flex-shrink: 0;
}

/* Bank Transfer Section */
.bank-transfer-section {
    margin-top: 40px;
    animation: slideInUp 0.5s ease;
}

.bank-transfer-section.hidden {
    display: none;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bank-details-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    color: #ffffff;
    padding: 30px;
    text-align: center;
}

.card-header h3 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.card-header p {
    opacity: 0.9;
    margin: 0;
}

/* Bank Information */
.bank-info {
    padding: 30px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.bank-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #ffffff;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 4px solid #ea4435;
}

.bank-item:last-child {
    margin-bottom: 0;
}

.bank-item label {
    font-weight: 600;
    color: #333;
    min-width: 140px;
}

.bank-value {
    color: #666;
    font-weight: 500;
}

.account-number-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.account-number {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    font-size: 1.1rem;
    color: #ea4435;
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.copy-btn {
    background: #ea4435;
    color: #ffffff;
    border: none;
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-btn:hover {
    background: #d63384;
    transform: scale(1.05);
}

.copy-btn.copied {
    background: #28a745;
}

/* Upload Instruction */
.upload-instruction {
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.instruction-icon {
    color: #ea4435;
    margin-bottom: 15px;
}

.upload-instruction p {
    font-size: 1.1rem;
    color: #333;
    font-weight: 500;
    margin: 0;
}

/* Registration Form */
.registration-form {
    padding: 30px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-group input,
.form-group select {
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #ea4435;
    box-shadow: 0 0 0 3px rgba(234, 68, 53, 0.1);
}

/* File Upload */
.file-upload-area {
    border: 2px dashed #e9ecef;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.file-upload-area:hover {
    border-color: #ea4435;
    background: rgba(234, 68, 53, 0.02);
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-content {
    pointer-events: none;
}

.upload-icon {
    color: #ea4435;
    margin-bottom: 15px;
}

.upload-text p {
    margin: 5px 0;
}

.upload-text strong {
    color: #ea4435;
}

.upload-info {
    color: #666;
    font-size: 0.9rem;
}

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.file-info.hidden {
    display: none;
}

.file-name {
    color: #333;
    font-weight: 500;
}

.remove-file {
    background: #dc3545;
    color: #ffffff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Form Actions */
.form-actions {
    margin-top: 30px;
    text-align: center;
}

.form-actions .btn {
    min-width: 200px;
    position: relative;
}

.btn-loading {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-loading.hidden {
    display: none;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Success Message */
.success-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease;
}

.success-message.hidden {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.success-content {
    background: #ffffff;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideInScale 0.4s ease;
}

@keyframes slideInScale {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.success-icon {
    color: #28a745;
    margin-bottom: 20px;
}

.success-content h3 {
    color: #333;
    font-size: 1.5rem;
    margin: 0 0 15px 0;
}

.success-content p {
    color: #666;
    line-height: 1.6;
    margin: 15px 0;
}

.success-content strong {
    color: #ea4435;
}

/* WebView and Mobile App Optimizations */
body.webview {
    /* Prevent zoom and improve touch experience */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

body.webview input,
body.webview select,
body.webview textarea {
    /* Re-enable selection for form fields */
    -webkit-user-select: auto;
    user-select: auto;
}

/* Improve touch targets for mobile */
body.webview .btn {
    min-height: 44px; /* iOS recommended touch target size */
    min-width: 44px;
}

body.webview .copy-btn {
    min-height: 44px;
    min-width: 44px;
}

body.webview .benefits-btn {
    min-height: 44px;
    padding: 12px 20px;
}

/* Safe area handling for devices with notches */
@supports (padding: max(0px)) {
    .webview-back-button {
        top: max(20px, env(safe-area-inset-top));
        left: max(20px, env(safe-area-inset-left));
    }
    
    #membership-container {
        padding-top: max(20px, env(safe-area-inset-top));
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    #membership-container {
        padding: 15px;
    }
    
    .membership-header h1 {
        font-size: 2rem;
    }
    
    .plan-header {
        padding: 20px;
    }
    
    .plan-header h2 {
        font-size: 1.5rem;
    }
    
    .annual-price {
        font-size: 1.8rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .bank-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .account-number-container {
        width: 100%;
        justify-content: space-between;
    }
    
    .bank-info,
    .registration-form {
        padding: 20px;
    }
    
    .benefits-list.expanded {
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
    
    .file-upload-area {
        padding: 20px;
    }
    
    .upload-icon {
        width: 36px;
        height: 36px;
    }
    
    .success-content {
        margin: 20px;
        padding: 30px;
    }
    
    .membership-header h1 {
        font-size: 1.8rem;
    }
}

/* Enhanced File Upload States */
.file-upload-area.drag-active {
    border-color: #ea4435;
    background: rgba(234, 68, 53, 0.05);
    transform: scale(1.02);
}

.file-upload-area.dragover {
    border-color: #ea4435;
    background: rgba(234, 68, 53, 0.05);
}

/* Form Validation States */
.form-group input.invalid,
.form-group select.invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.file-upload-area.invalid {
    border-color: #dc3545;
    background: rgba(220, 53, 69, 0.05);
}

.field-error {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.field-error::before {
    content: "⚠";
    font-size: 0.75rem;
}

/* Real-time validation states */
.form-group input.loading {
    border-color: #ffd052;
    box-shadow: 0 0 0 3px rgba(255, 208, 82, 0.1);
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><circle cx="8" cy="8" r="6" stroke="%23ffd052" stroke-width="2" fill="none"><animateTransform attributeName="transform" type="rotate" from="0 8 8" to="360 8 8" dur="1s" repeatCount="indefinite"/></circle></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
}

.form-group input.success {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
    background-image: url('data:image/svg+xml;charset=UTF-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path d="M13.33 4.67L11.67 3L6.5 8.17L4.33 6L2.67 7.67L6.5 11.5L13.33 4.67Z" fill="%2328a745"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 16px;
}

.field-success {
    color: #28a745;
    font-size: 0.875rem;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.field-success::before {
    content: "✓";
    font-size: 0.75rem;
}

.form-group.focused {
    position: relative;
}

.form-group.focused::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid #ea4435;
    border-radius: 8px;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

/* Error Notification */
.error-notification {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    border-left: 4px solid #ffffff;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.error-notification:hover {
    cursor: pointer;
    background: #c82333;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-20 {
    margin-top: 20px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Focus and Accessibility */
.btn:focus,
button:focus,
input:focus,
select:focus {
    outline: 2px solid #ea4435;
    outline-offset: 2px;
}

.btn:focus {
    box-shadow: 0 0 0 3px rgba(234, 68, 53, 0.2);
}

/* Animation for interactive elements */
.btn,
.copy-btn,
.benefits-btn,
.file-upload-area {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Loading states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.form-group input:invalid {
    border-color: #dc3545;
}

.form-group input:valid {
    border-color: #28a745;
}

/* Terms and Privacy Policy Styles */
.checkbox-container {
    display: flex;
    align-items: flex-start;
    margin: 25px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.checkbox-container.error {
    border-color: #dc3545;
    background: #fff5f5;
}

.checkbox-container input[type="checkbox"] {
    width: 20px;
    margin-right: 15px;
    margin-top: 3px;
    transform: scale(1.2);
}

.checkbox-container label {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.checkbox-container label a {
    color: #ea4435;
    text-decoration: none;
    font-weight: 500;
}

.checkbox-container label a:hover {
    text-decoration: underline;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 12px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    position: relative;
}

.modal-content h2 {
    color: #ea4435;
    font-size: 1.8rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ea4435;
}

.modal-content h4 {
    color: #333;
    font-size: 1.1rem;
    margin: 20px 0 10px 0;
    font-weight: 600;
}

.modal-content ul {
    margin: 15px 30px;
    padding-left: 0;
}

.modal-content ul li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.modal-content p {
    line-height: 1.6;
    margin-bottom: 15px;
}

.modal .close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
    transition: color 0.3s ease;
}

.modal .close:hover,
.modal .close:focus {
    color: #ea4435;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
        max-height: 85vh;
    }
    
    .modal-content h2 {
        font-size: 1.5rem;
        padding-right: 30px;
    }
    
    .checkbox-container {
        padding: 15px;
    }
    
    .checkbox-container label {
        font-size: 13px;
    }
}
