/* =========================================
   Base & Common Styles
   ========================================= */
.simple-rating-system { 
    text-align: center; 
    margin: 30px auto; 
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Helvetica Neue', Arial, sans-serif;
    max-width: 320px;
    animation: slideUp 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-sizing: border-box;
}

.rating-title { 
    font-size: 17px; 
    font-weight: 600; 
    margin-bottom: 20px; 
    color: #1d1d1f;
    line-height: 1.3;
    letter-spacing: -0.022em;
}

.rating-stars { 
    display: flex; 
    gap: 2px; 
    justify-content: center; 
    margin: 20px 0;
}

.crfw-star {
    font-size: 38px;
    color: #d1d1d6;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    user-select: none; 
    position: relative;
    padding: 6px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 52px;
    min-height: 52px;
}

.crfw-star::before {
    content: "\f005"; /* Solid star by default */
    font-family: "Font Awesome 6 Free", "Font Awesome 6 Pro", "Font Awesome 5 Free", "Font Awesome 5 Pro", "FontAwesome";
    font-weight: 900;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    text-shadow: 0 0 1px rgba(0, 0, 0, 0.1);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.crfw-star:active {
    transform: scale(0.98);
    transition: transform 0.15s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.crfw-star.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.star-tooltip {
    position: absolute; 
    bottom: 64px; 
    left: 50%;
    transform: translateX(-50%);
    background: rgba(29, 29, 31, 0.95); 
    color: #ffffff; 
    padding: 8px 12px; 
    border-radius: 10px;
    font-size: 13px; 
    font-weight: 500;
    white-space: nowrap; 
    opacity: 0; 
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94); 
    z-index: 1000;
    pointer-events: none;
    letter-spacing: -0.016em;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.star-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(29, 29, 31, 0.95);
}

.crfw-star:hover .star-tooltip {
    opacity: 1; 
    visibility: visible;
    transform: translateX(-50%) translateY(-6px);
}

.rating-message-container {
    margin-top: 16px; 
    padding: 12px 16px; 
    border-radius: 12px; 
    font-size: 15px; 
    font-weight: 500;
    display: none;
    letter-spacing: -0.024em;
}

.rating-message.success { 
    background: #d1f2eb;
    color: #00783e; 
    border: 1px solid #a7f3d0;
    animation: fadeIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.rating-message.error { 
    background: #ffeaa7;
    color: #d63031; 
    border: 1px solid #fdcb6e;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 480px) {
    .simple-rating-system { margin: 20px 16px; padding: 20px; }
    .rating-stars { gap: 1px; }
    .crfw-star { font-size: 34px; min-width: 48px; min-height: 48px; padding: 4px; }
    .rating-title { font-size: 16px; }
    .star-tooltip { bottom: 58px; }
}

/* =========================================
   Theme 1: Apple Inspired
   ========================================= */
.crfw-theme-apple {
    background: #ffffff;
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e5e7;
}

.crfw-theme-apple .crfw-star:hover {
    color: #007aff;
    background: rgba(0, 122, 255, 0.08);
    transform: scale(1.08);
}

.crfw-theme-apple .crfw-star.active {
    color: #007aff;
    background: rgba(0, 122, 255, 0.12);
    transform: scale(1.02);
}

.crfw-theme-apple .crfw-star.hover-effect {
    color: #007aff;
    background: rgba(0, 122, 255, 0.08);
    transform: scale(1.05);
}

.crfw-theme-apple .crfw-star.active::before {
    filter: drop-shadow(0 0 8px rgba(0, 122, 255, 0.3)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    text-shadow: 0 0 2px rgba(0, 122, 255, 0.4), 0 0 1px rgba(0, 0, 0, 0.1);
}

.crfw-theme-apple .crfw-star.hover-effect::before {
    filter: drop-shadow(0 0 6px rgba(0, 122, 255, 0.25)) drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    text-shadow: 0 0 2px rgba(0, 122, 255, 0.3), 0 0 1px rgba(0, 0, 0, 0.1);
}

/* =========================================
   Theme 2: Classic Gold
   ========================================= */
.crfw-theme-classic {
    background: #fafafa;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #eaeaea;
}

.crfw-theme-classic .rating-title {
    color: #333;
    font-family: Arial, Helvetica, sans-serif;
}

.crfw-theme-classic .crfw-star::before {
    content: "\f005"; /* Solid star by default */
    color: #e0e0e0; 
    filter: none;
    text-shadow: none;
}

.crfw-theme-classic .crfw-star:hover::before,
.crfw-theme-classic .crfw-star.active::before,
.crfw-theme-classic .crfw-star.hover-effect::before {
    color: #ffb400; /* Classic Gold */
}

.crfw-theme-classic .crfw-star:hover {
    transform: scale(1.05);
}

/* =========================================
   Theme 3: Minimal Dark
   ========================================= */
.crfw-theme-minimal {
    background: transparent;
    padding: 10px;
    max-width: 280px;
}

.crfw-theme-minimal .rating-title {
    color: #555;
    font-weight: 500;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 0.1em;
    margin-bottom: 10px;
}

.crfw-theme-minimal .crfw-star {
    font-size: 28px;
    min-width: 38px;
    min-height: 38px;
    padding: 0;
}

.crfw-theme-minimal .crfw-star::before {
    color: #e0e0e0;
    filter: none;
    text-shadow: none;
}

.crfw-theme-minimal .crfw-star:hover::before,
.crfw-theme-minimal .crfw-star.active::before,
.crfw-theme-minimal .crfw-star.hover-effect::before {
    color: #333333; /* Dark fill for minimal layout */
}

.crfw-theme-minimal .star-tooltip {
    background: #222;
    border-radius: 4px;
}

.crfw-theme-minimal .star-tooltip::after {
    border-top-color: #222;
}
