/* ================================
   DESIGNARE FEEDBACK RATINGS
   Frontend Stylesheet v2.2.0
   ================================ */

:root {
    --dfr-primary: #C4A35A;
    --dfr-positive: #51cf66;
    --dfr-neutral: #C4A35A;
    --dfr-negative: #ff6b6b;
    --dfr-radius: 0px;
    --dfr-btn-radius: 0px;
    --dfr-transition: all 0.3s ease;
}

/* === CONTAINER === */
.dfr-feedback-section {
    max-width: 700px;
    margin: 40px auto;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333 !important;
}

.dfr-feedback-container {
    background: #fff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: var(--dfr-radius);
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.dfr-feedback-title {
    margin: 0 0 20px;
    font-size: 1.1rem;
    font-weight: 500;
    color: #1d2327 !important;
    text-align: center;
}

/* === HONEYPOT === */
.dfr-hp-wrap {
    position: absolute !important;
    left: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}

/* ================================
   THUMBS SYSTEM
   ================================ */

.dfr-rating-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    justify-content: center;
}

.dfr-rating-btn {
    flex: 1;
    max-width: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #fff !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: var(--dfr-btn-radius);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--dfr-transition);
    color: #666 !important;
}

.dfr-rating-btn svg {
    transition: var(--dfr-transition);
}

.dfr-rating-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dfr-rating-btn.dfr-positive:hover {
    border-color: var(--dfr-positive) !important;
    color: var(--dfr-positive) !important;
    background: rgba(81, 207, 102, 0.05) !important;
}

.dfr-rating-btn.dfr-neutral:hover {
    border-color: var(--dfr-neutral) !important;
    color: var(--dfr-neutral) !important;
    background: rgba(196, 163, 90, 0.05) !important;
}

.dfr-rating-btn.dfr-negative:hover {
    border-color: var(--dfr-negative) !important;
    color: var(--dfr-negative) !important;
    background: rgba(255, 107, 107, 0.05) !important;
}

.dfr-rating-btn.dfr-selected {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.dfr-rating-btn.dfr-positive.dfr-selected {
    border-color: var(--dfr-positive) !important;
    background: var(--dfr-positive) !important;
    color: #fff !important;
}

.dfr-rating-btn.dfr-neutral.dfr-selected {
    border-color: var(--dfr-neutral) !important;
    background: var(--dfr-neutral) !important;
    color: #fff !important;
}

.dfr-rating-btn.dfr-negative.dfr-selected {
    border-color: var(--dfr-negative) !important;
    background: var(--dfr-negative) !important;
    color: #fff !important;
}

.dfr-rating-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* === CUSTOM ICONS === */
.dfr-custom-icon {
    display: block;
    object-fit: contain;
    transition: var(--dfr-transition);
}

.dfr-rating-btn .dfr-custom-icon {
    filter: grayscale(1) opacity(0.6);
}

.dfr-rating-btn:hover .dfr-custom-icon {
    filter: grayscale(0) opacity(1);
}

.dfr-rating-btn.dfr-selected .dfr-custom-icon {
    filter: brightness(0) invert(1);
}

/* Farbige Custom Icons (wenn nicht monochrom) */
.dfr-rating-btn.dfr-positive:hover .dfr-custom-icon,
.dfr-rating-btn.dfr-neutral:hover .dfr-custom-icon,
.dfr-rating-btn.dfr-negative:hover .dfr-custom-icon {
    filter: none;
}

/* === RATIO BAR === */
.dfr-ratio-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5 !important;
    margin-bottom: 12px;
}

.dfr-ratio-segment {
    height: 100%;
    transition: width 0.5s ease;
}

.dfr-ratio-segment.dfr-pos {
    background: var(--dfr-positive);
}

.dfr-ratio-segment.dfr-neu {
    background: var(--dfr-neutral);
}

.dfr-ratio-segment.dfr-neg {
    background: var(--dfr-negative);
}

.dfr-rating-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #666 !important;
}

/* ================================
   STARS SYSTEM
   ================================ */

.dfr-stars-theme .dfr-stars-container {
    margin-bottom: 20px;
}

.dfr-stars-rating {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.dfr-star-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    transition: var(--dfr-transition);
    color: #ddd !important;
}

.dfr-star-btn svg {
    display: block;
    transition: var(--dfr-transition);
}

.dfr-star-btn:hover {
    transform: scale(1.2);
}

.dfr-star-btn.dfr-hover,
.dfr-star-btn.dfr-selected {
    color: var(--dfr-primary) !important;
}

.dfr-star-btn.dfr-selected {
    animation: dfr-star-pulse 0.5s ease;
}

@keyframes dfr-star-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.3); }
}

/* Custom Star Icons */
.dfr-star-btn .dfr-star-empty,
.dfr-star-btn .dfr-star-filled {
    transition: var(--dfr-transition);
}

.dfr-star-btn .dfr-star-empty {
    display: block;
}

