/* ========================================
   Savage Gamez Reviews - Frontend Styles
   ======================================== */

/* Variables for board game theme */
:root {
    --sgr-primary: #8b4513;
    --sgr-secondary: #2c1810;
    --sgr-accent: #c7504f;
    --sgr-accent-hover: #a6403c;
    --sgr-dark: #2c1810;
    --sgr-light: #f5e6d3;
    --sgr-header: #f8efe2;
    --sgr-text: #333333;
    --sgr-text-muted: #555555;
    --sgr-border: #b8936e;
    --sgr-border-strong: #8a673f;
    --sgr-border-light: #cccccc;
    --sgr-border-subtle: #e0e0e0;
    --sgr-white: #ffffff;
    --sgr-black: #000000;
    --sgr-star-color: #ff9500;
    --sgr-star-hover: #ffb347;
    --sgr-success-bg: #d4edda;
    --sgr-success-border: #c3e6cb;
    --sgr-success-text: #155724;
    --sgr-success-icon: #46b450;
    --sgr-error-bg: #f8d7da;
    --sgr-error-border: #f5c6cb;
    --sgr-error-text: #721c24;
    --sgr-warning-bg: #fff3cd;
    --sgr-warning-border: #ffc107;
    --sgr-warning-text: #856404;
    --sgr-muted-bg: #dddddd;
    --sgr-button-text: #ffffff;
    --sgr-link: #c7504f;
    --sgr-link-strong: #8b4513;
    --sgr-reviewer-icon: #d4a574;
    --sgr-disabled: #999999;
    --sgr-shadow-soft: rgba(0, 0, 0, 0.15);
    --sgr-shadow-medium: rgba(0, 0, 0, 0.2);
    --sgr-shadow-strong: rgba(0, 0, 0, 0.25);
    --sgr-shadow-deep: rgba(0, 0, 0, 0.5);
    --sgr-overlay: rgba(0, 0, 0, 0.8);
    --sgr-glass-50: rgba(255, 255, 255, 0.5);
    --sgr-glass-70: rgba(255, 255, 255, 0.7);
    --sgr-glass-90: rgba(255, 255, 255, 0.9);
    --sgr-glow-color: rgba(255, 149, 0, 0.5);
}

/* ========================================
   Review Form Styles
   ======================================== */

.sgr-review-form-wrapper {
    max-width: 800px;
    margin: 40px auto;
    background: var(--sgr-light);
    border: 3px solid var(--sgr-border);
    border-radius: 8px;
    padding: 40px;
    box-shadow: 0 8px 16px var(--sgr-shadow-medium);
    font-family: 'Arial', sans-serif;
}

.sgr-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.sgr-form-header h2 {
    color: var(--sgr-dark);
    font-size: 28px;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sgr-form-header p {
    color: var(--sgr-primary);
    font-size: 16px;
    margin: 0;
}

.sgr-form {
    margin-top: 30px;
}

.sgr-form-row {
    margin-bottom: 25px;
}

.sgr-form-section {
    background: var(--sgr-glass-50);
    border: 2px solid var(--sgr-border);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
}

.sgr-form-section h3 {
    color: var(--sgr-dark);
    font-size: 20px;
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sgr-form label {
    display: block;
    color: var(--sgr-dark);
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
}

.sgr-form .required {
    color: var(--sgr-accent);
}

.sgr-form input[type="text"],
.sgr-form textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--sgr-border);
    border-radius: 4px;
    font-size: 16px;
    font-family: 'Arial', sans-serif;
    background: var(--sgr-white);
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.sgr-form input[type="text"]:focus,
.sgr-form textarea:focus {
    outline: none;
    border-color: var(--sgr-primary);
}

.sgr-form textarea {
    resize: vertical;
    min-height: 120px;
}

.sgr-help-text {
    color: var(--sgr-text-muted);
    font-size: 13px;
    margin: 0 0 15px 0;
    font-style: italic;
}

/* Star Rating */
.sgr-rating-row {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.sgr-rating-row label {
    flex: 0 0 200px;
    margin-bottom: 0;
}

.sgr-star-rating {
    display: flex;
    gap: 5px;
    cursor: pointer;
    align-items: center;
}

.sgr-rating-display {
    margin-left: 15px;
    font-size: 18px;
    font-weight: bold;
    color: var(--sgr-primary);
    min-width: 40px;
    text-align: left;
}

.sgr-star {
    position: relative;
    font-size: 36px;
    color: var(--sgr-border-light);
    display: inline-block;
    width: 36px;
    height: 36px;
    transition: all 0.2s;
    line-height: 1;
}

.sgr-star-half,
.sgr-star-full {
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
}

.sgr-star-half {
    position: absolute;
    width: 50%;
    overflow: hidden;
    left: 0;
    top: 0;
    z-index: 2;
}

.sgr-star-full {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 1;
}

/* Hover effects - make it clear which part you're hovering */
.sgr-star-half:hover {
    color: var(--sgr-star-hover);
    transform: scale(1.1);
    text-shadow: 0 0 8px var(--sgr-glow-color);
}

.sgr-star-full:hover {
    color: var(--sgr-star-hover);
    transform: scale(1.05);
    text-shadow: 0 0 8px var(--sgr-glow-color);
}

/* Active/selected states */
.sgr-star.active {
    color: var(--sgr-star-color);
}

.sgr-star.active .sgr-star-full {
    color: var(--sgr-star-color);
}

.sgr-star.half-active .sgr-star-half {
    color: var(--sgr-star-color);
}

.sgr-star.half-active .sgr-star-full {
    color: var(--sgr-border-light);
}

/* Image Uploads */
.sgr-image-uploads {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.sgr-image-upload-box {
    position: relative;
}

.sgr-file-input {
    display: none;
}

.sgr-file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    border: 2px dashed var(--sgr-border);
    border-radius: 6px;
    background: var(--sgr-glass-70);
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.sgr-file-label:hover {
    background: var(--sgr-glass-90);
    border-color: var(--sgr-primary);
}

.sgr-upload-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.sgr-upload-text {
    color: var(--sgr-primary);
    font-size: 14px;
    font-weight: bold;
}

.sgr-image-preview {
    position: relative;
    border: 2px solid var(--sgr-border);
    border-radius: 6px;
    overflow: hidden;
}

.sgr-image-preview img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.sgr-remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--sgr-accent);
    color: var(--sgr-white);
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.sgr-remove-image:hover {
    background: var(--sgr-accent-hover);
}

/* Submit Button */
.sgr-submit-btn {
    width: 100%;
    padding: 15px 30px;
    background: var(--sgr-primary);
    color: var(--sgr-button-text);
    border: 3px solid var(--sgr-dark);
    border-radius: 6px;
    font-size: 18px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 8px var(--sgr-shadow-medium);
}

.sgr-submit-btn:hover {
    background: var(--sgr-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px var(--sgr-shadow-strong);
}

.sgr-submit-btn:disabled {
    background: var(--sgr-disabled);
    cursor: not-allowed;
    transform: none;
}

/* Form Messages */
#sgr-form-message {
    margin-top: 20px;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
}

#sgr-form-message.success {
    background: var(--sgr-success-bg);
    border: 2px solid var(--sgr-success-border);
    color: var(--sgr-success-text);
}

#sgr-form-message.error {
    background: var(--sgr-error-bg);
    border: 2px solid var(--sgr-error-border);
    color: var(--sgr-error-text);
}

