/* Stripe Digital Downloads Frontend Styles */

/* Container for the email input and button */
.sdd-payment-wrapper {
    max-width: 500px;
    margin: 30px auto;
    padding: 25px;
    background-color: #ffffff;
    border-radius: 10px;
    /*box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);*/
    /*border: 1px solid #eaeaea;*/
    text-align: center;
}

/* Email input field styling */
#sdd-user-email {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
    background-color: #fafafa;
}

#sdd-user-email:focus {
    outline: none;
    border-color: #006cd8;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(0, 108, 216, 0.1);
}

#sdd-user-email::placeholder {
    color: #999;
}

/* Proceed button styling */
.sdd-proceed-button {
    width: 100%;
    height: 52px;
    padding: 15px;
    font-size: 17px;
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #006cd8 0%, #0056b3 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.sdd-proceed-button:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004a99 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 108, 216, 0.2);
}

.sdd-proceed-button:active {
    transform: translateY(0);
}

.sdd-proceed-button:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Loading state */
.sdd-proceed-button.loading {
    position: relative;
    color: transparent;
}

.sdd-proceed-button.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: sdd-spin 0.8s linear infinite;
}

@keyframes sdd-spin {
    to { transform: rotate(360deg); }
}

/* Message display */
#sdd-message {
    padding: 15px;
    margin-top: 20px;
    border-radius: 6px;
    display: none;
    font-size: 14px;
}

#sdd-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

#sdd-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

#sdd-message.info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* Product info styling */
.sdd-product-info {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.sdd-product-title {
    font-size: 28px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 700;
}

.sdd-product-price {
    font-size: 24px;
    color: #006cd8;
    font-weight: 600;
}

.sdd-product-description {
    color: #666;
    line-height: 1.6;
    margin-top: 15px;
    font-size: 16px;
}

/* Download page styles */
.sdd-download-container {
    max-width: 600px;
    margin: 50px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.sdd-download-title {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
}

.sdd-download-button {
    display: inline-block;
    padding: 16px 40px;
    background: linear-gradient(135deg, #006cd8 0%, #0056b3 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 600;
    margin: 20px 0;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.sdd-download-button:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004a99 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 108, 216, 0.3);
}

.sdd-download-info {
    margin-top: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
    color: #666;
}

.sdd-download-info p {
    margin: 5px 0;
}

.sdd-download-expiry {
    color: #e74c3c;
    font-weight: 600;
}

/* Thank you page styles */
.sdd-thankyou-container {
    max-width: 600px;
    margin: 60px auto;
    padding: 40px;
    text-align: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.sdd-thankyou-icon {
    font-size: 60px;
    color: #27ae60;
    margin-bottom: 20px;
}

.sdd-thankyou-title {
    color: #333;
    font-size: 32px;
    margin-bottom: 15px;
}

.sdd-thankyou-message {
    color: #666;
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
}

/* Responsive styles */
@media (max-width: 768px) {
    .sdd-payment-wrapper,
    .sdd-download-container,
    .sdd-thankyou-container {
        margin: 20px auto;
        padding: 20px;
        width: 90%;
    }
    
    .sdd-product-title {
        font-size: 24px;
    }
    
    .sdd-product-price {
        font-size: 20px;
    }
    
    .sdd-proceed-button {
        height: 48px;
        font-size: 16px;
    }
}

/* Stripe Element styles */
.sdd-stripe-element {
    background: #fafafa;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    transition: border-color 0.3s ease;
}

.sdd-stripe-element.StripeElement--focus {
    border-color: #006cd8;
    box-shadow: 0 0 0 3px rgba(0, 108, 216, 0.1);
}

.sdd-stripe-element.StripeElement--invalid {
    border-color: #e74c3c;
}

.sdd-card-errors {
    color: #e74c3c;
    font-size: 14px;
    margin-top: -15px;
    margin-bottom: 20px;
}

/* Delivery type indicators */
.sdd-delivery-type-indicator {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 10px;
    vertical-align: middle;
}

.sdd-delivery-file {
    background: #e8f4ff;
    color: #006cd8;
    border: 1px solid #b3d7ff;
}

.sdd-delivery-link {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Product delivery info on frontend */
.sdd-product-delivery-info {
    margin: 15px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #006cd8;
}

.sdd-product-delivery-info h4 {
    margin-top: 0;
    color: #333;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sdd-delivery-icon {
    font-size: 18px;
    display: inline-block;
}

/* Download page styles for external links */
.sdd-external-download-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
}

.sdd-external-download-warning h3 {
    margin-top: 0;
    color: #856404;
}

.sdd-external-redirect-countdown {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    color: #006cd8;
    margin: 20px 0;
}

.sdd-manual-redirect {
    text-align: center;
    margin: 20px 0;
}

/* Single Product Template */
.sdd-single-product-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.sdd-product-image {
    margin-bottom: 30px;
    text-align: center;
}

.sdd-product-image img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    /*box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);*/
}

.sdd-product-details {
    /*background: #f9f9f9;*/
    /*padding: 30px;*/
    border-radius: 10px;
    /*margin-top: 30px;*/
    /*border: 1px solid #eaeaea;*/
}

.sdd-product-price h3 {
    color: #006cd8;
    font-size: 24px;
    margin-bottom: 20px;
}

.sdd-delivery-info {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #006cd8;
}

.sdd-delivery-info h4 {
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sdd-delivery-info .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.sdd-delivery-instructions {
    background: #fff3cd;
    padding: 15px;
    border-radius: 5px;
    margin-top: 15px;
    border-left: 4px solid #ffc107;
}

.sdd-product-categories {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eaeaea;
    color: #666;
}

.sdd-product-categories a {
    color: #006cd8;
    text-decoration: none;
}

.sdd-product-categories a:hover {
    text-decoration: underline;
}

/* Archive Template */
.sdd-products-archive {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.sdd-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.sdd-product-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sdd-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.sdd-product-thumbnail {
    display: block;
    overflow: hidden;
}

.sdd-product-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sdd-product-card:hover .sdd-product-thumbnail img {
    transform: scale(1.05);
}

.sdd-product-header {
    padding: 20px;
}

.sdd-product-title {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.sdd-product-title a {
    color: #333;
    text-decoration: none;
}

.sdd-product-title a:hover {
    color: #006cd8;
}

.sdd-product-price {
    color: #006cd8;
    font-size: 18px;
    font-weight: 600;
}

.sdd-product-excerpt {
    padding: 0 20px;
    color: #666;
    line-height: 1.6;
}

.sdd-product-footer {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #eaeaea;
}

.sdd-view-product {
    display: inline-block;
    padding: 10px 20px;
    background: #006cd8;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: 600;
    transition: background 0.3s ease;
}

.sdd-view-product:hover {
    background: #0056b3;
}

/* No products message */
.no-products-found {
    text-align: center;
    padding: 60px 20px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 2px dashed #eaeaea;
}

.no-products-found p {
    font-size: 18px;
    color: #666;
}