/**
 * WooCommerce Venmo Payment Gateway Styles
 * Version: 1.1.1
 */

/* ================================
   FRONTEND THANK YOU PAGE STYLES
   ================================ */

.wph-wc-venmo-thank-you {
    padding: 2rem;
    background: #ffffff;
    border-radius: 12px;
    /* box-shadow: 0 4px 12px rgba(0,0,0,0.05); */
    font-family: 'Segoe UI', sans-serif;
    color: #333;
    /* border: 1px solid #cedbff; */
}

.woocommerce-order-venmo-instructions {
    max-width: 800px;
}

.woocommerce-order-venmo-instructions .wph-wc-venmo-thank-you {
    margin: 0px;
    padding: 0px;
    border: 0px;
    box-shadow: none;
    border-top: 1px solid #d3d9e4;
    border-radius: 0px;
    padding-top: 30px;
}

.wph-wc-venmo-thank-you .venmo-title {
    color: #333;
    margin-bottom: 10px;
    font-size: 36px;
    font-weight: 600;
    text-align: center;
    display: block;
}

.wph-wc-venmo-thank-you h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    text-align: center;
}
.wph-wc-venmo-thank-you .venmo-caption {
    font-size: 16px;
    margin-bottom: 1.5rem;
    text-align: center;
    display: block;
}

.venmo-button-container,
.venmo-qr-container {
    text-align: center;
    flex: 1;
}

.venmo-button-container p,
.venmo-qr-container p {
    margin-top: 15px;
    margin-bottom: 0;
    font-weight: 500;
    color: #666;
}

.venmo-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #131513;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s;
  flex-direction: row;
  align-items: center;
  gap: 3px;
}

.venmo-button span {
    color: #ffffff;
    font-size: 17px;
}

/* .venmo-button:hover {
  background: #2c7ab5;
} */

.venmo-button img {
  height: 24px;
}