/* Error Message */
.sgr-error-message {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: var(--sgr-warning-bg);
    border: 3px solid var(--sgr-warning-border);
    border-radius: 8px;
    text-align: center;
}

.sgr-error-message p {
    color: var(--sgr-text);
    font-size: 16px;
    margin: 0;
}

/* ========================================
   Reviews Display Styles
   ======================================== */

.sgr-reviews-wrapper {
    max-width: 1600px;
    margin: 40px auto;
    padding: 0 20px;
}

.sgr-reviews-header {
    text-align: center;
    margin-bottom: 40px;
}

.sgr-reviews-header h2 {
    color: var(--sgr-dark);
    font-size: 32px;
    margin: 0 0 10px 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.sgr-reviews-count {
    color: var(--sgr-primary);
    font-size: 16px;
    margin: 0;
}

/* Reviews Grid */
.sgr-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
}

.sgr-review-card {
    background: var(--sgr-light);
    border: 3px solid var(--sgr-border);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px var(--sgr-shadow-soft);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}

.sgr-review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--sgr-shadow-strong);
}

.sgr-review-image {
    width: 100%;
    height: 200px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: var(--sgr-muted-bg);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.sgr-review-image--empty {
    background: var(--sgr-header);
    color: var(--sgr-text-muted);
    font-style: italic;
    padding: 0 10px;
}

.sgr-review-image--empty span {
    display: block;
    font-size: 14px;
}

.sgr-review-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sgr-review-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.sgr-rating-number {
    color: var(--sgr-primary);
    font-size: 20px;
    font-weight: bold;
}

.sgr-review-title {
    color: var(--sgr-dark);
    font-size: 20px;
    margin: 0 0 15px 0;
    font-weight: bold;
}

.sgr-review-excerpt {
    color: var(--sgr-text-muted);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.sgr-review-meta {
    margin-bottom: 15px;
}

.sgr-reviewer-name {
    color: var(--sgr-primary);
    font-style: italic;
    font-size: 14px;
}

.sgr-read-more {
    padding: 10px 20px;
    background: var(--sgr-primary);
    color: var(--sgr-button-text);
    border: 2px solid var(--sgr-dark);
    border-radius: 4px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.sgr-read-more:hover {
    background: var(--sgr-dark);
}

/* Review Summary Badge */
.sgr-summary-card {
    max-width: 420px;
    margin: 30px auto;
    padding: 25px 30px;
    border: 3px solid var(--sgr-border);
    border-radius: 10px;
    background: var(--sgr-light);
    text-align: center;
    box-shadow: 0 8px 16px var(--sgr-shadow-soft);
}

.sgr-summary-card--empty {
    max-width: 420px;
    margin: 30px auto;
    padding: 25px;
    text-align: center;
    border: 2px dashed var(--sgr-border-light);
    background: var(--sgr-header);
    color: var(--sgr-text-muted);
}

.sgr-summary-empty {
    margin-bottom: 18px;
}

.sgr-summary-heading {
    font-size: 18px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sgr-dark);
    margin-bottom: 15px;
}

.sgr-summary-score {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 10px;
}

.sgr-summary-value {
    font-size: 42px;
    font-weight: bold;
    color: var(--sgr-primary);
}

.sgr-summary-outof {
    font-size: 20px;
    color: var(--sgr-text-muted);
}

.sgr-summary-stars {
    margin: 10px 0;
}

.sgr-summary-stars .sgr-star-filled,
.sgr-summary-stars .sgr-star-half-filled,
.sgr-summary-stars .sgr-star-empty {
    font-size: 24px;
}

.sgr-summary-count {
    margin: 10px 0 20px 0;
    font-size: 15px;
    color: var(--sgr-text-muted);
}

.sgr-summary-button {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 50px;
    background: var(--sgr-accent);
    color: var(--sgr-white);
    font-weight: bold;
    text-decoration: none;
    transition: background 0.3s;
}

.sgr-summary-button:hover {
    background: var(--sgr-accent-hover);
}

/* Star Display */
.sgr-star-filled,
.sgr-star-half-filled,
.sgr-star-empty {
    color: var(--sgr-star-color);
    font-size: 20px;
}

.sgr-star-empty {
    color: var(--sgr-border-light);
}

.sgr-star-half-filled {
    position: relative;
    display: inline-block;
}

.sgr-star-half-filled::after {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    width: 50%;
    overflow: hidden;
    color: var(--sgr-star-color);
}

/* ========================================
   Modal Styles
   ======================================== */

.sgr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    overflow-y: auto;
}

.sgr-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--sgr-overlay);
}

