/* Entra ID Authentication Plugin Styles */

/* Login button styles */
.entra-id-login-wrapper {
    margin: 0 0 30px 0;
    text-align: center;
}

.entra-id-separator {
    position: relative;
    margin: 20px 0 0 0;
    text-align: center;
    color: #72777c;
    font-size: 13px;
}

.entra-id-separator:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ddd;
    z-index: 1;
}

.entra-id-separator span {
    background: #fff;
    padding: 0 15px;
    position: relative;
    z-index: 2;
    font-style: italic;
    opacity: 0.8;
}

.entra-id-login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    background: #fff;
    color: #5e5e5e;
    text-decoration: none;
    border: 1px solid #8c8c8c;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    font-family: "Segoe UI", system-ui, sans-serif;
    transition: all 0.2s ease;
    width: 100%;
    max-width: 320px;
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.entra-id-login-button:hover {
    background: #f8f8f8;
    color: #5e5e5e;
    text-decoration: none;
    border-color: #8c8c8c;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.entra-id-login-button:active {
    background: #f0f0f0;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.entra-id-login-button:focus {
    outline: 2px solid #0078d4;
    outline-offset: 2px;
}

.entra-id-login-button svg {
    margin-right: 12px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.entra-id-login-button:hover svg {
    transform: scale(1.05);
}

/* Loading state for the button */
.entra-id-login-button.loading {
    pointer-events: none;
    opacity: 0.7;
}

.entra-id-login-button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #5e5e5e;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* User profile styles */
.entra-linked {
    color: #00a32a;
    font-weight: 600;
}

.entra-linked .dashicons {
    color: #00a32a;
    margin-right: 5px;
}

.entra-not-linked {
    color: #d63638;
    font-weight: 600;
}

.entra-not-linked .dashicons {
    color: #d63638;
    margin-right: 5px;
}

/* Alternative Microsoft-branded button style */
.entra-id-login-button.ms-branded {
    background: #0078d4;
    color: #fff;
    border: 1px solid #106ebe;
    font-weight: 500;
}

.entra-id-login-button.ms-branded:hover {
    background: #106ebe;
    color: #fff;
    border-color: #005a9e;
    box-shadow: 0 4px 8px rgba(16, 110, 190, 0.3);
}

.entra-id-login-button.ms-branded:active {
    background: #005a9e;
}

.entra-id-login-button.ms-branded svg {
    filter: brightness(0) invert(1);
}

/* Responsive design */
@media (max-width: 782px) {
    .entra-id-login-button {
        padding: 14px 24px;
        font-size: 16px;
    }
}

/* Loading state */
.entra-id-login-button.loading {
    opacity: 0.7;
    pointer-events: none;
}

.entra-id-login-button.loading:after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #5e5e5e;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: entra-spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes entra-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error messages */
.entra-auth-error {
    background: #fcf2f2;
    border: 1px solid #d63638;
    color: #d63638;
    padding: 12px;
    margin: 20px 0;
    border-radius: 3px;
}

.entra-auth-success {
    background: #f0f8f0;
    border: 1px solid #00a32a;
    color: #00a32a;
    padding: 12px;
    margin: 20px 0;
    border-radius: 3px;
}

/* WordPress login form integration - button above form */
.login .entra-id-login-wrapper {
    margin-bottom: 30px;
    margin-top: 0;
}

body.login .entra-id-login-button {
    background: #0073aa;
    color: #fff;
    border-color: #005a87;
}

body.login .entra-id-login-button:hover {
    background: #005a87;
    color: #fff;
    border-color: #004a6b;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .entra-id-login-button {
        border: 2px solid;
    }
    
    .entra-id-separator:before {
        background: #000;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .entra-id-separator span {
        background: #1d2327;
        color: #f0f0f1;
    }
    
    .entra-id-login-button {
        background: #2c3338;
        color: #f0f0f1;
        border-color: #50575e;
    }
    
    .entra-id-login-button:hover {
        background: #1d2327;
        border-color: #72777c;
    }
}

/* Admin area specific styles */
.wp-admin .entra-id-login-button {
    background: #f6f7f7;
    color: #2c3338;
    border-color: #8c8f94;
}

.wp-admin .entra-id-login-button:hover {
    background: #f0f0f1;
}

/* Focus styles for accessibility */
.entra-id-login-button:focus-visible {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .entra-id-login-wrapper {
        display: none;
    }
}