/**
 * Points Dashboard Template Styles
 * Clean, professional, theme-customizable styles.
 * Registered as 'zpcr_points_dashboard' and enqueued by includes/frontend/build-points-dashboard.php on the My Account "points-dashboard" endpoint.
 * Targets: .zp-rewards-dashboard, .welcome-section
 */

.zp-rewards-dashboard {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #f8f9fc;
    border-radius: 12px;
}

.welcome-section {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    margin-bottom: 30px;
}

.welcome-section h1 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
}

.welcome-section p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

/* Dog Profile Card */
.dog-profile-card {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 20px;
    margin-top: 25px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dog-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.dog-avatar {
    font-size: 32px;
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dog-avatar:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.dog-avatar .dog-photo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.dog-avatar .edit-overlay {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.dog-avatar:hover .edit-overlay {
    opacity: 1;
}

.dog-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    position: relative;
}

.dog-actions {
    position: absolute;
    top: 0;
    right: 0;
    display: flex;
    gap: 5px;
}

.edit-dog-btn, .remove-dog-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.edit-dog-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.remove-dog-btn:hover {
    background: rgba(239, 68, 68, 0.8);
    border-color: rgba(239, 68, 68, 0.9);
    transform: translateY(-1px);
}

.add-dog-section {
    margin-top: 20px;
    text-align: center;
}

.add-dog-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.add-dog-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

/* Multiple Dogs Pack Styles */
.dogs-pack-section {
    margin-bottom: 30px;
}

.pack-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 20px 0;
    text-align: center;
}

.dogs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Responsive adjustments for dogs grid */
@media (max-width: 768px) {
    .dogs-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (min-width: 1200px) {
    .dogs-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    }
}

.add-dog-section {
    text-align: center;
    margin: 20px 0;
}

.no-dog-info {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.no-dog-info h3 {
    margin: 0 0 10px 0;
    color: white;
    font-size: 18px;
}

.no-dog-info p {
    margin: 0 0 20px 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

/* Modal Styles */
.dog-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.close-modal {
    font-size: 24px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.close-modal:hover {
    opacity: 1;
}

.modal-content form {
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #374151;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #6b7280;
    font-size: 12px;
}

/* Disabled form fields styling */
.form-group input[disabled], 
.form-group input[readonly] {
    background-color: #f3f4f6;
    color: #6b7280;
    cursor: not-allowed;
    border-color: #d1d5db;
    opacity: 0.7;
}

.form-group input[disabled]:focus, 
.form-group input[readonly]:focus {
    border-color: #d1d5db;
    box-shadow: none;
}

.current-image img {
    border-radius: 8px;
    border: 2px solid #e1e5e9;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e1e5e9;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.dog-details h3 {
    margin: 0 0 5px 0;
    font-size: 20px;
    font-weight: 600;
    color: white;
}

.dog-details .dog-age {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
    color: white;
}

.dog-details .birthday-alert {
    margin: 5px 0 0 0;
    font-size: 14px;
    font-weight: 500;
    color: #ffd700;
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { opacity: 0.8; }
    to { opacity: 1; }
}

.dog-birthday {
    text-align: center;
    margin-top: 10px;
}

.dog-birthday small {
    font-size: 12px;
    opacity: 0.7;
    color: white;
}

.dashboard-stats {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    margin-bottom: 30px;
    align-items: center;
}

.points-circle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin: 0 auto;
    position: relative;
}

.points-number {
    font-size: 48px;
    font-weight: 700;
    color: #667eea;
    margin: 0;
    line-height: 1;
}

.points-label {
    font-size: 14px;
    color: #8e8e93;
    margin: 5px 0 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Stats right side container */
.stats-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Tier display */
.tier-display {
    text-align: center;
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.tier-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.tier-name {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: #333;
}

.tier-label {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* Points stats side by side */
.points-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    width: 100%;
    max-width: 500px;
}

.points-stat {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s ease;
}

.points-stat:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 24px;
    margin-bottom: 10px;
    display: block;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 5px 0;
    color: #333;
}

.stat-label {
    font-size: 12px;
    color: #8e8e93;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Tier colors */
.tier-vip { color: #f39c12; }
.tier-vvip { color: #e74c3c; }
.tier-premium { color: #9b59b6; }

/* Notification styles */
.coupon-notification, .birthday-notification {
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.coupon-notification {
    background: linear-gradient(135deg, #00b894 0%, #00cec9 100%);
}

.birthday-notification {
    background: linear-gradient(135deg, #fd79a8 0%, #fdcb6e 100%);
}

.coupon-content h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.coupon-code-display {
    background: rgba(255,255,255,0.2);
    padding: 10px 15px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 16px;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.copy-coupon-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.copy-coupon-btn:hover {
    background: rgba(255,255,255,0.3);
}

.birthday-content h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
}

.birthday-content p {
    margin: 0 0 15px 0;
    opacity: 0.9;
}

.claim-birthday-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.claim-birthday-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-1px);
}

.claim-birthday-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Activity section */
.activity-section {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.activity-header {
    padding: 25px 25px 15px 25px;
    border-bottom: none;
}

.activity-header h2 {
    margin: 0 0 20px 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Modern Tab-style Filter */
.activity-filters-tabs {
    display: flex;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 4px;
    margin: 0 25px 25px 25px;
    gap: 4px;
}

.filter-tab {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6c757d;
    text-align: center;
}

.filter-tab.active {
    background: #007bff;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.25);
}

.filter-tab:hover:not(.active) {
    background: #e9ecef;
    color: #495057;
}

/* Activity Container */
.activity-container {
    max-height: 500px;
    overflow-y: auto;
    padding: 0 25px 25px 25px;
}

/* Modern Activity Cards */
.activity-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    overflow: hidden;
}

.activity-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: #dee2e6;
}

.activity-card:last-child {
    margin-bottom: 0;
}

.activity-main {
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #212529;
    font-size: 16px;
}

.activity-meta {
    font-size: 13px;
    color: #6c757d;
    margin: 0;
}

.activity-points-section {
    text-align: right;
    min-width: 100px;
}

.points-change {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 4px 0;
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
}

.points-change.positive { 
    color: #198754;
    background: #d1e7dd;
}

.points-change.negative { 
    color: #dc3545;
    background: #f8d7da;
}

.activity-date {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
    font-weight: 500;
}

/* Filter functionality */
.activity-card[data-type="earned"]:not(.show-earned) {
    display: none;
}

.activity-card[data-type="redeemed"]:not(.show-redeemed) {
    display: none;
}

.activity-card.show-all {
    display: block;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    display: block;
}

.redeem-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin: 20px 0;
    transition: transform 0.2s ease;
}

.redeem-btn:hover {
    transform: translateY(-2px);
    color: white;
    text-decoration: none;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #8e8e93;
}

/* Responsive design */
@media (max-width: 768px) {
    .zp-rewards-dashboard {
        padding: 15px;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .points-stats {
        grid-template-columns: 1fr;
    }
    
    .coupon-notification, 
    .birthday-notification {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .activity-filters-tabs {
        margin: 0 15px 20px 15px;
        flex-direction: column;
        gap: 8px;
    }
    
    .filter-tab {
        padding: 12px 15px;
    }
    
    .activity-container {
        padding: 0 15px 20px 15px;
    }
    
    .activity-card {
        margin-bottom: 8px;
    }
    
    .activity-main {
        padding: 12px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .activity-points-section {
        align-self: flex-end;
        text-align: right;
        min-width: auto;
    }
    
    .activity-header {
        padding: 20px 15px 10px 15px;
    }
}