.venmo-or-text {
    margin-top: 30px!important;
    margin-bottom: 5px!important;
    font-size: 16px;
    color: #333;
}
.venmo-qr-code {
    width: 200px;
    height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.venmo-qr-code.enlarged {
    transform: scale(1.5);
    transition: transform 0.3s ease;
    cursor: zoom-out;
}

.venmo-qr-code:not(.enlarged) {
    cursor: zoom-in;
    transition: transform 0.3s ease;
}

.venmo-summary {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 2rem;
    font-size: 0.95rem;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

.venmo-summary-item { 
    background: #fff;
    padding: 10px 20px;
    border-radius: 15px;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    border: 1px solid #a0c0e2;
}

.venmo-summary p {
    margin: 0.3rem 0;
}
.venmo-disclaimer {
    background: #fff3cd;
    border-left: 4px solid #ffeeba;
    padding: 1.5rem 1rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

.venmo-disclaimer p {
    margin: 0;
}

.venmo-notice {
    margin-top: 1.5rem;
}
.venmo-credits {
    text-align: center;
    margin-top: 2rem;
    font-size: 1rem;
    color: #888;
}
.venmo-credits a {
    color: #4493f8;
    text-decoration: underline;
}

.venmo-credits a:hover {
    text-decoration: underline;
}

.venmo-share-btn {
    background: #3d95ce;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    margin: 5px;
    transition: background-color 0.3s;
}

.venmo-share-btn:hover {
    background: #2980b9;
}

/* Payment confirmation */
.venmo-payment-confirmed {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-bottom: 20px;
    animation: slideInDown 0.5s ease-out;
}

.venmo-success-icon {
    font-size: 48px;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.2);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.venmo-payment-confirmed h3 {
    margin: 0 0 10px 0;
    font-size: 24px;
}

.venmo-payment-confirmed p {
    margin: 0;
    opacity: 0.9;
}

@media (max-width: 600px) {
    .venmo-button {
        flex-direction: row;
        gap: 0.25rem;
        padding: 1rem;
    }
    .venmo-button img {
        height: 32px;
    }
    .venmo-qr-code {
        width: 160px;
        height: 160px;
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ================================
   ADMIN INTERFACE STYLES
   ================================ */

/* Hide default WooCommerce settings table when using custom interface */
.venmo-admin-container ~ table.form-table {
    display: none;
}

/* Hide the standard settings form and only show our save button */
.woocommerce-save-button table.form-table {
    display: none !important;
}

/* Proper spacing for the save button */
.woocommerce-save-button {
    margin: 30px 0 20px 0 !important;
    padding: 20px 30px !important;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 0 0 8px 8px;
}

.woocommerce-save-button .submit {
    margin: 0 !important;
    padding: 0 !important;
}

.venmo-admin-container {
    max-width: 1200px;
    margin: 20px 0 0 0;
    background: #fff;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.venmo-header {
    background: linear-gradient(135deg, #3d95ce 0%, #2980b9 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.venmo-header h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 300;
}

.venmo-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.venmo-nav {
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    padding: 0;
    margin: 0;
    display: flex;
    overflow-x: auto;
}

/* Override WooCommerce core admin CSS that interferes with our nav */
body.woocommerce_page_wc-settings #mainform .venmo-nav,
body.woocommerce_page_wc-settings #mainform nav.venmo-nav {
    margin: 0 !important;
    padding: 0 !important;
}

/* Hide default WooCommerce settings table when using custom interface */
.venmo-admin-container ~ table.form-table {
    display: none;
}

.venmo-nav-item {
    flex: 1;
    min-width: 150px;
    text-align: center;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #6c757d;
    font-weight: 500;
    padding: 20px 10px;
    border-bottom: 3px solid transparent;
    position: relative;
}

.venmo-nav-item:hover {
    background: #e9ecef;
    color: #495057;
}

.venmo-nav-item.active {
    color: #3d95ce;
    border-bottom-color: #3d95ce;
    background: #fff;
}

.venmo-nav-item .nav-icon {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
}

.venmo-content {
    padding: 0;
}

.venmo-tab-panel {
    display: none;
    padding: 40px;
    min-height: 500px;
}

.venmo-tab-panel.active {
    display: block;
}

.venmo-section {
    text-align: center;
    margin: 1.5rem 0;
}

.venmo-section-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.venmo-section-icon {
    background: #3d95ce;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 18px;
}

.venmo-section h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
}

.venmo-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

.venmo-form-group {
    margin-bottom: 25px;
}

.venmo-form-group.full-width {
    grid-column: 1 / -1;
}

.venmo-label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.venmo-input, .venmo-textarea, .venmo-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.venmo-input:focus, .venmo-textarea:focus, .venmo-select:focus {
    outline: none;
    border-color: #3d95ce;
    box-shadow: 0 0 0 3px rgba(61, 149, 206, 0.1);
}

.venmo-textarea {
    min-height: 100px;
    resize: vertical;
}

.venmo-help-text {
    font-size: 13px;
    color: #6c757d;
    margin-top: 5px;
    line-height: 1.4;
}

.venmo-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
}

.venmo-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.venmo-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.venmo-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 26px;
}

.venmo-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .venmo-slider {
    background-color: #3d95ce;
}

input:checked + .venmo-slider:before {
    transform: translateX(24px);
}

.venmo-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
}

.venmo-highlight {
    background: linear-gradient(135deg, #e8f4f8 0%, #d1ecf1 100%);
    border: 1px solid #3d95ce;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.venmo-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    color: #856404;
}

.venmo-success {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    color: #0c5460;
}

.venmo-btn {
    background: #3d95ce;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 10px;
}

.venmo-btn:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    color: white;
    text-decoration: none;
}

.venmo-btn-secondary {
    background: #6c757d;
}

.venmo-btn-secondary:hover {
    background: #5a6268;
}

.venmo-btn-success {
    background: #28a745;
}

.venmo-btn-success:hover {
    background: #218838;
}

.venmo-webhook-url {
    background: #f8f9fa;
    border: 2px dashed #3d95ce;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 14px;
    word-break: break-all;
    margin: 15px 0;
    position: relative;
}

.venmo-webhook-url .copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #3d95ce;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.venmo-setup-option {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.venmo-setup-option-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.venmo-setup-option-header:hover {
    background: #e9ecef;
}