.sgr-modal-content {
    position: relative;
    width: min(900px, calc(100% - 30px));
    margin: 60px auto;
    background: var(--sgr-light);
    border: 4px solid var(--sgr-border);
    border-radius: 8px;
    overflow: hidden;
    z-index: 10000;
    box-shadow: 0 10px 30px var(--sgr-shadow-deep);
}

.sgr-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid var(--sgr-border-light);
    background: rgba(255, 255, 255, 0.9);
    color: var(--sgr-black);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    padding: 0;
}

.sgr-modal-close:hover {
    background: var(--sgr-accent);
    color: var(--sgr-white);
    border-color: var(--sgr-accent);
}

#sgr-modal-body {
    padding: 40px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.sgr-modal-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.sgr-modal-images img {
    width: 100%;
    height: auto;
    border: 3px solid var(--sgr-border);
    border-radius: 6px;
    cursor: zoom-in;
}

.sgr-modal-review h2 {
    color: var(--sgr-dark);
    font-size: 28px;
    margin: 0 0 10px 0;
}

.sgr-modal-reviewer {
    color: var(--sgr-primary);
    font-style: italic;
    font-size: 16px;
    margin: 0 0 25px 0;
}

.sgr-modal-ratings {
    background: var(--sgr-glass-70);
    border: 2px solid var(--sgr-border);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 25px;
}

.sgr-modal-rating-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sgr-modal-overall {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    border-top: 2px solid var(--sgr-border);
    margin-top: 15px;
    font-weight: bold;
}

.sgr-rating-label {
    color: var(--sgr-dark);
    font-size: 16px;
    flex: 0 0 180px;
}

.sgr-rating-stars {
    flex: 1;
    text-align: center;
}

.sgr-rating-value {
    color: var(--sgr-primary);
    font-size: 18px;
    font-weight: bold;
    flex: 0 0 50px;
    text-align: right;
}

.sgr-modal-text {
    color: var(--sgr-text);
    font-size: 16px;
    line-height: 1.8;
}

/* Lightbox */
.sgr-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sgr-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--sgr-overlay);
}

.sgr-lightbox-inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    background: var(--sgr-black);
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 10px 30px var(--sgr-shadow-deep);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sgr-lightbox-inner img {
    max-width: min(80vw, 1200px);
    max-height: 80vh;
    display: block;
    border-radius: 4px;
}

.sgr-lightbox-close {
    position: absolute;
    top: 12px;
    right: 18px;
    background: transparent;
    color: var(--sgr-white);
    border: none;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.sgr-lightbox-close:hover {
    color: var(--sgr-accent);
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .sgr-review-form-wrapper {
        padding: 20px;
    }
    
    .sgr-rating-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .sgr-rating-row label {
        margin-bottom: 8px;
    }
    
    .sgr-reviews-grid {
        grid-template-columns: 1fr;
    }
    
    .sgr-modal-content {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    #sgr-modal-body {
        padding: 20px;
    }
    
    .sgr-modal-rating-row,
    .sgr-modal-overall {
        flex-wrap: wrap;
    }
    
    .sgr-rating-label {
        flex: 0 0 100%;
        margin-bottom: 5px;
    }
}
