/* POPRAVLJEN CSS ZA USER REVIEWS */

.user-reviews-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.review-form-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 5px;
    margin-bottom: 20px;
    position: relative;
}

.star-rating,
.item-stars {
    display: inline-block;
    font-size: 24px;
    line-height: 1.2;
    user-select: none;
    direction: ltr; /* Osiguraj da zvezde idu sleva nadesno */
}

/* ISPRAVLJENE ZVEZDE ZA OCENJIVANJE */
.star {
    color: #ddd;
    display: inline-block;
    margin-right: 3px;
    cursor: pointer !important;
    font-size: 24px;
    transition: all 0.2s ease;
    font-family: Arial, Helvetica, sans-serif;
    pointer-events: auto !important;
    position: relative;
    z-index: 1;
}

.star:before {
    content: "★";
}

/* HOVER EFEKAT - sve do trenutne zvezde (uključujući nju) */
.item-stars .star:hover {
    color: #FF6B35 !important;
    transform: scale(1.1);
}

/* Kada hover-ujem prva 2 */
.item-stars .star:nth-child(2):hover ~ .star:nth-child(1) {
    color: #FF6B35 !important;
}

/* Kada hover-ujem prva 3 */
.item-stars .star:nth-child(3):hover ~ .star:nth-child(1),
.item-stars .star:nth-child(3):hover ~ .star:nth-child(2) {
    color: #FF6B35 !important;
}

/* Kada hover-ujem prva 4 */
.item-stars .star:nth-child(4):hover ~ .star:nth-child(1),
.item-stars .star:nth-child(4):hover ~ .star:nth-child(2),
.item-stars .star:nth-child(4):hover ~ .star:nth-child(3) {
    color: #FF6B35 !important;
}

/* Kada hover-ujem prvih 5 */
.item-stars .star:nth-child(5):hover ~ .star:nth-child(1),
.item-stars .star:nth-child(5):hover ~ .star:nth-child(2),
.item-stars .star:nth-child(5):hover ~ .star:nth-child(3),
.item-stars .star:nth-child(5):hover ~ .star:nth-child(4) {
    color: #FF6B35 !important;
}

/* Selektovane zvezde */
.item-stars .star.selected {
    color: #FF6B35 !important;
}

/* Focus za accessibility */
.star:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
    color: #FF6B35 !important;
}

.review-textarea {
    width: 100%;
    min-height: 100px;
    margin-top: 10px;
    resize: vertical;
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 10px;
    box-sizing: border-box;
}

.review-submit-btn {
    background: #0073aa;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 15px;
}

.review-submit-btn:hover:not(:disabled) {
    background: #005177;
}

.review-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.review-permission-notice,
.review-success-notice {
    background: #fff;
    padding: 15px;
    border-left: 4px solid #4A90E2;
    margin-bottom: 20px;
}

/* AVERAGE RATING SEKCIJA */
.average-rating {
    margin: 20px 0;
    text-align: center;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 5px;
}

.average-overall {
    font-size: 48px;
    font-weight: bold;
    color: #FF6B35;
    margin-bottom: 10px;
}

.average-stars {
    font-size: 32px;
    margin: 10px 0;
}

.average-stars .star {
    color: #FF6B35;
    font-size: 32px;
    cursor: default; /* Ne treba hover za average */
}

.average-stars .star.empty {
    color: #ddd;
}

.average-number {
    color: #666;
    font-size: 16px;
    margin-top: 10px;
}

.reviews-list {
    margin-top: 20px;
}

.review-item {
    background: #fff;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.reviewer-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.review-date {
    color: #666;
    font-size: 0.9em;
}

.review-rating {
    color: #FF6B35;
    text-align: right;
}

.review-rating .star {
    cursor: default; /* Ne treba hover za prikaz */
    margin-right: 1px;
}

.review-text {
    margin: 10px 0;
    line-height: 1.5;
}

.review-actions {
    margin-top: 10px;
}

.review-delete-btn {
    background: #dc3232;
    color: white;
    padding: 5px 10px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
}

.review-delete-btn:hover:not(:disabled) {
    background: #b32d2e;
}

.review-delete-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.no-reviews {
    text-align: center;
    padding: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 10px;
    border-radius: 3px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
}

.success {
    background: #d4edda;
    color: #155724;
    padding: 10px;
    border-radius: 3px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
}

.review-items {
    margin: 15px 0;
}

.item-rating {
    margin-bottom: 15px;
    padding: 10px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
}

.item-rating label {
    margin-bottom: 8px;
    display: block;
    font-weight: 600;
}

.review-item-ratings {
    margin: 10px 0;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
}

.review-item-ratings h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
}

.review-item-ratings > div {
    margin-bottom: 5px;
}

.rating-value {
    margin-left: 10px;
    font-weight: bold;
    color: #666;
}

/* IMPROVED STAR SYSTEM ZA PRIKAZ */

/* Puna zvezdica */
.star-full {
    color: #FF6B35 !important;
    cursor: default;
}

