/**
 * Public CSS styles for WP Code Redemption.
 *
 * @since      1.0.0
 * @package    WP_Code_Redemption
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700&display=swap');

/* Container */
.wpcr-redemption-container {
    max-width: 600px;
    margin: 30px auto;
    font-family: 'DM Sans';
    color: #162187;
}

/* Form */
.wpcr-redemption-form {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.wpcr-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.6em;
    font-weight: 600;
    color: #162187;
    text-align: center;
}

/* Input Group */
.wpcr-input-group {
    margin-bottom: 20px;
}

.wpcr-input-group label {
    display: none;
    margin-bottom: 8px;
    font-weight: 500;
    color: #162187;
}

.wpcr-code-input {
    width: 100%;
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    box-sizing: border-box;
}

/* Buttons */
.wpcr-button {
    display: inline-block;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    border: none;
    border-radius: 22px;
    transition: background-color 0.3s, transform 0.1s;
    background-color: #5881e8;
    color: white;
}

.wpcr-validate-button {
    background-color: #5881e8;
    color: white;
    width: 100%;
}

.wpcr-validate-button:hover {
    background-color: #F1A12E;
}

.wpcr-redeem-button {
    background-color: #5881e8;
    color: white;
}

.wpcr-redeem-button:hover {
    background-color: #F1A12E;
}

.wpcr-button:active {
    transform: scale(0.98);
}

.wpcr-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Messages */
.wpcr-message {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 14px;
}

.wpcr-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wpcr-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Code Details */
.wpcr-code-details {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.wpcr-details-row {
    display: flex;
    margin-bottom: 12px;
}

.wpcr-detail-label {
    width: 30%;
    font-weight: 600;
    color: #162187;
}

.wpcr-detail-value {
    width: 70%;
    color: #162187;
}

/* Redemption Success */
.wpcr-redemption-success {
    text-align: center;
    padding: 20px;
    background-color: #d4edda;
    border-radius: 4px;
}

.wpcr-success-icon {
    font-size: 48px;
    color: #28a745;
    margin-bottom: 15px;
}

.wpcr-success-message {
    font-size: 18px;
    color: #162187;
    font-weight: 500;
}

/* Status Colors */
.wpcr-status-valid {
    color: #162187;
    font-weight: 600;
}

.wpcr-status-redeemed {
    color: #162187;
    font-weight: 600;
}

.wpcr-status-expired {
    color: #162187;
    font-weight: 600;
}

/* Redeem Container */
.wpcr-redeem-container {
    margin-top: 20px;
    text-align: center;
}

/* ==========================================================================
   Category Statistics Shortcode (added v1.2.0)
   ========================================================================== */
.wpcr-cat-stats {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 1.5em 0;
}

.wpcr-cat-stats-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 .75em;
}

.wpcr-cat-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.wpcr-cat-stat {
    background: #f7f7f9;
    border: 1px solid #e6e6ea;
    border-radius: 10px;
    padding: 18px 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wpcr-cat-stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.1;
    color: #1a1a1a;
}

.wpcr-cat-stat-label {
    font-size: .8rem;
    font-weight: 500;
    color: #666;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* Subtle accent colours per metric */
.wpcr-cat-stat--redeemed .wpcr-cat-stat-value { color: #00843d; }
.wpcr-cat-stat--available .wpcr-cat-stat-value { color: #2271b1; }
.wpcr-cat-stat--expired .wpcr-cat-stat-value { color: #b32d2e; }

.wpcr-stats-error {
    color: #b32d2e;
    font-style: italic;
}
