/**
 * PFP Shortcodes Styles
 */

/* --- Points History --- */
.clantopf-history-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}
.clantopf-history-table th,
.clantopf-history-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}
.clantopf-history-table th {
    background: #f5f5f5;
    font-weight: bold;
}
.clantopf-points.positive {
    color: #46b450;
    font-weight: bold;
}
.clantopf-points.negative {
    color: #dc3232;
    font-weight: bold;
}

/* --- Card Code Only --- */
.clantopf-card-code-only.clantopf-styled {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
}
.clantopf-card-code-only.clantopf-styled .clantopf-code-text {
    font-family: 'Courier New', monospace;
    font-size: 1.2em;
    font-weight: bold;
    color: #2271b1;
    background: white;
    padding: 8px 15px;
    border-radius: 4px;
}
.clantopf-card-code-only.clantopf-styled .clantopf-copy-btn {
    background: #2271b1;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}
.clantopf-card-code-only.clantopf-styled .clantopf-copy-btn:hover {
    background: #135e96;
}

/* --- Full Card Display --- */
.clantopf-card-display.clantopf-styled {
    max-width: 500px;
    margin: 20px auto;
    padding: 30px;
    background: var(--clantopf-gradient, linear-gradient(135deg, #667eea 0%, #764ba2 100%));
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    color: white;
}
.clantopf-card-display.clantopf-styled .clantopf-card-header h3 {
    margin: 0 0 15px 0;
    color: white;
    font-size: 1.5em;
}
.clantopf-card-display.clantopf-styled .clantopf-card-balance {
    font-size: 1.2em;
    margin-bottom: 20px;
}
.clantopf-card-display.clantopf-styled .clantopf-balance-amount {
    font-size: 2em;
    font-weight: bold;
    margin: 0 5px;
}
.clantopf-card-display.clantopf-styled .clantopf-card-code-section {
    background: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.clantopf-card-display.clantopf-styled .clantopf-card-number {
    font-size: 1.3em;
    letter-spacing: 2px;
    color: white;
    background: transparent;
    font-family: 'Courier New', monospace;
}
.clantopf-card-display.clantopf-styled .clantopf-copy-code {
    background: white;
    color: var(--clantopf-color, #667eea);
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
}
.clantopf-card-display.clantopf-styled .clantopf-copy-code:hover {
    background: #f0f0f0;
}
/* --- Card Layout (2 columns desktop, stacked mobile) --- */
.clantopf-card-layout-wrapper {
    display: flex;
    gap: 20px;
    margin-top: 20px;
}
.clantopf-card-col-left {
    flex: 1;
    min-width: 0;
}
.clantopf-card-col-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    min-width: 0;
}
.clantopf-wallet-buttons-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}
.clantopf-wallet-buttons-stack .clantopf-wallet-btn img {
    display: block;
    max-width: 100%;
}

@media (max-width: 600px) {
    .clantopf-card-layout-wrapper {
        flex-direction: column;
    }
    .clantopf-card-col-left, .clantopf-card-col-right {
        width: 100%;
    }
}
.clantopf-card-display.clantopf-styled .clantopf-qr-section,
.clantopf-card-display.clantopf-styled .clantopf-barcode-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}
.clantopf-card-display.clantopf-styled .clantopf-qr-section h4,
.clantopf-card-display.clantopf-styled .clantopf-barcode-section h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1em;
}
.clantopf-card-display.clantopf-styled svg {
    display: inline-block;
}

/* --- Redeem Form --- */
.clantopf-redeem-form.clantopf-styled {
    max-width: 500px;
    margin: 20px auto;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #ddd;
}
.clantopf-redeem-form.clantopf-styled h3 {
    margin-top: 0;
    color: #333;
}
.clantopf-redeem-form .clantopf-form-group {
    margin-bottom: 20px;
}
.clantopf-redeem-form .clantopf-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}
.clantopf-redeem-form .clantopf-code-input {
    width: 100%;
    padding: 12px;
    font-size: 1em;
    border: 2px solid #ddd;
    border-radius: 5px;
    text-transform: uppercase;
    box-sizing: border-box;
}
.clantopf-redeem-form .clantopf-code-input:focus {
    outline: none;
    border-color: var(--clantopf-color, #0d9488);
}
.clantopf-redeem-form .clantopf-submit-btn {
    width: 100%;
    padding: 15px;
    background: var(--clantopf-color, #0d9488);
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}
.clantopf-redeem-form .clantopf-submit-btn:hover {
    background: #0a6f66;
}
.clantopf-redeem-form .clantopf-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}
.clantopf-redeem-form .clantopf-redeem-message {
    margin-top: 15px;
}
.clantopf-redeem-form .clantopf-message {
    padding: 15px;
    border-radius: 5px;
}
.clantopf-redeem-form .clantopf-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.clantopf-redeem-form .clantopf-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- Points Badge with Icon --- */
.clantopf-points-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--clantopf-color, #0d9488);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(13, 148, 136, 0.3);
    transition: all 0.3s ease;
}

