:root {
    --sp-dark-blue: #0f172a;
    --sp-navy-blue: #1e293b;
    --sp-accent-blue: #2563eb;
    --sp-dark-red: #8b0000;
    --sp-bright-red: #e00000;
    --sp-hover-red: #a00000;
}

/* Horizontal Filter Topbar Container */
.sp-reviews-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 15px;
    margin-bottom: 24px;
    background: #ffffff;
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    border: 1px solid #e2e8f0;
}

.sp-filter-form {
    margin: 0;
}

/* Horizontal Dropdown Row */
.sp-filter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: nowrap;
}

.sp-filter-select {
    padding: 8px 14px;
    font-size: 13px;
    color: var(--sp-dark-blue);
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    min-width: 140px;
    height: 38px;
    box-sizing: border-box;
}

.sp-filter-select:focus,
.sp-filter-select:hover {
    border-color: var(--sp-dark-red);
    box-shadow: 0 0 0 3px rgba(139, 0, 0, 0.1);
}

/* Write Review Button Alignment */
.sp-top-actions {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.sp-write-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 38px;
    padding: 0 18px;
    background: linear-gradient(135deg, var(--sp-dark-red), var(--sp-bright-red));
    color: #ffffff !important;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 3px 8px rgba(139, 0, 0, 0.3);
}

.sp-write-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(139, 0, 0, 0.4);
}

/* Review Cards Grid */
.sp-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 18px;
}

.sp-card {
    position: relative;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sp-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 8px 16px rgba(15, 23, 42, 0.08);
    transform: translateY(-2px);
}

.sp-card-thumb {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 46px;
    height: 46px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.sp-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.sp-card:hover .sp-card-thumb img {
    transform: scale(1.1);
}

.sp-card-body {
    padding-right: 50px;
}

.sp-card-title {
    margin: 0 0 6px 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--sp-dark-blue);
}

.sp-stars {
    color: #f59e0b;
    font-size: 13px;
    margin-bottom: 8px;
}

.sp-card-excerpt {
    font-size: 13px;
    color: #475569;
    line-height: 1.45;
    margin: 0 0 12px 0;
}

.sp-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-top: 1px solid #f1f5f9;
    padding-top: 10px;
}

.sp-author-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--sp-dark-blue);
    display: block;
}

.sp-author-email,
.sp-views {
    font-size: 11px;
    color: #94a3b8;
}

/* RED & BLUE POPUP FORM */
.sp-popup-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}

.sp-popup-overlay.active {
    display: flex;
}

.sp-popup-content {
    background: #ffffff;
    width: 90%;
    max-width: 460px;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 20px 30px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--sp-navy-blue);
}

.sp-popup-header {
    background: linear-gradient(135deg, var(--sp-dark-blue), #1e3a8a);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--sp-bright-red);
}

#sp-review-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
}

.sp-popup-close {
    background: transparent;
    border: none;
    font-size: 22px;
    color: #ffffff;
    cursor: pointer;
    line-height: 1;
}

.sp-review-form {
    padding: 20px;
}

.sp-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sp-row {
    margin-bottom: 12px;
}

.sp-row label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--sp-dark-blue);
}

.sp-row input[type="text"],
.sp-row input[type="email"],
.sp-row select,
.sp-row textarea {
    width: 100%;
    padding: 8px 10px;
    font-size: 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}

.sp-row input:focus,
.sp-row select:focus,
.sp-row textarea:focus {
    border-color: var(--sp-dark-red);
    outline: none;
    box-shadow: 0 0 0 2px rgba(139, 0, 0, 0.15);
}

.sp-rating-picker {
    display: flex;
    gap: 4px;
}

.sp-star-btn {
    background: none;
    border: none;
    font-size: 20px;
    color: #cbd5e1;
    cursor: pointer;
    padding: 0;
}

.sp-star-btn.active {
    color: #f59e0b;
}

.sp-button {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--sp-bright-red), var(--sp-dark-red));
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.sp-button:hover {
    opacity: 0.95;
}

/* PAGINATION STYLE */
.sp-pagination {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 25px;
    font-family: Arial, sans-serif;
}

.sp-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    font-size: 16px;
    font-weight: 500;
    color: #d90000;
    background-color: #ffffff;
    border: 1px solid #e2e4e8;
    border-radius: 6px;
    text-decoration: none;
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
}

.sp-page-link:hover {
    border-color: #d90000;
    background-color: #fff5f5;
}

.sp-page-link.active {
    background-color: #e00000;
    color: #ffffff !important;
    border-color: #e00000;
    font-weight: 600;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sp-reviews-topbar {
        flex-direction: column;
        align-items: stretch;
    }
    .sp-filter-row {
        flex-direction: column;
        width: 100%;
    }
    .sp-filter-select {
        width: 100%;
    }
    .sp-top-actions {
        width: 100%;
    }
    .sp-write-btn {
        width: 100%;
    }
}