/*!
 * Redemption Giveaway System CSS
 * Version: 1.0.6 - Enhanced Mobile Winners Display
 * Scoped to shortcode only - No site interference
 */

/* Import font only when needed */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* SCOPE ALL STYLES TO REDEMPTION WRAPPER ONLY */
.redemption-wrapper {
    font-family: 'Inter', sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    align-items: start;
    position: relative;
    background: transparent;
    /* Remove any background interference */
}

.redemption-wrapper * {
    box-sizing: border-box;
}

/* Main Form Container - Beautiful but Simple */
.redemption-wrapper .redemption-container {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
}

/* Add subtle top border for elegance */
.redemption-wrapper .redemption-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 16px 16px 0 0;
}

.redemption-wrapper .redemption-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
}

.redemption-wrapper .redemption-title {
    color: #1a202c;
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.redemption-wrapper .redemption-subtitle {
    color: #4a5568;
    font-size: 1rem;
    font-weight: 400;
}

/* Form Styling */
.redemption-wrapper .redemption-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.redemption-wrapper .form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.redemption-wrapper .form-label {
    color: #2d3748;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.redemption-wrapper .form-input {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #2d3748;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
    width: 100%;
}

.redemption-wrapper .form-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.redemption-wrapper .form-input::placeholder {
    color: #a0aec0;
}

/* Beautiful Inline 3-Box Code Input */
.redemption-wrapper .code-input-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 8px 0;
    flex-wrap: nowrap;
}

.redemption-wrapper .code-box {
    width: 90px;
    height: 55px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    font-size: 18px;
    font-weight: 600;
    font-family: 'Inter', monospace;
    text-align: center;
    letter-spacing: 2px;
    color: #2d3748;
    transition: all 0.2s ease;
    outline: none;
}

.redemption-wrapper .code-box:focus {
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.redemption-wrapper .code-box:hover:not(:focus) {
    border-color: #cbd5e0;
    background: #ffffff;
}

.redemption-wrapper .code-box.filled {
    border-color: #38a169;
    background: #f0fff4;
    color: #1a202c;
}

.redemption-wrapper .code-box.error {
    border-color: #e53e3e;
    background: #fed7d7;
}

.redemption-wrapper .code-separator {
    font-size: 16px;
    font-weight: bold;
    color: #a0aec0;
    user-select: none;
    margin: 0 2px;
}

/* Buttons */
.redemption-wrapper .form-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.redemption-wrapper .submit-btn {
    flex: 1;
    padding: 16px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
}

.redemption-wrapper .submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.redemption-wrapper .submit-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.redemption-wrapper .login-btn {
    background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.2);
}

/* Loading State */
.redemption-wrapper .loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Messages */
.redemption-wrapper .error-message {
    color: #e53e3e;
    font-size: 0.85rem;
    font-weight: 500;
    display: none;
    text-align: center;
    margin-top: 6px;
}

.redemption-wrapper .error-message.show {
    display: block;
}

.redemption-wrapper .result-message {
    padding: 14px 18px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    display: none;
    margin-top: 16px;
}

.redemption-wrapper .result-message.success {
    background: #c6f6d5;
    color: #22543d;
    border: 1px solid #68d391;
}

.redemption-wrapper .result-message.error {
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #f56565;
}

/* Winners Section - Enhanced for Better Display */
.redemption-wrapper .winners-section {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
    max-height: 80vh; /* Increased height */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Winners top border */
.redemption-wrapper .winners-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #38a169, #48bb78);
    border-radius: 16px 16px 0 0;
}

.redemption-wrapper .winners-title {
    color: #1a202c;
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 2px solid #f7fafc;
    background: linear-gradient(135deg, #38a169, #48bb78);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.redemption-wrapper .winners-list-container {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.redemption-wrapper .winners-list {
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 transparent;
    margin-bottom: 12px;
    /* Remove height restriction for better display */
}

.redemption-wrapper .winners-list::-webkit-scrollbar {
    width: 4px;
}

.redemption-wrapper .winners-list::-webkit-scrollbar-track {
    background: transparent;
}

.redemption-wrapper .winners-list::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 2px;
}

/* Winner items - NO HOVER EFFECTS */
.redemption-wrapper .winner-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 8px;
    margin-bottom: 6px;
    border-left: 3px solid #667eea;
    /* REMOVED ALL HOVER EFFECTS */
}

.redemption-wrapper .winner-item:nth-child(even) {
    background: #edf2f7;
}

