/* Reward Codes System - Frontend Styles */

.reward-codes-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.reward-codes-header {
    text-align: center;
    margin-bottom: 30px;
}

.reward-codes-header h2 {
    color: #0073aa;
    margin-bottom: 10px;
    font-size: 28px;
}

.reward-codes-header p {
    color: #666;
    font-size: 16px;
}

.login-required {
    text-align: center;
    padding: 20px;
    background: #f0f0f0;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.login-required a {
    color: #0073aa;
    text-decoration: none;
    font-weight: bold;
}

.login-required a:hover {
    text-decoration: underline;
}

.user-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 15px;
    background: linear-gradient(135deg, #f9f9f9 0%, #e9ecef 100%);
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.user-points {
    font-size: 18px;
}

.points-label {
    color: #666;
    margin-right: 10px;
}

.points-value {
    font-weight: bold;
    color: #0073aa;
    font-size: 24px;
    background: #fff;
    padding: 5px 10px;
    border-radius: 20px;
    border: 2px solid #0073aa;
}

.cooldown-info {
    color: #ff6b00;
    font-weight: bold;
    background: #fff3cd;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ffeaa7;
}

.code-input-section {
    margin-bottom: 30px;
}

.code-input-section h3 {
    color: #333;
    margin-bottom: 20px;
    font-size: 20px;
}

.reward-form {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s, box-shadow 0.3s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.submit-button {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    padding: 14px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.submit-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a87 0%, #004466 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.submit-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.form-message {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    font-weight: bold;
    text-align: center;
}

.form-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.form-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.hints-section {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #ffeaa7;
}

.hints-section h3 {
    margin-top: 0;
    color: #856404;
    font-size: 18px;
    margin-bottom: 20px;
}

.hints-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hint-item {
    background: white;
    padding: 20px;
    border-radius: 6px;
    border-left: 4px solid #ffc107;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.hint-item:hover {
    transform: translateX(5px);
}

.hint-item p {
    margin: 8px 0;
    line-height: 1.5;
}

.hint-item strong {
    color: #856404;
    font-weight: 600;
}

/* Shop Styles */
.reward-shop-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.shop-header {
    text-align: center;
    margin-bottom: 40px;
}

.shop-header h2 {
    color: #0073aa;
    margin-bottom: 10px;
    font-size: 32px;
}

.shop-header p {
    color: #666;
    font-size: 18px;
}

.rewards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-bottom: 50px;
}

.reward-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.reward-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0073aa, #28a745);
}

.reward-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.reward-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f8f9fa;
}

.reward-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
    font-weight: 600;
}

.reward-cost {
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 14px;
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.3);
}

.reward-description {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.6;
    font-size: 15px;
}

.reward-details {
    margin-bottom: 25px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.reward-type {
    background: #e9ecef;
    color: #495057;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reward-value {
    background: #d1ecf1;
    color: #0c5460;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: bold;
    font-size: 14px;
}

.purchase-button {
    width: 100%;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.purchase-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.3);
}

.purchase-button.disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.no-rewards {
    text-align: center;
    padding: 60px 20px;
    color: #666;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}

.purchase-history {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-top: 40px;
    border: 1px solid #e9ecef;
}

.purchase-history h3 {
    margin-top: 0;
    color: #333;
    font-size: 24px;
    margin-bottom: 25px;
}

.purchases-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.purchase-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: box-shadow 0.3s;
}

.purchase-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.purchase-info h4 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 18px;
}

.purchase-info p {
    margin: 4px 0;
    color: #666;
    font-size: 14px;
}

.purchase-date {
    font-size: 12px !important;
    color: #999 !important;
}

.status-pending {
    color: #ff6b00;
    font-weight: bold;
    background: #fff3cd;
    padding: 4px 8px;
    border-radius: 4px;
}

.status-completed {
    color: #28a745;
    font-weight: bold;
    background: #d4edda;
    padding: 4px 8px;
    border-radius: 4px;
}

.status-cancelled {
    color: #dc3545;
    font-weight: bold;
    background: #f8d7da;
    padding: 4px 8px;
    border-radius: 4px;
}

.status-unknown {
    color: #6c757d;
    font-weight: bold;
    background: #e2e3e5;
    padding: 4px 8px;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .reward-codes-container {
        margin: 10px;
        padding: 15px;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .rewards-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .reward-shop-container {
        padding: 15px;
    }
    
    .purchase-item {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

/* Animation for new elements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reward-card, .hint-item, .purchase-item {
    animation: fadeInUp 0.5s ease-out;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