.clantopf-points-badge .clantopf-badge-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.clantopf-points-badge .clantopf-badge-text {
    line-height: 1;
}

.clantopf-badge-clickable {
    cursor: pointer;
    border: none;
    font-family: inherit;
    animation: clantopf-pulse 2s ease-in-out infinite;
}

.clantopf-badge-clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    animation: none;
}

.clantopf-badge-clickable:active {
    transform: translateY(0);
}

@keyframes clantopf-pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }
}

/* --- Card Popup Modal --- */
.clantopf-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    padding: 20px;
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.clantopf-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.clantopf-popup-modal {
    background: white;
    border-radius: 16px;
    max-width: 600px;
    width: 95%;
    max-height: 95vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-sizing: border-box;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.clantopf-popup-overlay.active .clantopf-popup-modal {
    transform: scale(1);
}

.clantopf-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    color: white;
    border-radius: 16px 16px 0 0;
    background: var(--clantopf-color, #0d9488);
}

.clantopf-popup-header h3 {
    margin: 0;
    font-size: 1.5em;
    font-weight: 600;
}

.clantopf-popup-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 28px;
    line-height: 1;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clantopf-popup-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

.clantopf-popup-body {
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    overflow-x: hidden;
    background: #ffffff;
}

.clantopf-popup-qr {
    text-align: center;
    width: 100%;
}

#clantopf-popup-qrcode {
    display: flex;
    justify-content: center;
    align-items: center;
}

.clantopf-popup-barcode {
    text-align: center;
    width: 100%;
    max-width: 400px;
    background: #f8f9fa;
    border-radius: 12px;
    box-sizing: border-box;
    overflow: hidden;
}

#clantopf-popup-barcode-svg {
    display: flex;
    justify-content: center;
    align-items: center;
    max-width: 100%;
}

#clantopf-popup-barcode-svg svg {
    max-width: 100%;
    height: auto;
}

.clantopf-popup-wallet-buttons {
    display: flex;
    flex-direction: row;
    gap: 12px;
    justify-content: center;
    width: 100%;
    flex-wrap: wrap;
}

.clantopf-popup-wallet-buttons .clantopf-wallet-btn {
    flex: 0 0 auto;
    max-width: 200px;
}

.clantopf-popup-wallet-buttons .clantopf-wallet-btn img {
    width: 100%;
    height: auto;
    display: block;
}

.clantopf-popup-user-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    gap: 16px;
}

.clantopf-popup-name {
    font-size: 1.1em;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.clantopf-popup-points-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--clantopf-color, #0d9488);
    color: white;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
}

.clantopf-popup-points-badge svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

@media (max-width: 600px) {
    .clantopf-popup-header {
        padding: 20px;
    }
    
    .clantopf-popup-header h3 {
        font-size: 1.2em;
    }
    
    .clantopf-popup-body {
        padding: 20px 16px;
    }
    
    .clantopf-popup-user-info {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .clantopf-popup-wallet-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .clantopf-popup-wallet-buttons .clantopf-wallet-btn {
        max-width: 250px;
    }
    
    .clantopf-points-badge {
        font-size: 12px;
    }
    
    .clantopf-points-badge .clantopf-badge-icon {
        display: none;
    }
    
    .clantopf-points-badge .clantopf-badge-text {
        text-align: center;
    }
}
