/**
 * GSD Events iCal - Stili pulsante sottoscrizione
 * 
 * @package GSD_Events_iCal
 * @since 1.0.0
 */

/* Container principale */
.gsd-ical-subscribe-container {
    margin: 1.5rem 0;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

/* Pulsante principale */
.gsd-ical-subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, #0066cc 0%, #004499 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.gsd-ical-subscribe-btn:hover {
    background: linear-gradient(135deg, #0077ee 0%, #0055aa 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 204, 0.4);
}

.gsd-ical-subscribe-btn:active {
    transform: translateY(0);
}

.gsd-ical-subscribe-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Dropdown/Modal */
.gsd-ical-dropdown {
    display: none;
    position: relative;
    margin-top: 1rem;
    padding: 1rem;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
}

.gsd-ical-dropdown.active {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* Sezione dropdown */
.gsd-ical-section {
    margin-bottom: 1.25rem;
}

.gsd-ical-section:last-child {
    margin-bottom: 0;
}

.gsd-ical-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #495057;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e9ecef;
}

/* Lista opzioni */
.gsd-ical-options {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gsd-ical-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.gsd-ical-option:last-child {
    margin-bottom: 0;
}

.gsd-ical-option:hover {
    background: #e9ecef;
}

.gsd-ical-option-name {
    font-weight: 500;
    color: #212529;
}

/* Azioni */
.gsd-ical-actions {
    display: flex;
    gap: 0.5rem;
}

.gsd-ical-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.gsd-ical-action-btn svg {
    width: 18px;
    height: 18px;
}

/* Pulsante copia */
.gsd-ical-copy-btn {
    background: #6c757d;
    color: #ffffff;
}

.gsd-ical-copy-btn:hover {
    background: #5a6268;
}

.gsd-ical-copy-btn.copied {
    background: #28a745;
}

/* Pulsante webcal (Apple) */
.gsd-ical-webcal-btn {
    background: #000000;
    color: #ffffff;
}

.gsd-ical-webcal-btn:hover {
    background: #333333;
}

/* Pulsante Google */
.gsd-ical-google-btn {
    background: #ffffff;
    border: 1px solid #dadce0 !important;
}

.gsd-ical-google-btn:hover {
    background: #f8f9fa;
    border-color: #4285f4 !important;
}

.gsd-ical-google-btn svg {
    width: 18px;
    height: 18px;
}

/* Pulsante Outlook */
.gsd-ical-outlook-btn {
    background: #ffffff;
    border: 1px solid #0078d4 !important;
}

.gsd-ical-outlook-btn:hover {
    background: #f0f6fc;
    border-color: #106ebe !important;
}

.gsd-ical-outlook-btn svg {
    fill: #0078d4;
}

/* Pulsante download */
.gsd-ical-download-btn {
    background: #17a2b8;
    color: #ffffff;
}

.gsd-ical-download-btn:hover {
    background: #138496;
}

/* Tooltip */
.gsd-ical-action-btn[title] {
    position: relative;
}

.gsd-ical-action-btn::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.35rem 0.5rem;
    background: #212529;
    color: #ffffff;
    font-size: 0.75rem;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    margin-bottom: 5px;
}

.gsd-ical-action-btn:hover::after {
    opacity: 1;
    visibility: visible;
}

/* Messaggio feedback */
.gsd-ical-feedback {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 0.75rem 1.25rem;
    background: #28a745;
    color: #ffffff;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.gsd-ical-feedback.show {
    opacity: 1;
    transform: translateY(0);
}

.gsd-ical-feedback.error {
    background: #dc3545;
}

/* Stile per opzione "tutti gli eventi" */
.gsd-ical-option.gsd-ical-option-all {
    background: linear-gradient(135deg, #e7f1ff 0%, #cce0ff 100%);
    border: 1px solid #99c2ff;
}

.gsd-ical-option.gsd-ical-option-all:hover {
    background: linear-gradient(135deg, #cce0ff 0%, #b3d4ff 100%);
}

.gsd-ical-option.gsd-ical-option-all .gsd-ical-option-name {
    color: #004499;
}

/* Separatore */
.gsd-ical-separator {
    height: 1px;
    background: #dee2e6;
    margin: 1rem 0;
}

/* Responsive */
@media (max-width: 576px) {
    .gsd-ical-option {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .gsd-ical-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .gsd-ical-action-btn {
        flex: 1;
        max-width: 60px;
    }
}

/* Icone SVG inline */
.gsd-icon-calendar {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 4h-1V2h-2v2H8V2H6v2H5c-1.11 0-1.99.9-1.99 2L3 20c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 16H5V9h14v11zM9 11H7v2h2v-2zm4 0h-2v2h2v-2zm4 0h-2v2h2v-2z'/%3E%3C/svg%3E");
}

/* ================================================
   PULSANTI INLINE (accanto agli H2 delle tipologie)
   ================================================ */

/* Container per header con pulsante */
.gsd-ical-header-with-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.75rem !important;
    flex-wrap: wrap !important;
}

.gsd-ical-header-with-btn .wpem-heading-text {
    margin-right: 0 !important;
}

/* Wrapper pulsante inline */
.gsd-ical-inline-btn-wrapper {
    position: relative !important;
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 100 !important;
}

/* Pulsante inline */
.gsd-ical-inline-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    background: linear-gradient(135deg, #f7941d 0%, #e07c10 100%) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 2px 6px rgba(247, 148, 29, 0.4) !important;
    position: relative !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-left: 10px !important;
}

.gsd-ical-inline-btn:hover {
    background: linear-gradient(135deg, #ffaa33 0%, #f7941d 100%) !important;
    transform: scale(1.05);
    box-shadow: 0 3px 8px rgba(247, 148, 29, 0.5);
}

.gsd-ical-inline-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
    pointer-events: none;
}

/* Dropdown inline */
.gsd-ical-inline-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 8px;
    padding: 0.75rem;
    background: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e9ecef;
    z-index: 1000;
    min-width: 180px;
    white-space: nowrap;
}

.gsd-ical-inline-dropdown.active {
    display: block;
    animation: slideDown 0.2s ease;
}

/* Freccia del dropdown */
.gsd-ical-inline-dropdown::before {
    content: '';
    position: absolute;
    top: -8px;
    left: 12px;
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid #ffffff;
    filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.05));
}

/* Titolo dropdown inline */
.gsd-ical-inline-dropdown-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e9ecef;
}

/* Azioni inline */
.gsd-ical-inline-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.gsd-ical-inline-actions .gsd-ical-action-btn {
    width: 36px;
    height: 36px;
}

/* Responsive: dropdown a destra se troppo vicino al bordo */
@media (max-width: 576px) {
    .gsd-ical-inline-dropdown {
        left: auto;
        right: 0;
    }
    
    .gsd-ical-inline-dropdown::before {
        left: auto;
        right: 12px;
    }
    
    .gsd-ical-header-with-btn {
        flex-direction: column;
        align-items: flex-start;
    }
}
