/**
 * Destiny Raffle Frontend Styles
 * Modern, responsive design with accessibility support
 */

/* Container and Layout */
.destiny-raffle-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.destiny-raffle-card {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1), 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.destiny-raffle-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Header Section */
.destiny-raffle-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    text-align: center;
}

.destiny-raffle-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.destiny-raffle-description {
    margin: 0;
    font-size: 1rem;
    opacity: 0.9;
    line-height: 1.5;
}

/* Form Styles */
.destiny-raffle-form {
    padding: 2rem;
}

.destiny-raffle-form-group {
    margin-bottom: 1.5rem;
}

.destiny-raffle-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #374151;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.destiny-raffle-label .required {
    color: #ef4444;
    font-weight: 700;
}

.destiny-raffle-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
    background-color: #ffffff;
    color: #374151;
    box-sizing: border-box;
}

.destiny-raffle-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.destiny-raffle-input:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.destiny-raffle-input:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

.destiny-raffle-help-text {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #6b7280;
    line-height: 1.4;
}

.destiny-raffle-error {
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: #ef4444;
    font-weight: 500;
    min-height: 1rem;
}

.destiny-raffle-error:empty {
    display: none;
}

/* Submit Button */
.destiny-raffle-submit {
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.destiny-raffle-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.destiny-raffle-submit:active:not(:disabled) {
    transform: translateY(0);
}

.destiny-raffle-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.destiny-raffle-submit-text {
    display: inline-block;
    transition: opacity 0.2s ease;
}

.destiny-raffle-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.destiny-raffle-spinner {
    width: 1rem;
    height: 1rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.destiny-raffle-status {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: center;
    min-height: 1rem;
}

.destiny-raffle-status:empty {
    display: none;
}

.destiny-raffle-status.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.destiny-raffle-status.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Footer Section */
.destiny-raffle-footer {
    background-color: #f9fafb;
    padding: 1.5rem 2rem;
    border-top: 1px solid #e5e7eb;
}

.destiny-raffle-prize-info {
    margin-bottom: 1.5rem;
}

.destiny-raffle-prize-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
}

.destiny-raffle-prize-info p {
    margin: 0;
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
}

/* Progress Bar */
.destiny-raffle-progress {
    margin-top: 1rem;
}

.destiny-raffle-progress-bar {
    width: 100%;
    height: 8px;
    background-color: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.destiny-raffle-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.destiny-raffle-progress-text {
    text-align: center;
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .destiny-raffle-container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .destiny-raffle-header {
        padding: 1.5rem;
    }
    
    .destiny-raffle-title {
        font-size: 1.5rem;
    }
    
    .destiny-raffle-form {
        padding: 1.5rem;
    }
    
    .destiny-raffle-footer {
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .destiny-raffle-header {
        padding: 1rem;
    }
    
    .destiny-raffle-title {
        font-size: 1.25rem;
    }
    
    .destiny-raffle-form {
        padding: 1rem;
    }
    
    .destiny-raffle-footer {
        padding: 1rem;
    }
    
    .destiny-raffle-input {
        padding: 0.625rem 0.875rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .destiny-raffle-submit {
        padding: 0.875rem 1.5rem;
    }
}

/* Accessibility Enhancements */
.destiny-raffle-input:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

.destiny-raffle-submit:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .destiny-raffle-card {
        border: 2px solid #000000;
    }
    
    .destiny-raffle-input {
        border-width: 2px;
    }
    
    .destiny-raffle-submit {
        border: 2px solid #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .destiny-raffle-card,
    .destiny-raffle-input,
    .destiny-raffle-submit,
    .destiny-raffle-progress-fill {
        transition: none;
    }
    
    .destiny-raffle-spinner {
        animation: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .destiny-raffle-container {
        color: #e5e7eb;
    }
    
    .destiny-raffle-card {
        background: #1f2937;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.2);
    }
    
    .destiny-raffle-input {
        background-color: #374151;
        border-color: #4b5563;
        color: #e5e7eb;
    }
    
    .destiny-raffle-input:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    }
    
    .destiny-raffle-label {
        color: #d1d5db;
    }
    
    .destiny-raffle-help-text {
        color: #9ca3af;
    }
    
    .destiny-raffle-footer {
        background-color: #111827;
        border-top-color: #374151;
    }
    
    .destiny-raffle-prize-info h3 {
        color: #d1d5db;
    }
    
    .destiny-raffle-prize-info p {
        color: #9ca3af;
    }
    
    .destiny-raffle-progress-bar {
        background-color: #374151;
    }
    
    .destiny-raffle-progress-text {
        color: #9ca3af;
    }
}

/* Loading States */
.destiny-raffle-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: #6b7280;
    font-style: italic;
}

.destiny-raffle-loading::before {
    content: '';
    width: 1rem;
    height: 1rem;
    border: 2px solid #e5e7eb;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

/* Success Animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.destiny-raffle-status.success {
    animation: successPulse 0.5s ease;
}

/* Error Shake Animation */
@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.destiny-raffle-status.error {
    animation: errorShake 0.5s ease;
}

/* Winners Display */
.destiny-raffle-winners-display {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.destiny-raffle-winners-header {
    text-align: center;
    margin-bottom: 30px;
}

.destiny-raffle-winners-title {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.destiny-raffle-winners-empty {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.destiny-raffle-winners-empty p {
    color: #6c757d;
    font-size: 16px;
    margin: 0;
}

/* Table Style */
.destiny-raffle-winners-table-wrapper {
    overflow-x: auto;
}

.destiny-raffle-winners-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.destiny-raffle-winners-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.destiny-raffle-winners-table td {
    padding: 15px;
    border-bottom: 1px solid #f1f3f4;
    font-size: 14px;
}

.destiny-raffle-winners-table tr:last-child td {
    border-bottom: none;
}

.destiny-raffle-winners-table tr:hover {
    background-color: #f8f9fa;
}

/* Card Style */
.destiny-raffle-winners-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.destiny-raffle-winner-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #e9ecef;
}

.destiny-raffle-winner-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.destiny-raffle-winner-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.destiny-raffle-winner-trophy {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

.destiny-raffle-winner-trophy .dashicons {
    font-size: 24px;
    color: #b8860b;
}

.destiny-raffle-winner-info h3 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
}

.destiny-raffle-winner-info p {
    margin: 0;
    color: #667eea;
    font-size: 14px;
    font-weight: 500;
}

.destiny-raffle-winner-card-footer {
    border-top: 1px solid #e9ecef;
    padding-top: 15px;
}

.destiny-raffle-winner-date {
    color: #6c757d;
    font-size: 12px;
    font-weight: 500;
}

/* Responsive Winners Display */
@media (max-width: 768px) {
    .destiny-raffle-winners-cards {
        grid-template-columns: 1fr;
    }
    
    .destiny-raffle-winners-table {
        font-size: 12px;
    }
    
    .destiny-raffle-winners-table th,
    .destiny-raffle-winners-table td {
        padding: 10px;
    }
} 