/* Stili per il sistema di gestione punti automatici */

/* ===============================
   RESPONSIVE DESIGN - POINTS MANAGER
   =============================== */

/* Mobile styles */
@media screen and (max-width: 768px) {
    #points-control-panel {
        max-width: 100% !important;
        width: 100% !important;
        height: 100% !important;
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        bottom: 0 !important;
        border-radius: 0 !important;
        z-index: 9999 !important;
        overflow-y: auto !important;
        font-size: 14px;
    }
    
    #points-control-panel .bg-white {
        padding: 15px !important;
    }
    
    #points-control-panel h3 {
        font-size: 1.2rem !important;
        margin-bottom: 1rem !important;
    }
    
    #points-control-panel .grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
    
    #points-control-panel input,
    #points-control-panel select,
    #points-control-panel button {
        padding: 12px !important;
        font-size: 16px !important; /* Prevents zoom on iOS */
        width: 100% !important;
    }
    
    #points-control-panel .text-sm {
        font-size: 14px !important;
    }
    
    #points-control-panel .text-xs {
        font-size: 12px !important;
    }
    
    #show-points-panel-btn {
        width: 56px !important;
        height: 56px !important;
        bottom: 20px !important;
        right: 20px !important;
        font-size: 24px !important;
        z-index: 999 !important;
    }
    
    /* Schedule items mobile */
    .schedule-item {
        padding: 12px !important;
        margin-bottom: 10px !important;
        border-radius: 8px !important;
    }
    
    .schedule-item .grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }
    
    .schedule-item button {
        padding: 8px 12px !important;
        font-size: 14px !important;
        margin-top: 8px !important;
    }
}

/* Tablet styles */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    #points-control-panel {
        max-width: 350px !important;
        font-size: 15px;
    }
    
    #show-points-panel-btn {
        width: 52px !important;
        height: 52px !important;
        font-size: 20px !important;
    }
}

/* ===============================
   ORIGINAL STYLES (PRESERVED)
   =============================== */

/* Pannello di controllo */
#points-control-panel {
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#points-control-panel::-webkit-scrollbar {
    width: 6px;
}

#points-control-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

#points-control-panel::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

#points-control-panel::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Pulsante toggle fluttuante */
#show-points-panel-btn {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* Animazioni per gli elementi */
.schedule-item {
    transition: all 0.3s ease;
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.schedule-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Stili per i cambiamenti di punti */
.points-change {
    font-weight: 600;
    font-size: 20px;
    margin: 6px 0px 0px 8px;
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.points-change .text-green-500 {
    color: #22c55e !important;
}

.points-change .text-red-500 {
    color: #ef4444 !important;
}

.points-change .text-gray-500 {
    color: #6b7280 !important;
}

/* Indicatori di stato */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    animation: blink 1s infinite;
}

.status-indicator.active {
    background-color: #22c55e;
}

.status-indicator.inactive {
    background-color: #ef4444;
}

.status-indicator.pending {
    background-color: #f59e0b;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

/* Stili per i pulsanti */
.points-btn {
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.points-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.points-btn:active {
    transform: translateY(0);
}

.points-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Effetto loading */
.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Stili per i risultati */
#last-update-results {
    animation: slideInUp 0.5s ease-out;
}

@keyframes slideInUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Stili per le notifiche */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    pointer-events: none;
}

.notification {
    background: #4f46e5;
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 250px;
    animation: slideInRight 0.3s ease-out;
    pointer-events: auto;
}

.notification.positive {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.notification.negative {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.notification.success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
}

.notification.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

.notification.fade-out {
    animation: slideOutRight 0.3s ease-in forwards;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    #points-control-panel {
        right: 8px;
        left: 8px;
        top: 8px;
        min-width: auto;
        max-width: none;
    }
    
    #show-points-panel-btn {
        right: 16px;
        top: 16px;
    }
}

/* Stili per i badge */
.schedule-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-right: 4px;
}

.schedule-badge.active {
    background-color: #dcfce7;
    color: #166534;
}

.schedule-badge.inactive {
    background-color: #fee2e2;
    color: #991b1b;
}

