/**
 * TalentGro Razorpay Checkout - Frontend Styles
 */

/* Payment Button Base Styles */
.tgrc-payment-button {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
    line-height: 1.2;
    border: none;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tgrc-payment-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    opacity: 0.9;
}

.tgrc-payment-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tgrc-payment-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Loading State */
.tgrc-payment-button.tgrc-loading {
    position: relative;
    color: transparent !important;
}

.tgrc-payment-button.tgrc-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: tgrc-spin 0.75s linear infinite;
    color: white;
}

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

/* Button Size Variations */
.tgrc-payment-button.small {
    padding: 8px 16px;
    font-size: 14px;
    min-height: 36px;
}

.tgrc-payment-button.medium {
    padding: 12px 24px;
    font-size: 16px;
    min-height: 44px;
}

.tgrc-payment-button.large {
    padding: 16px 32px;
    font-size: 18px;
    min-height: 52px;
}

/* Message Notifications */
.tgrc-message {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 15px 20px;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 500;
    z-index: 10000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 300px;
    text-align: center;
    animation: tgrc-slideIn 0.3s ease-out;
}

@keyframes tgrc-slideIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

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

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

.tgrc-message-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* API Warning Messages */
.tgrc-api-warning {
    padding: 15px;
    margin: 15px 0;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tgrc-payment-button {
        width: 100%;
        display: block;
        padding: 14px 20px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .tgrc-message {
        left: 20px;
        right: 20px;
        transform: none;
        min-width: unset;
    }
}

@media (max-width: 480px) {
    .tgrc-payment-button {
        padding: 16px 20px;
        font-size: 16px;
    }
    
    .tgrc-message {
        top: 10px;
        left: 10px;
        right: 10px;
        padding: 12px 16px;
        font-size: 14px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .tgrc-message-success {
        background: #1e3a2e;
        color: #7dd87f;
        border-color: #2d5a3d;
    }
    
    .tgrc-message-error {
        background: #3a1e1e;
        color: #f87f7f;
        border-color: #5a2d2d;
    }
    
    .tgrc-message-warning {
        background: #3a351e;
        color: #f4d03f;
        border-color: #5a4d2d;
    }
    
    .tgrc-api-warning {
        background: #3a351e;
        color: #f4d03f;
        border-color: #5a4d2d;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .tgrc-payment-button {
        border: 2px solid currentColor;
        font-weight: 600;
    }
    
    .tgrc-message {
        border-width: 2px;
        font-weight: 600;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .tgrc-payment-button {
        transition: none;
    }
    
    .tgrc-payment-button:hover {
        transform: none;
    }
    
    .tgrc-payment-button.tgrc-loading::after {
        animation: none;
        border: 2px solid currentColor;
        border-radius: 0;
    }
    
    .tgrc-message {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .tgrc-payment-button {
        background: #f0f0f0 !important;
        color: #333 !important;
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
    
    .tgrc-payment-button::after {
        content: " (Payment Button)";
        font-size: 12px;
        font-style: italic;
    }
    
    .tgrc-message {
        position: static !important;
        transform: none !important;
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}

/* Focus Styles for Accessibility */
.tgrc-payment-button:focus {
    outline: 2px solid #005fcc;
    outline-offset: 2px;
}

/* Custom Properties for Easy Theming */
.tgrc-payment-button {
    --tgrc-button-radius: 4px;
    --tgrc-button-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --tgrc-button-hover-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    
    border-radius: var(--tgrc-button-radius);
    box-shadow: var(--tgrc-button-shadow);
}

.tgrc-payment-button:hover {
    box-shadow: var(--tgrc-button-hover-shadow);
}