/* Favorites System */
.star-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.5;
    transition: all 0.3s ease;
    z-index: 10;
}

.star-btn:hover, .star-btn.favorited {
    opacity: 1;
    transform: scale(1.2);
}

/* Loading Animations */
.spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.skeleton-container {
    padding: 20px;
}

.skeleton-line {
    height: 20px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    margin-bottom: 10px;
    border-radius: 4px;
}

.skeleton-title { height: 30px; width: 60%; }
.skeleton-text { width: 100%; }
.skeleton-text.short { width: 70%; }
.skeleton-card { padding: 15px; border: 1px solid #eee; margin: 10px 0; }

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Enhanced Micro-interactions */
button, .btn, .generate-btn, .calculate-btn, .shuffle-btn, .pick-btn, .cosmic-btn, .draw-button, .ask-btn, .flip-btn, .convert-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(51, 105, 211, 0.15);
}

button:hover, .btn:hover, .generate-btn:hover, .calculate-btn:hover, .shuffle-btn:hover, .pick-btn:hover, .cosmic-btn:hover, .draw-button:hover, .ask-btn:hover, .flip-btn:hover, .convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(51, 105, 211, 0.25), 0 2px 8px rgba(0, 0, 0, 0.1);
}

button:active, .btn:active, .generate-btn:active, .calculate-btn:active, .shuffle-btn:active, .pick-btn:active, .cosmic-btn:active, .draw-button:active, .ask-btn:active, .flip-btn:active, .convert-btn:active {
    transform: translateY(0);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);
}

.tool-card, .card, .result-card, .result-display, .bmi-result, .stat-card {
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(51, 105, 211, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.tool-card:hover, .card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(51, 105, 211, 0.15), 0 4px 15px rgba(0, 0, 0, 0.1);
}

.result-card:hover, .result-display:hover, .bmi-result:hover, .stat-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(51, 105, 211, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Feedback System */
.feedback-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.feedback-toggle {
    background: #007bff;
    color: white;
    padding: 10px 15px;
    border-radius: 25px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.feedback-panel {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 300px;
}

.stars {
    display: flex;
    gap: 5px;
    margin: 10px 0;
}

.star {
    cursor: pointer;
    font-size: 20px;
    opacity: 0.3;
    transition: opacity 0.2s;
}

.star.active {
    opacity: 1;
}

.feedback-panel textarea {
    width: 100%;
    margin: 10px 0;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.feedback-panel button {
    margin: 5px;
    padding: 8px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Privacy Controls */
.privacy-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.privacy-toggle {
    background: #28a745;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}

.privacy-content {
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    width: 250px;
}

.privacy-content label {
    display: block;
    margin: 10px 0;
    cursor: pointer;
}

.privacy-actions {
    margin-top: 15px;
}

.privacy-actions button {
    margin: 2px;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.privacy-actions .danger {
    background: #dc3545;
    color: white;
}

/* Rate Limiting Toast */
.rate-limit-toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: #dc3545;
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    z-index: 1001;
    transition: transform 0.3s ease;
}

.rate-limit-toast.show {
    transform: translateX(-50%) translateY(0);
}

/* Cookie Consent Banner */
.cookie-consent-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid #ddd;
    padding: 20px;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.cookie-content {
    max-width: 800px;
    margin: 0 auto;
}

.cookie-categories {
    margin: 15px 0;
}

.cookie-category {
    display: block;
    margin: 10px 0;
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 6px;
}

.cookie-category small {
    display: block;
    color: #666;
    margin-top: 5px;
}

.cookie-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cookie-actions button {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.cookie-actions button:first-child {
    background: #007bff;
    color: white;
}

.cookie-actions button:nth-child(2) {
    background: #28a745;
    color: white;
}

.cookie-actions button:last-child {
    background: #6c757d;
    color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .feedback-widget, .privacy-panel {
        position: relative;
        bottom: auto;
        right: auto;
        top: auto;
        margin: 10px;
    }
    
    .feedback-panel, .privacy-content {
        width: 100%;
        max-width: 300px;
    }
    
    .cookie-actions {
        flex-direction: column;
    }
    
    .cookie-actions button {
        width: 100%;
    }
}