/*
 * Frontend-specific stylesheet for RR License Manager.
 *
 * @package RR_License_Manager
 */

/* --- Card Layout --- */
.rr-cards-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
	margin-bottom: 2em;
}

.rr-card {
    background-color: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.rr-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.rr-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #f8f8f8;
    border-bottom: 1px solid #e5e5e5;
	flex-wrap: wrap;
    gap: 1rem;
}

.rr-card__title {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    line-height: 1.4;
}

.rr-card__title a {
    text-decoration: none;
    color: inherit;
}

.rr-card__body {
    padding: 1.5rem;
    display: grid;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .rr-card__body {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

.rr-card__detail {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rr-card__detail--license-key .rr-card__detail-value {
    word-break: break-all;
    background-color: #f9f9f9;
    padding: 0.5rem;
    border-radius: 4px;
    font-family: monospace;
}

.rr-card__detail-label {
    font-size: 0.85em;
    color: #666;
    font-weight: 600;
}

.rr-card__detail-value {
    font-size: 1em;
}

.rr-card__footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background-color: #f8f8f8;
    border-top: 1px solid #e5e5e5;
}

.rr-card__footer .button {
    margin: 0;
}

/* --- Status Badges --- */
.rr-lm-status-badge {
    display: inline-block;
    padding: .3em .8em;
    font-size: .8em;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 20px;
    color: #fff;
    text-transform: capitalize;
}

.rr-lm-status-active,
.rr-lm-status-available {
    background-color: #28a745; /* Green */
}

.rr-lm-status-inactive,
.rr-lm-status-on-hold {
    background-color: #ffc107; /* Yellow */
    color: #212529;
}

.rr-lm-status-expired,
.rr-lm-status-cancelled {
    background-color: #dc3545; /* Red */
}

.rr-lm-status-revoked {
	background-color: #6c757d; /* Gray */
}

.rr-lm-status-sold,
.rr-lm-status-returned,
.rr-lm-status-redeemed {
    background-color: #17a2b8; /* Blue */
}

/* Styles for Thank You page License Keys section */
.woocommerce-order-licenses {
    margin-top: 2em;
    border: 1px solid #e5e5e5;
    padding: 2em;
    background-color: #fff;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
	border-radius: 8px;
}

.woocommerce-order-licenses__title {
    font-size: 1.5em;
    margin-top: 0;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #eee;
}

/* --- Modal Styles --- */
.rr-lic-modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    -webkit-animation: fadeIn 0.3s;
    animation: fadeIn 0.3s;
}

.rr-lic-modal-content {
    background-color: #fefefe;
    margin: 15% auto;
    padding: 20px 30px 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-radius: 4px;
    text-align: center;
    -webkit-animation: slideIn 0.3s;
    animation: slideIn 0.3s;
}

.rr-lic-modal-content h2 {
    margin-top: 0;
    font-size: 1.5em;
}

.rr-lic-modal-content p {
    margin: 1em 0 1.5em;
}

.rr-lic-modal-actions .button {
    margin: 0 10px;
}

.rr-lic-modal-actions .button-primary {
    background-color: #a46497 !important;
    border-color: #a46497 !important;
    color: #fff !important;
}

.rr-lic-modal-actions .button-secondary {
    background-color: #eee !important;
    border-color: #eee !important;
    color: #333 !important;
}

@-webkit-keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@-webkit-keyframes slideIn {
    from { top: -100px; opacity: 0; }
    to { top: 0; opacity: 1; }
}

@keyframes slideIn {
    from { margin-top: 0; opacity: 0; }
    to { margin-top: 15%; opacity: 1; }
}


/*
 * Custom styles for WooCommerce notices
 */
.woocommerce-error {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border-left: 5px solid #f5c6cb !important;
    padding: 1em 1.5em !important;
    border-radius: 5px;
    margin-bottom: 2em !important;
}

.woocommerce-error a.button {
    background-color: #721c24 !important;
    color: #fff !important;
    margin-left: 1em;
    border-radius: 3px;
    padding: 0.5em 1em;
    text-decoration: none;
}

.woocommerce-error a.button:hover {
    background-color: #5a161b !important;
}