/* Prazna zvezdica */
.star-empty {
    color: #ddd !important;
    cursor: default;
}

/* Half zvezdica */
.star-half {
    background: linear-gradient(90deg, #FF6B35 50%, #ddd 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    cursor: default;
}

/* Fallback za browsere koji ne podržavaju background-clip: text */
@supports not (-webkit-background-clip: text) {
    .star-half {
        color: #FF6B35 !important;
        opacity: 0.6;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    .user-reviews-container {
        padding: 10px;
    }
    
    .review-form-section {
        padding: 15px;
    }
    
    .review-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .review-rating {
        text-align: left;
        margin-top: 5px;
    }
    
    .star,
    .item-stars .star {
        font-size: 20px;
        margin-right: 2px;
    }
}

/* ========================================
   NOVO - ELEMENTOR RATING STARS v2.3
   ======================================== */

/* Osnovni kontejner za rating zvezdice */
.user-rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    line-height: 1;
    vertical-align: middle;
}

/* Pojedinačne zvezdice */
.user-rating-stars .rating-star {
    display: inline-block;
    font-family: Arial, sans-serif;
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

/* Puna zvezdica */
.user-rating-stars .rating-star.full {
    color: #FF6B35;
}

/* Prazna zvezdica */
.user-rating-stars .rating-star.empty {
    color: #ddd;
}

/* Half zvezdica sa gradijentom */
.user-rating-stars .rating-star.half {
    background: linear-gradient(90deg, #FF6B35 50%, #ddd 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Fallback za browsere koji ne podržavaju background-clip: text */
@supports not (-webkit-background-clip: text) {
    .user-rating-stars .rating-star.half {
        color: #FF6B35 !important;
        opacity: 0.6;
    }
}

/* Broj review-a */
.user-rating-stars .rating-count {
    font-size: 0.875em;
    color: #666;
    margin-left: 4px;
    font-weight: normal;
}

/* Kada nema rating-a */
.user-rating-stars.no-rating .rating-star {
    color: #ddd;
    opacity: 0.5;
}

/* Responsive - mali ekrani */
@media (max-width: 768px) {
    .user-rating-stars {
        gap: 1px;
    }
    
    .user-rating-stars .rating-count {
        font-size: 0.8em;
        margin-left: 3px;
    }
}

/* Za hover efekte u admin/listing context - OPCIONALNO */
.elementor-widget-container .user-rating-stars {
    transition: opacity 0.2s ease;
}

.elementor-widget-container:hover .user-rating-stars {
    opacity: 0.8;
}

/* ========================================
   ADMIN PANEL STILOVI
   ======================================== */

/* Status badges za admin tabele */
.status-badge {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 4px;
    color: white;
    font-size: 11px;
    display: inline-block;
    text-align: center;
    min-width: 60px;
}

/* Admin button styling */
.edit-btn:hover {
    background-color: #0073aa !important;
    color: white !important;
    border-color: #0073aa !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 115, 170, 0.2);
}

.button.button-small {
    margin-right: 6px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.save-btn {
    background-color: #46b450 !important;
    border-color: #46b450 !important;
    color: white !important;
}

.save-btn:hover:not(:disabled) {
    background-color: #3e9f42 !important;
    border-color: #3e9f42 !important;
}

.cancel-btn {
    background-color: #666 !important;
    border-color: #666 !important;
    color: white !important;
}

.cancel-btn:hover:not(:disabled) {
    background-color: #555 !important;
    border-color: #555 !important;
}

/* Admin table styling */
.item-text-display {
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    padding: 4px 0;
}

.wp-list-table tbody tr:hover {
    background-color: #f9f9f9;
}

.wp-list-table td {
    vertical-align: middle;
}

/* Edit form styling u admin tabeli */
input[name="item_text"] {
    padding: 8px 12px;
    border: 2px solid #0073aa;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    max-width: 500px;
    transition: all 0.3s ease;
    font-family: inherit;
}

input[name="item_text"]:focus {
    outline: none;
    border-color: #005a87;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
    background-color: #fafafa;
}

/* Tab navigation styling */
.nav-tab-wrapper {
    margin-bottom: 0;
    border-bottom: 1px solid #ccd0d4;
}

.nav-tab {
    transition: all 0.2s ease;
}

.nav-tab:hover {
    background-color: #f0f6fc;
}

.nav-tab-active {
    background-color: #fff !important;
    border-bottom-color: #fff !important;
}

.tab-content {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccd0d4;
    border-top: none;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    min-height: 400px;
}

/* Responsive admin adjustments */
@media screen and (max-width: 782px) {
    .button.button-small {
        margin: 2px;
        padding: 6px 10px;
        font-size: 11px;
    }
    
    input[name="item_text"] {
        max-width: 100%;
        font-size: 16px;
    }
    
    .wp-list-table {
        font-size: 14px;
    }
    
    .status-badge {
        font-size: 10px;
        padding: 3px 6px;
    }
}