.dfr-star-btn .dfr-star-filled {
    display: none;
}

.dfr-star-btn.dfr-hover .dfr-star-empty,
.dfr-star-btn.dfr-selected .dfr-star-empty {
    display: none;
}

.dfr-star-btn.dfr-hover .dfr-star-filled,
.dfr-star-btn.dfr-selected .dfr-star-filled {
    display: block;
}

/* === STARS AVERAGE === */
.dfr-stars-average {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
    padding: 12px;
    background: #f9f9f9 !important;
    border-radius: var(--dfr-radius);
}

.dfr-avg-rating {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--dfr-primary) !important;
}

.dfr-avg-stars {
    display: flex;
    gap: 2px;
    color: var(--dfr-primary) !important;
}

.dfr-avg-stars svg,
.dfr-avg-stars .dfr-custom-icon-small {
    display: block;
}

.dfr-avg-count {
    font-size: 0.85rem;
    color: #666 !important;
}

.dfr-no-ratings {
    font-weight: 500;
    color: #666 !important;
}

.dfr-be-first {
    font-size: 0.85rem;
    color: #999 !important;
}

/* === STARS DISTRIBUTION === */
.dfr-stars-distribution {
    margin-top: 15px;
}

.dfr-dist-row {
    display: grid;
    grid-template-columns: 30px 1fr 45px;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.dfr-dist-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #666 !important;
    text-align: right;
}

.dfr-dist-bar {
    height: 8px;
    background: #f0f0f0 !important;
    border-radius: 4px;
    overflow: hidden;
}

.dfr-dist-fill {
    height: 100%;
    background: var(--dfr-primary);
    transition: width 0.5s ease;
}

.dfr-dist-percent {
    font-size: 0.8rem;
    color: #999 !important;
    text-align: right;
}

/* ================================
   SHARE BUTTONS
   ================================ */

.dfr-share-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.dfr-share-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #666 !important;
}

.dfr-share-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f5f5f5 !important;
    color: #666 !important;
    transition: var(--dfr-transition);
    text-decoration: none;
}

.dfr-share-icon:hover {
    background: var(--dfr-primary) !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dfr-share-icon svg {
    display: block;
}

/* ================================
   FEEDBACK MESSAGES
   ================================ */

.dfr-feedback-message {
    margin-top: 15px;
    padding: 12px 20px;
    border-radius: var(--dfr-radius);
    font-size: 0.9rem;
    text-align: center;
    animation: dfr-slide-in 0.3s ease;
}

@keyframes dfr-slide-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dfr-feedback-message.dfr-success {
    background: #d4edda !important;
    color: #155724 !important;
    border: 1px solid #c3e6cb !important;
}

.dfr-feedback-message.dfr-error {
    background: #f8d7da !important;
    color: #721c24 !important;
    border: 1px solid #f5c6cb !important;
}

.dfr-feedback-message.dfr-info {
    background: #d1ecf1 !important;
    color: #0c5460 !important;
    border: 1px solid #bee5eb !important;
}

/* ================================
   LOADING STATE
   ================================ */

.dfr-loading {
    opacity: 0.6;
    pointer-events: none;
}

.dfr-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--dfr-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: dfr-spin 0.6s linear infinite;
}

@keyframes dfr-spin {
    to { transform: rotate(360deg); }
}

/* ================================
   RESPONSIVE
   ================================ */

