:root {
    /* Denta.fi värit - MUOKKAA NÄMÄ TARKOIKSI BRÄNDIVÄREIKSI! */
    --denta-primary-color: #0097A7; /* Pääväri (esim. turkoosi) */
    --denta-text-color: #343229;    /* Tumma teksti */
    --denta-text-light-color: #4B4A40; /* Vaaleampi teksti */
    --denta-background-color: #F6F5F1; /* Taustaväri arvostelukorteille */
    --denta-ribbon-background-color: #E6E4D8; /* Taustaväri ribbonille, voi olla myös tehosteväri */
    --denta-border-color: #CCBFB6;   /* Reunaviivat */
    --denta-star-color: #FFC107;     /* Tähtien väri */
    --denta-shadow-color: rgba(0, 0, 0, 0.1);

    --review-card-width: 320px; /* Yksittäisen arvostelukortin leveys */
    --ribbon-height: clamp(280px, 33vh, 400px); /* Ribbonin korkeus, noin 1/3 näytöstä, mutta rajattu */
}

/* Utility classes */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* Main container - EQUAL PADDING TOP AND BOTTOM */
.denta-reviews-ribbon-container {
    width: 100%;
    height: auto;
    background-color: var(--denta-ribbon-background-color);
    overflow: hidden; 
    position: relative;
    padding: 50px 0; /* EQUAL padding top and bottom */
    display: flex;
    flex-direction: column;
    align-items: center;
    will-change: auto;
    contain: layout style;
    -webkit-overflow-scrolling: touch;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Review Statistics Section */
.denta-reviews-stats {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: transparent;
    border-radius: 10px;
    max-width: 600px;
}

.denta-business-name {
    font-family: 'Neue Plak Wide semibold', sans-serif;
    font-size: 1.5em;
    color: var(--denta-text-color);
    margin: 0 0 15px 0;
}

.denta-stats-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.denta-stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.denta-stat-value {
    font-size: 2em;
    font-weight: 700;
    color: #343229;
    line-height: 1;
    margin-bottom: 9px;
}

.denta-stat-stars {
    font-size: 1.4em;
}

.denta-stat-label {
    font-size: 1.1em;
    color: var(--denta-text-light-color);
    font-weight: 500;
}

.denta-google-logo {
    height: 20px;
    width: auto;
    opacity: 0.8;
    margin-top: 10px;
}

/* Stats Widget Styles */
.denta-reviews-stats-widget {
    display: inline-block;
    padding: 15px 20px;
    background: var(--denta-background-color);
    border: 2px solid var(--denta-border-color);
    border-radius: 10px;
    box-shadow: 0 2px 5px var(--denta-shadow-color);
}

.denta-reviews-stats-widget .denta-business-name {
    font-size: 1.4em;
    margin-bottom: 10px;
}

.denta-reviews-stats-widget .denta-stats-container {
    gap: 15px;
}

.denta-reviews-stats-widget .denta-stat-value {
    font-size: 1.6em;
}

.denta-reviews-stats-widget .denta-stat-stars {
    font-size: 1.2em;
}

.denta-reviews-stats-widget .denta-stat-label {
    font-size: 0.95em;
}

/* Vertical layout for stats widget */
.denta-stats-vertical .denta-stats-container {
    flex-direction: column;
    align-items: center;
}

.denta-stats-vertical .denta-stat-item {
    flex-direction: column;
    text-align: center;
}

/* Scroller container - DESKTOP */
.denta-reviews-scroller {
    display: flex;
    flex-wrap: nowrap;
    height: auto;
    align-items: stretch;
    animation: denta-scroll-animation 60s linear infinite;
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
    margin-bottom: 50px;
    cursor: grab;
}

.denta-reviews-scroller:active {
    cursor: grabbing;
}

/* Pause ONLY when hovering directly on the scroller, not the whole container */
.denta-reviews-scroller:hover {
    animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
    .denta-reviews-scroller {
        animation-play-state: paused;
    }
}

@keyframes denta-scroll-animation {
    0% {
        transform: translateX(0) translateZ(0);
    }
    100% {
        transform: translateX(-33.33%) translateZ(0);
    }
}

/* Individual review cards - DESKTOP */
.denta-review-card {
    flex: 0 0 var(--review-card-width);
    width: var(--review-card-width);
    margin: 0 10px;
    background-color: var(--denta-background-color);
    border: 2px solid #999993;
    border-radius: 0px;
    padding: 20px;
    box-shadow: 0 4px 6px var(--denta-shadow-color);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    min-height: 350px;
    box-sizing: border-box;
    will-change: transform, box-shadow;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
}

.denta-review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px var(--denta-shadow-color);
}