.schedule-badge.pending {
    background-color: #fef3c7;
    color: #92400e;
}

/* Stili per i grafici e le statistiche */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.stat-card {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-number {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
}

.stat-label {
    font-size: 0.875rem;
    color: #6b7280;
    margin-top: 0.25rem;
}

/* Stili per i progressi */
.progress-bar {
    width: 100%;
    height: 4px;
    background-color: #e5e7eb;
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6, #06b6d4);
    transition: width 0.3s ease;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -100% 0;
    }
    100% {
        background-position: 100% 0;
    }
}

/* Stili per i modal */
.modal-overlay {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Stili per i toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #22c55e;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Stili per le card degli artisti con i cambiamenti */
.artist-card {
    transition: all 0.3s ease;
}

.artist-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.artist-card .points-change {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Stili per i temi */
.theme-dark {
    background-color: #1f2937;
    color: #f9fafb;
}

.theme-dark #points-control-panel {
    background-color: #374151;
    border-color: #4b5563;
}

.theme-dark .bg-gray-50 {
    background-color: #4b5563;
}

.theme-dark .text-gray-700 {
    color: #e5e7eb;
}

.theme-dark .text-gray-600 {
    color: #d1d5db;
}

.theme-dark .border-gray-300 {
    border-color: #6b7280;
}

/* Stili per le icone animate */
.icon-rotate {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.icon-bounce {
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translateY(0);
    }
    40%, 43% {
        transform: translateY(-10px);
    }
    70% {
        transform: translateY(-5px);
    }
    90% {
        transform: translateY(-2px);
    }
}

/* Stili per le transizioni fluide */
.smooth-transition {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Stili per il focus accessibile */
.focus-visible:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Stili per la stampa */
@media print {
    #points-control-panel,
    #show-points-panel-btn {
        display: none !important;
    }
}

/* ===============================
   CRONOLOGIA POSIZIONI - SCROLLBAR STYLING
   =============================== */

/* Stili personalizzati per scrollbar nella cronologia */
#historyContent {
    scrollbar-width: thin;
    scrollbar-color: #9CA3AF #F3F4F6;
}

/* Webkit scrollbar (Chrome, Safari, Edge) */
#historyContent::-webkit-scrollbar {
    width: 8px;
}

#historyContent::-webkit-scrollbar-track {
    background: #F3F4F6;
    border-radius: 4px;
}

#historyContent::-webkit-scrollbar-thumb {
    background: #9CA3AF;
    border-radius: 4px;
    border: 1px solid #F3F4F6;
}

#historyContent::-webkit-scrollbar-thumb:hover {
    background: #6B7280;
}

/* Indicatore scroll shadow */
#historyContent {
    background: 
        linear-gradient(white 30%, rgba(255,255,255,0)),
        linear-gradient(rgba(255,255,255,0), white 70%) 0 100%,
        radial-gradient(50% 0, rgba(0,0,0,.2), rgba(0,0,0,0)),
        radial-gradient(50% 100%, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%;
    background-repeat: no-repeat;
    background-color: white;
    background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
    background-attachment: local, local, scroll, scroll;
}

/* Animazione scroll smooth */
#historyContent {
    scroll-behavior: smooth;
}

/* Stili per l'indicatore di scroll */
.scroll-indicator {
    transition: opacity 0.3s ease;
}

/* Hover effect per le entry della cronologia */
.history-entry {
    transition: all 0.2s ease;
}

.history-entry:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Stili per il container del grafico cronologia */
.history-chart-container {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.history-chart-container h3 {
    color: #475569;
    font-weight: 600;
    margin-bottom: 1rem;
}

#historyChart {
    border-radius: 8px;
    background: white;
}

/* Stili per il pulsante di chiusura della classifica mensile */
#close-monthly-ranking {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
}

#close-monthly-ranking:hover {
    background: rgba(255, 255, 255, 1);
    border-color: #9ca3af;
    color: #374151;
    transform: scale(1.05);
}

#close-monthly-ranking:active {
    transform: scale(0.95);
}