.venmo-setup-option-title {
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.venmo-setup-option-subtitle {
    color: #6c757d;
    font-size: 13px;
    margin: 5px 0 0 0;
}

.venmo-setup-option-toggle {
    font-size: 20px;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.venmo-setup-option.expanded .venmo-setup-option-toggle {
    transform: rotate(180deg);
}

.venmo-setup-option-content {
    padding: 20px;
    display: none;
}

.venmo-setup-option.expanded .venmo-setup-option-content {
    display: block;
}

.venmo-troubleshoot-item {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.venmo-troubleshoot-header {
    background: #f8f9fa;
    padding: 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e9ecef;
}

.venmo-troubleshoot-header:hover {
    background: #e9ecef;
}

.venmo-troubleshoot-title {
    font-weight: 500;
    color: #2c3e50;
    margin: 0;
}

.venmo-troubleshoot-content {
    padding: 15px;
    display: none;
}

.venmo-troubleshoot-item.expanded .venmo-troubleshoot-content {
    display: block;
}

.venmo-troubleshoot-item.expanded .venmo-troubleshoot-header {
    background: #e8f4f8;
}

.venmo-code-block {
    background: #2d3748;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 13px;
    overflow-x: auto;
    margin: 15px 0;
    position: relative;
}

.venmo-code-block .copy-code-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4a5568;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 11px;
    cursor: pointer;
}

.venmo-code-block pre {
    margin: 0;
    padding: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.4;
}

.venmo-radio-group {
    display: flex;
    gap: 20px;
    margin: 15px 0;
}

.venmo-radio-option {
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.venmo-radio-option:hover {
    border-color: #3d95ce;
    background: #f8f9fa;
}

.venmo-radio-option.selected {
    border-color: #3d95ce;
    background: #e8f4f8;
}

.venmo-radio-option input[type="radio"] {
    margin-right: 8px;
}

.venmo-radio-label {
    font-weight: 500;
    color: #2c3e50;
}

.venmo-radio-description {
    font-size: 13px;
    color: #6c757d;
    margin-top: 5px;
}

/* Enhanced form validation */
.venmo-input.error, 
.venmo-textarea.error, 
.venmo-select.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.venmo-error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Loading states */
.venmo-tab-panel.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.venmo-tab-panel.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 #3d95ce;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Status indicators */
.venmo-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.venmo-status-indicator.success {
    background: #d1ecf1;
    color: #0c5460;
}

.venmo-status-indicator.warning {
    background: #fff3cd;
    color: #856404;
}

.venmo-status-indicator.error {
    background: #f8d7da;
    color: #721c24;
}

.venmo-status-indicator.info {
    background: #d1ecf1;
    color: #0c5460;
}

/* ================================
   CHECKOUT STYLES
   ================================ */

.wc_payment_method.payment_method_venmo img {
    height: 24px;
    width: auto;
    vertical-align: middle;
    margin-left: 5px;
}

/* Loading state */
.venmo-loading {
    opacity: 0.6;
    pointer-events: none;
}

.venmo-loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #3d95ce;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ================================
   ACCESSIBILITY IMPROVEMENTS
   ================================ */

.venmo-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.venmo-nav-item:focus,
.venmo-btn:focus,
.venmo-input:focus,
.venmo-textarea:focus {
    outline: 2px solid #3d95ce;
    outline-offset: 2px;
}

.venmo-filters select:focus,
.venmo-filters button:focus {
    outline: 2px solid #3d95ce;
    outline-offset: 2px;
}

@media (max-width: 768px) {
    
    .venmo-filters {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .venmo-filters > * {
        margin: 0 0 10px 0 !important;
    }
}

/* ================================
   RESPONSIVE DESIGN
   ================================ */

@media (max-width: 1024px) {
    .venmo-form-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .venmo-payment-section {
        flex-direction: column;
        gap: 20px;
    }
    
    .wph-wc-venmo-thank-you {
        margin: 10px;
        padding: 15px;
    }
    
    .venmo-qr-code {
        max-width: 150px;
    }
    
    .venmo-modal {
        width: 95%;
        margin: 20px;
    }
    
    .venmo-modal-body {
        padding: 15px;
    }
    
    .venmo-qr-large img {
        max-width: 200px;
    }
    
    .venmo-nav {
        flex-direction: column;
    }
    
    .venmo-nav-item {
        min-width: auto;
    }
    
    .venmo-tab-panel {
        padding: 20px;
    }
    
    .venmo-header {
        padding: 20px;
    }
    
    .venmo-header h1 {
        font-size: 24px;
    }
    
    .venmo-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .venmo-section-icon {
        margin-right: 0;
    }
    
    .venmo-radio-group {
        flex-direction: column;
    }
    
    .woocommerce-save-button {
        padding: 15px 20px !important;
    }
}

/* ================================
   HIGH CONTRAST MODE SUPPORT
   ================================ */

@media (prefers-contrast: high) {
    .venmo-btn {
        border: 2px solid currentColor;
    }
    
    .venmo-nav-item.active {
        border: 2px solid #3d95ce;
    }
    
    .venmo-card {
        border: 2px solid currentColor;
    }
}

/* ================================
   PRINT STYLES
   ================================ */

@media print {
    .venmo-admin-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .venmo-nav {
        display: none;
    }
    
    .venmo-tab-panel {
        display: block !important;
        page-break-inside: avoid;
    }
    
    .venmo-btn {
        display: none;
    }
    
    .venmo-code-block {
        background: #f5f5f5 !important;
        color: #000 !important;
        border: 1px solid #ccc;
    }
    
    .woocommerce-save-button {
        display: none;
    }
}

/* ================================
   PAGINATION STYLES
   ================================ */

.venmo-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.venmo-pagination .button {
    background: #3d95ce;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.venmo-pagination .button:hover {
    background: #2980b9;
    color: white;
}

.venmo-pagination .button:disabled {
    background: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.venmo-checkbox-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 10px 0;
}

.venmo-checkbox-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    cursor: pointer;
    background: #edf1f5;
    transition: background-color 0.2s;
}