.denta-review-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.denta-review-author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 12px;
    object-fit: cover;
    border: 1px solid var(--denta-border-color);
    will-change: auto;
}

.denta-avatar-placeholder {
    background-color: var(--denta-primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.2em;
    text-transform: uppercase;
}

.denta-review-author-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.denta-review-author-name {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--denta-text-color);
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Neue Plak Wide semibold';
}

.denta-review-stars {
    --star-size: 18px;
    --star-empty-color: var(--denta-border-color);
    display: inline-block;
    font-size: var(--star-size);
    font-family: Times, 'Times New Roman', serif;
    line-height: 1;
    position: relative;
}

.denta-review-stars::before {
    content: "★★★★★";
    letter-spacing: 2px;
    color: var(--star-empty-color);
}

.denta-review-stars::after {
    content: "★★★★★";
    letter-spacing: 2px;
    color: var(--denta-star-color);
    position: absolute;
    top: 0;
    left: 0;
    width: calc(var(--rating) / 5 * 100%);
    overflow: hidden;
    white-space: nowrap;
}

.denta-review-time {
    display: none;
    font-size: 0.85em;
    color: var(--denta-text-light-color);
    margin-bottom: 10px;
}

.denta-review-text {
    font-size: 0.95em;
    line-height: 1.6;
    color: var(--denta-text-color);
    flex-grow: 1;
    margin-bottom: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    user-select: text;
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
}

/* Read more toggling */
.denta-review-text-full[hidden] {
    display: none !important;
}
.denta-review-text-short[hidden] {
    display: none !important;
}

