/* assets/apple-styles.css - Stili Apple coordinati con Google */

/* Wrapper Apple */
.wcgl-apple-wrapper {
    margin: 15px 0;
    text-align: center;
}

/* Bottone Apple - Stile coordinato con Google ma distintivo */
.wcgl-apple-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 24px;
    background: #000;
    border: 1px solid #000;
    border-radius: 4px;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 1px 2px 0 rgba(0,0,0,0.3), 0 1px 3px 1px rgba(0,0,0,0.15);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-width: 200px; /* Stessa larghezza minima di Google */
}

.wcgl-apple-button:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
    box-shadow: 0 1px 3px 0 rgba(0,0,0,0.4), 0 4px 8px 3px rgba(0,0,0,0.2);
    transform: translateY(-1px);
    color: #fff;
}

.wcgl-apple-button:active {
    background: #333;
    transform: translateY(0);
    color: #fff;
}

.wcgl-apple-button:focus {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
}

/* Icona Apple */
.wcgl-apple-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.wcgl-apple-icon path {
    fill: currentColor;
}

/* Testo bottone Apple */
.wcgl-apple-button .wcgl-button-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 500;
}

/* Privacy notice Apple (stesso stile di Google) */
.wcgl-apple-wrapper .wcgl-privacy-notice {
    margin-top: 15px;
    font-size: 12px;
    color: #666;
    line-height: 1.5;
}

.wcgl-apple-wrapper .wcgl-privacy-notice a {
    text-decoration: underline;
}

.wcgl-apple-wrapper .wcgl-privacy-notice a:hover {
    text-decoration: underline;
}

/* Loading state per Apple */
.wcgl-apple-button.loading {
    pointer-events: none;
    opacity: 0.7;
    cursor: not-allowed;
}

.wcgl-apple-button.loading .wcgl-button-text::after {
    content: '...';
    display: inline-block;
    animation: wcgl-apple-dots 1.4s infinite;
}

@keyframes wcgl-apple-dots {
    0%, 60%, 100% {
        opacity: 0;
    }
    30% {
        opacity: 1;
    }
}

/* Responsive per Apple */
@media (max-width: 480px) {
    .wcgl-apple-button {
        width: 100%;
        max-width: 280px;
    }
}

/* Spaziatura tra bottoni Google e Apple */
.wcgl-login-wrapper + .wcgl-apple-wrapper {
    margin-top: 10px;
}

/* Varianti colore per temi diversi */
@media (prefers-color-scheme: dark) {
    .wcgl-apple-button {
        background: #fff;
        border-color: #dadce0;
        color: #000;
    }
    
    .wcgl-apple-button:hover {
        background: #f0f0f0;
        border-color: #dadce0;
        color: #000;
    }
    
    .wcgl-apple-button:active {
        background: #e0e0e0;
    }
}

/* Supporto temi WordPress scuri */
.wp-dark-mode .wcgl-apple-button,
.dark-theme .wcgl-apple-button {
    background: #fff;
    border-color: #dadce0;
    color: #000;
}

.wp-dark-mode .wcgl-apple-button:hover,
.dark-theme .wcgl-apple-button:hover {
    background: #f0f0f0;
    border-color: #dadce0;
    color: #000;
}

/* Accessibilità */
.wcgl-apple-button:focus-visible {
    outline: 2px solid #007AFF;
    outline-offset: 2px;
}

/* Stato disabilitato */
.wcgl-apple-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Icona di caricamento personalizzata per Apple */
.wcgl-apple-button.loading .wcgl-apple-icon {
    animation: wcgl-apple-spin 1s linear infinite;
}

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

/* Coordinamento con Google button per layout uniforme */
.wcgl-login-wrapper,
.wcgl-apple-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Assicura che entrambi i bottoni abbiano la stessa larghezza */
.wcgl-google-button,
.wcgl-apple-button {
    width: 100%;
    max-width: 280px;
    justify-content: center;
    box-sizing: border-box;
}

/* Layout side-by-side per schermi più grandi (opzionale) */
@media (min-width: 768px) {
    .wcgl-buttons-container {
        display: flex;
        gap: 15px;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .wcgl-buttons-container .wcgl-login-wrapper,
    .wcgl-buttons-container .wcgl-apple-wrapper {
        flex: 0 1 auto;
        margin: 0;
    }
    
    .wcgl-buttons-container .wcgl-google-button,
    .wcgl-buttons-container .wcgl-apple-button {
        max-width: 200px;
    }
}