@media (max-width: 768px) {
    .dfr-feedback-section {
        margin: 30px 15px;
    }
    
    .dfr-feedback-container {
        padding: 20px;
    }
    
    .dfr-rating-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .dfr-rating-btn {
        max-width: none;
    }
    
    .dfr-stars-rating {
        gap: 4px;
    }
    
    .dfr-star-btn svg {
        width: 28px;
        height: 28px;
    }
    
    .dfr-share-container {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .dfr-feedback-title {
        font-size: 1rem;
    }
    
    .dfr-rating-btn {
        font-size: 0.9rem;
        padding: 10px 16px;
    }
    
    .dfr-stars-rating {
        gap: 2px;
    }
    
    .dfr-star-btn svg {
        width: 24px;
        height: 24px;
    }
}

/* ================================
   ACCESSIBILITY
   ================================ */

.dfr-rating-btn:focus,
.dfr-star-btn:focus,
.dfr-share-icon:focus {
    outline: 2px solid var(--dfr-primary);
    outline-offset: 2px;
}

.dfr-rating-btn:focus:not(:focus-visible),
.dfr-star-btn:focus:not(:focus-visible),
.dfr-share-icon:focus:not(:focus-visible) {
    outline: none;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .dfr-feedback-container {
        border-width: 2px !important;
    }
    
    .dfr-rating-btn {
        border-width: 3px !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ================================
   PRINT STYLES
   ================================ */

@media print {
    .dfr-feedback-section {
        display: none;
    }
}

/* ================================
   DARK MODE (User-Selected)
   ================================ */

/* Forced Dark Mode */
.dfr-feedback-section.dfr-dark-mode .dfr-feedback-container {
    background: #1e1e1e !important;
    border-color: #333 !important;
    color: #e0e0e0 !important;
}

.dfr-feedback-section.dfr-dark-mode .dfr-feedback-title {
    color: #f0f0f0 !important;
}

.dfr-feedback-section.dfr-dark-mode .dfr-rating-btn {
    background: #2a2a2a !important;
    border-color: #444 !important;
    color: #bbb !important;
}

.dfr-feedback-section.dfr-dark-mode .dfr-rating-btn:hover {
    background: #333 !important;
}

.dfr-feedback-section.dfr-dark-mode .dfr-rating-btn.dfr-positive:hover {
    background: rgba(81, 207, 102, 0.1) !important;
}

.dfr-feedback-section.dfr-dark-mode .dfr-rating-btn.dfr-neutral:hover {
    background: rgba(196, 163, 90, 0.1) !important;
}

.dfr-feedback-section.dfr-dark-mode .dfr-rating-btn.dfr-negative:hover {
    background: rgba(255, 107, 107, 0.1) !important;
}

.dfr-feedback-section.dfr-dark-mode .dfr-ratio-bar {
    background: #333 !important;
}

.dfr-feedback-section.dfr-dark-mode .dfr-rating-labels {
    color: #aaa !important;
}

.dfr-feedback-section.dfr-dark-mode .dfr-stars-average {
    background: #2a2a2a !important;
}

.dfr-feedback-section.dfr-dark-mode .dfr-dist-bar {
    background: #333 !important;
}

.dfr-feedback-section.dfr-dark-mode .dfr-dist-label,
.dfr-feedback-section.dfr-dark-mode .dfr-dist-percent,
.dfr-feedback-section.dfr-dark-mode .dfr-avg-count,
.dfr-feedback-section.dfr-dark-mode .dfr-no-ratings,
.dfr-feedback-section.dfr-dark-mode .dfr-be-first {
    color: #aaa !important;
}

.dfr-feedback-section.dfr-dark-mode .dfr-share-container {
    border-top-color: #333 !important;
}

.dfr-feedback-section.dfr-dark-mode .dfr-share-label {
    color: #aaa !important;
}

.dfr-feedback-section.dfr-dark-mode .dfr-share-icon {
    background: #2a2a2a !important;
    color: #bbb !important;
}

/* Auto Dark Mode (System Preference) */
@media (prefers-color-scheme: dark) {
    .dfr-feedback-section.dfr-auto-dark .dfr-feedback-container {
        background: #1e1e1e !important;
        border-color: #333 !important;
        color: #e0e0e0 !important;
    }
    
    .dfr-feedback-section.dfr-auto-dark .dfr-feedback-title {
        color: #f0f0f0 !important;
    }
    
    .dfr-feedback-section.dfr-auto-dark .dfr-rating-btn {
        background: #2a2a2a !important;
        border-color: #444 !important;
        color: #bbb !important;
    }
    
    .dfr-feedback-section.dfr-auto-dark .dfr-rating-btn:hover {
        background: #333 !important;
    }
    
    .dfr-feedback-section.dfr-auto-dark .dfr-rating-btn.dfr-positive:hover {
        background: rgba(81, 207, 102, 0.1) !important;
    }
    
    .dfr-feedback-section.dfr-auto-dark .dfr-rating-btn.dfr-neutral:hover {
        background: rgba(196, 163, 90, 0.1) !important;
    }
    
    .dfr-feedback-section.dfr-auto-dark .dfr-rating-btn.dfr-negative:hover {
        background: rgba(255, 107, 107, 0.1) !important;
    }
    
    .dfr-feedback-section.dfr-auto-dark .dfr-ratio-bar {
        background: #333 !important;
    }
    
    .dfr-feedback-section.dfr-auto-dark .dfr-rating-labels {
        color: #aaa !important;
    }
    
    .dfr-feedback-section.dfr-auto-dark .dfr-stars-average {
        background: #2a2a2a !important;
    }
    
    .dfr-feedback-section.dfr-auto-dark .dfr-dist-bar {
        background: #333 !important;
    }
    
    .dfr-feedback-section.dfr-auto-dark .dfr-dist-label,
    .dfr-feedback-section.dfr-auto-dark .dfr-dist-percent,
    .dfr-feedback-section.dfr-auto-dark .dfr-avg-count,
    .dfr-feedback-section.dfr-auto-dark .dfr-no-ratings,
    .dfr-feedback-section.dfr-auto-dark .dfr-be-first {
        color: #aaa !important;
    }
    
    .dfr-feedback-section.dfr-auto-dark .dfr-share-container {
        border-top-color: #333 !important;
    }
    
    .dfr-feedback-section.dfr-auto-dark .dfr-share-label {
        color: #aaa !important;
    }
    
    .dfr-feedback-section.dfr-auto-dark .dfr-share-icon {
        background: #2a2a2a !important;
        color: #bbb !important;
    }
}