.denta-review-source-link {
    font-size: 0.9em;
    color: #343229;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-top: auto;
    transition: color 0.2s ease;
    -webkit-tap-highlight-color: rgba(0, 151, 167, 0.3);
    padding: 5px 0;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.denta-review-source-link:hover,
.denta-review-source-link:focus {
    text-decoration: underline;
    color: black;
}

.denta-read-more-toggle, .denta-review-source-link {
	border-radius: 0px;
	background-color: transparent;
	border: 0px;
	border-top: 1px solid black;
	border-bottom: 1px solid black;
	
}

.denta-read-more-toggle:hover {
	background-color: transparent;
	border: 0px;
	box-shadow: none;
	text-decoration: none;
	border-top: 1px solid black;
	border-bottom: 1px solid black;
	
}

.denta-read-more-toggle:focus,
.denta-read-more-toggle:active {
	background-color: transparent;
	border: 0px;
	box-shadow: none;
	text-decoration: none;
	border-top: 1px solid black;
	border-bottom: 1px solid black;
	outline: none;
}

/* Navigation buttons - Desktop only */
.denta-reviews-nav-buttons {
    display: none;
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 10;
}

.denta-nav-button {
    position: absolute;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    pointer-events: auto;
    font-size: 24px;
    font-weight: bold;
    -webkit-tap-highlight-color: transparent;
}

.denta-nav-button:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.denta-nav-button:active {
    transform: scale(0.95);
}

.denta-nav-prev {
    left: 10px;
}

.denta-nav-next {
    right: 10px;
}

.denta-nav-arrow {
    line-height: 1;
}

/* Actions section */
.denta-reviews-actions {
    margin-top: 20px;
    text-align: center;
}

.denta-write-review-button,
.denta-watch-all-reviews-button {
    background-color: #48463F;
    color: #e6e4d8;
    font-size: 16px;
    font-family: 'Neue Plak Wide semibold';
    border-radius: 0px;
    border: 2px solid #ccbfb6;
    padding: 23px 20px;
    -webkit-tap-highlight-color: rgba(204, 191, 182, 0.3);
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s ease;
}

.denta-write-review-button:hover,
.denta-write-review-button:focus,
.denta-watch-all-reviews-button:hover,
.denta-watch-all-reviews-button:focus {
    color: var(--global-palette9, #ffffff);
    background: #343229;
}

.denta-watch-all-reviews-button {
    margin-left: 10px;
}

/* Fallback content styles */
.denta-reviews-fallback {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.denta-reviews-fallback-content {
    max-width: 500px;
    padding: 40px 20px;
}

.denta-fallback-message h3 {
    font-size: 1.5em;
    color: var(--denta-text-color);
    margin: 0 0 15px 0;
    font-weight: 600;
}

.denta-fallback-message p {
    font-size: 1.1em;
    color: var(--denta-text-light-color);
    margin: 0 0 25px 0;
    line-height: 1.5;
}

/* Focus styles for accessibility */
.denta-review-source-link:focus,
.denta-write-review-button:focus,
.denta-watch-all-reviews-button:focus {
    outline: 2px solid var(--denta-primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .denta-review-card {
        border-width: 2px;
    }
    
    .denta-review-author-avatar {
        border-width: 2px;
    }
}

/* ================================================
   MOBILE STYLES - Compact design with horizontal stats
   ================================================ */
@media (max-width: 768px) {
    /* Equal padding for mobile */
    .denta-reviews-ribbon-container {
        padding: 50px 0; /* Equal 50px top and bottom */
        height: auto;
        overflow: visible !important;
    }
    
    /* COMPACT STATS SECTION */
    .denta-reviews-stats {
        margin-bottom: 20px;
        padding: 10px 15px;
    }
    
    /* Smaller business name */
    .denta-business-name {
        font-size: 1.1em;
        margin: 0 0 10px 0;
    }
    
    /* Horizontal layout for stats on mobile */
    .denta-stats-container {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 15px;
        flex-wrap: nowrap;
    }
    
    /* Compact stat items */
    .denta-stat-item {
        display: flex;
        align-items: center;
        gap: 5px;
    }
    
    .denta-stat-value {
        font-size: 1.3em;
        margin-bottom: 0;
    }
    
    .denta-stat-stars {
        font-size: 1em;
    }
    
    .denta-stat-label {
        font-size: 0.9em;
    }
    
    /* Smaller Google logo */
    .denta-google-logo {
        height: 16px;
        margin-top: 0;
        margin-left: 5px;
    }
    
    /* MOBILE SCROLL WRAPPER */
    .denta-mobile-scroll-wrapper {
        width: 100%;
        overflow-x: scroll;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 15px;
        /* Enable scroll snap */
        scroll-snap-type: x mandatory;
        /* Hide scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .denta-mobile-scroll-wrapper::-webkit-scrollbar {
        display: none;
    }
    
    /* MOBILE CAROUSEL */
    .denta-reviews-scroller {
        /* Remove all desktop animations */
        animation: none !important;
        transform: none !important;
        
        /* Simple flex row */
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        
        /* Enable scrolling */
        width: max-content !important;
        gap: 20px;
        margin-bottom: 0;
        
        /* Padding for centering */
        padding: 0 20px;
    }
    
    /* MOBILE REVIEW CARDS */
    .denta-review-card {
        /* Full width cards */
        flex: 0 0 calc(100vw - 40px) !important;
        width: calc(100vw - 40px) !important;
        min-width: calc(100vw - 40px) !important;
        max-width: 400px !important;
        
        /* Snap to center */
        scroll-snap-align: center;
        
        /* Remove animations */
        transition: none !important;
        transform: none !important;
        
        /* Card styling */
        margin: 0;
        padding: 20px;
        box-sizing: border-box;
        height: auto;
        
        /* Ensure content fits */
        min-height: auto;
        display: flex;
        flex-direction: column;
    }
    
    .denta-review-card:hover {
        transform: none !important;
    }
    
    /* Full text visibility */
    .denta-review-text {
        font-size: 1em;
        line-height: 1.6;
        max-height: none !important;
        overflow: visible !important;
        user-select: text !important;
        -webkit-user-select: text !important;
        pointer-events: auto;
        min-height: auto;
        flex-grow: 0;
        flex-shrink: 0;
    }
    
    /* Compact dots */
    .denta-mobile-dots {
        display: flex;
        justify-content: center;
        gap: 6px;
        padding: 10px 0;
        margin-bottom: 15px;
    }
    
    .denta-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background-color: var(--denta-border-color);
        transition: background-color 0.3s, transform 0.3s;
        cursor: pointer;
    }
    
    .denta-dot.active {
        background-color: var(--denta-primary-color);
        transform: scale(1.3);
    }
    
    /* Hide duplicates */
    .denta-review-duplicate,
    .denta-mobile-clone,
    .denta-carousel-indicators {
        display: none !important;
    }
    
    /* Hide desktop navigation */
    .denta-reviews-nav-buttons {
        display: none !important;
    }
    
    .denta-review-author-name {
        font-size: 1.1em;
    }
    
    .denta-review-source-link {
        padding: 12px 0;
        font-size: 1em;
        margin-top: 10px;
    }
    
    /* MOBILE BUTTONS - SIDE BY SIDE */
    .denta-reviews-actions {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 10px;
        padding: 0 20px;
    }
    
    .denta-write-review-button,
    .denta-watch-all-reviews-button {
        padding: 15px 10px;
        font-size: 14px;
        flex: 1;
        max-width: 180px;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .denta-reviews-ribbon-container {
        padding: 50px 0; /* Keep equal padding */
    }
    
    /* Even more compact stats */
    .denta-reviews-stats {
        margin-bottom: 15px;
        padding: 10px;
    }
    
    .denta-business-name {
        font-size: 1em;
        margin: 0 0 8px 0;
    }
    
    .denta-stats-container {
        gap: 10px;
    }
    
    .denta-stat-value {
        font-size: 1.2em;
    }
    
    .denta-stat-stars {
        font-size: 0.9em;
    }
    
    .denta-stat-label {
        font-size: 0.85em;
    }
    
    .denta-google-logo {
        height: 14px;
    }
    
    /* Full width cards on small screens */
    .denta-review-card {
        flex: 0 0 calc(100vw - 30px) !important;
        width: calc(100vw - 30px) !important;
        min-width: calc(100vw - 30px) !important;
        max-width: none !important;
        padding: 16px;
        scroll-snap-align: center;
    }
    
    .denta-reviews-scroller {
        gap: 15px;
        padding: 0 15px;
    }
    
    .denta-review-author-name {
        font-size: 1em;
    }
    
    .denta-review-text {
        font-size: 0.95em;
        max-height: none !important;
        overflow: visible !important;
    }
    
    .denta-mobile-dots {
        gap: 5px;
        padding: 8px 0;
        margin-bottom: 10px;
    }
    
    .denta-dot {
        width: 5px;
        height: 5px;
    }
    
    /* Even smaller buttons for tiny screens */
    .denta-write-review-button,
    .denta-watch-all-reviews-button {
        padding: 14px 8px;
        font-size: 13px;
        max-width: 160px;
    }
}

/* Print styles */
@media print {
    .denta-reviews-ribbon-container {
        height: auto;
        overflow: visible;
        page-break-inside: avoid;
    }
    
    .denta-reviews-stats {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .denta-reviews-scroller {
        animation: none;
        flex-wrap: wrap;
        height: auto;
    }
    
    .denta-review-card {
        width: calc(50% - 20px);
        margin: 10px;
        break-inside: avoid;
    }
    
    .denta-review-duplicate {
        display: none;
    }
    
    .denta-google-logo {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}