.redemption-wrapper .winner-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.redemption-wrapper .winner-user {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.85rem;
}

.redemption-wrapper .winner-zone {
    font-size: 0.75rem;
    color: #718096;
}

.redemption-wrapper .winner-prize {
    font-weight: 600;
    color: #667eea;
    font-size: 0.8rem;
    background: white;
    padding: 3px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.redemption-wrapper .winner-time {
    font-size: 0.7rem;
    color: #a0aec0;
    text-align: right;
}

/* Enhanced View More Winners Button */
.redemption-wrapper .winners-pagination {
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.redemption-wrapper .see-more-btn {
    background: linear-gradient(135deg, #38a169, #48bb78);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(56, 161, 105, 0.2);
}

.redemption-wrapper .see-more-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.3);
}

.redemption-wrapper .see-more-btn:disabled {
    background: #a0aec0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.redemption-wrapper .loading-winners,
.redemption-wrapper .no-winners {
    text-align: center;
    padding: 30px 20px;
    color: #718096;
    font-size: 0.9rem;
}

/* Success Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
}

.modal-content {
    background: white;
    margin: 10% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
}

.close-modal {
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    background: none;
    border: none;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 28px;
    text-align: center;
    color: #2d3748;
    line-height: 1.5;
}

/* ENHANCED MOBILE RESPONSIVE - Better Winners Display */
@media (max-width: 768px) {
    .redemption-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 15px;
    }
    
    /* IMPORTANT: Form shows first on mobile */
    .redemption-wrapper .redemption-container {
        order: 1;
        padding: 24px;
    }
    
    .redemption-wrapper .winners-section {
        order: 2; /* Winners show BELOW form on mobile */
        max-height: 70vh; /* Better mobile height - increased from 60vh */
        padding: 20px; /* Slightly less padding on mobile */
    }
    
    .redemption-wrapper .winners-list {
        max-height: 55vh; /* Better scrollable area - increased from previous */
        min-height: 300px; /* Ensure minimum height for better UX */
    }
    
    .redemption-wrapper .winner-item {
        padding: 12px 16px; /* Slightly more padding for touch */
        margin-bottom: 8px; /* More spacing between items */
    }
    
    .redemption-wrapper .winner-user {
        font-size: 0.9rem; /* Slightly larger on mobile */
    }
    
    .redemption-wrapper .winner-prize {
        font-size: 0.85rem; /* Slightly larger on mobile */
        padding: 4px 8px;
    }
    
    .redemption-wrapper .winner-time {
        font-size: 0.75rem; /* Slightly larger on mobile */
    }
    
    .redemption-wrapper .redemption-title {
        font-size: 1.8rem;
    }
    
    .redemption-wrapper .code-input-container {
        gap: 8px;
        justify-content: center;
    }
    
    .redemption-wrapper .code-box {
        width: 75px;
        height: 50px;
        font-size: 16px;
        letter-spacing: 1px;
    }
    
    .redemption-wrapper .code-separator {
        font-size: 14px;
        margin: 0 1px;
    }
    
    .redemption-wrapper .form-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .redemption-wrapper .redemption-container {
        padding: 20px;
    }
    
    .redemption-wrapper .redemption-title {
        font-size: 1.6rem;
    }
    
    .redemption-wrapper .code-input-container {
        gap: 6px;
    }
    
    .redemption-wrapper .code-box {
        width: 65px;
        height: 45px;
        font-size: 14px;
    }
    
    .redemption-wrapper .code-separator {
        font-size: 12px;
    }
    
    .redemption-wrapper .winners-section {
        max-height: 65vh; /* Adjust for smaller screens */
    }
    
    .redemption-wrapper .winners-list {
        max-height: 50vh;
        min-height: 250px;
    }
}

/* Very small screens */
@media (max-width: 360px) {
    .redemption-wrapper .code-box {
        width: 55px;
        height: 40px;
        font-size: 13px;
    }
    
    .redemption-wrapper .winner-item {
        padding: 10px 12px;
    }
    
    .redemption-wrapper .winners-section {
        max-height: 60vh;
    }
    
    .redemption-wrapper .winners-list {
        max-height: 45vh;
        min-height: 200px;
    }
}

/* Error states */
.redemption-wrapper .form-input.error {
    border-color: #e53e3e;
    background: #fed7d7;
}

.redemption-wrapper .form-input.success {
    border-color: #38a169;
    background: #f0fff4;
}

/* Cache buster - v1.0.6 - Enhanced Mobile Winners Display */
