/**
 * Synoveo Google OAuth-First Flow Styles
 *
 * Styles for new OAuth wizard UI (replaces email verification)
 */

/* OAuth Modal Container */
.synoveo-oauth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.synoveo-oauth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.synoveo-oauth-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 2;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    overflow-y: auto;
}

/* Header */
.synoveo-oauth-header {
    padding: 24px;
    border-bottom: 1px solid #e0e0e0;
    position: relative;
}

.synoveo-oauth-header h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    font-weight: 600;
    color: #202124;
}

.synoveo-oauth-subtitle {
    margin: 0;
    font-size: 14px;
    color: #5f6368;
}

.synoveo-oauth-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    color: #5f6368;
    border: none;
    background: none;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.synoveo-oauth-close:hover {
    background-color: #f8f9fa;
    color: #202124;
}

/* Body */
.synoveo-oauth-body {
    padding: 24px;
    flex: 1;
}

.synoveo-oauth-description {
    margin-bottom: 20px;
    text-align: center;
}

.synoveo-oauth-description p {
    margin: 0;
    font-size: 14px;
    color: #5f6368;
    line-height: 1.5;
}

/* Google Sign-In Button */
.synoveo-button-google {
    width: 100%;
    padding: 12px 24px;
    margin: 20px 0;
    border: 1px solid #dadce0;
    background: white;
    color: #3c4043;
    font-size: 15px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.2s;
    box-shadow: 0 1px 1px 0 rgba(66, 133, 244, 0.3), 0 1px 3px 1px rgba(66, 133, 244, 0.15);
}

.synoveo-button-google:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #4285f4;
    box-shadow: 0 1px 1px 1px rgba(66, 133, 244, 0.3), 0 1px 3px 1px rgba(66, 133, 244, 0.15);
}

.synoveo-button-google:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.synoveo-button-google .google-logo {
    width: 18px;
    height: 18px;
}

/* Permissions Box */
.synoveo-oauth-permissions {
    background: #f0f4ff;
    border-left: 4px solid #4285f4;
    padding: 16px;
    border-radius: 4px;
    margin: 20px 0;
}

.synoveo-oauth-permissions h4 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
    color: #202124;
    text-transform: uppercase;
}

.synoveo-oauth-permissions ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.synoveo-oauth-permissions li {
    margin: 8px 0;
    font-size: 13px;
    color: #3c4043;
    line-height: 1.4;
}

.synoveo-oauth-permissions li:before {
    content: "✓ ";
    color: #4285f4;
    font-weight: bold;
    margin-right: 8px;
}

/* Security Note */
.synoveo-oauth-note {
    margin: 20px 0 0 0;
    padding: 12px;
    background: #fff9e6;
    border-radius: 4px;
    font-size: 12px;
    color: #5f6368;
    line-height: 1.4;
    text-align: center;
    border: 1px solid #fce5cd;
}

/* Footer */
.synoveo-oauth-footer {
    padding: 16px 24px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.synoveo-oauth-footer .button {
    padding: 8px 16px;
    min-width: 100px;
}

/* Location Selector */
.synoveo-location-selector {
    padding: 8px 0;
}

.synoveo-location-selector h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #202124;
}

.synoveo-location-selector > p {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #5f6368;
}

.synoveo-locations-list {
    border: 1px solid #dadce0;
    border-radius: 4px;
    max-height: 300px;
    overflow-y: auto;
    margin: 16px 0;
}

.location-item {
    padding: 12px 16px;
    border-bottom: 1px solid #dadce0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.location-item:last-child {
    border-bottom: none;
}

.location-item:hover {
    background-color: #f8f9fa;
}

.location-item input[type="radio"] {
    margin-right: 12px;
    cursor: pointer;
}

.location-label {
    display: block;
    cursor: pointer;
}

.location-label strong {
    display: block;
    color: #202124;
    font-size: 14px;
    margin-bottom: 4px;
}

.location-address {
    font-size: 12px;
    color: #5f6368;
    line-height: 1.3;
}

.locations-list .loading,
.locations-list .error {
    padding: 24px;
    text-align: center;
    font-size: 14px;
    color: #5f6368;
}

.locations-list .error {
    color: #d33b27;
}

/* Success Screen */
.synoveo-success-container {
    text-align: center;
    padding: 20px 0;
}

.success-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.synoveo-success-container h3 {
    margin: 0 0 20px 0;
    font-size: 20px;
    font-weight: 600;
    color: #1f2937;
}

.success-details {
    background: #f0f4ff;
    border-radius: 4px;
    padding: 16px;
    margin: 20px 0;
    text-align: left;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 14px;
}

.detail-row .label {
    font-weight: 600;
    color: #202124;
    min-width: 80px;
}

.detail-row .value {
    color: #5f6368;
    word-break: break-word;
    text-align: right;
    flex: 1;
    margin-left: 12px;
}

.success-message {
    margin: 16px 0;
    font-size: 14px;
    color: #5f6368;
    line-height: 1.5;
}

/* Buttons */
.button {
    padding: 10px 18px;
    border: 1px solid #dadce0;
    background: white;
    color: #3c4043;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.button:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #5f6368;
}

.button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.button-primary {
    background: #4285f4;
    color: white;
    border-color: #4285f4;
}

.button-primary:hover:not(:disabled) {
    background: #3367d6;
    border-color: #3367d6;
}

/* Responsive */
@media (max-width: 480px) {
    .synoveo-oauth-container {
        max-width: 90%;
        max-height: 95vh;
    }

    .synoveo-oauth-header,
    .synoveo-oauth-body,
    .synoveo-oauth-footer {
        padding: 16px;
    }

    .synoveo-oauth-header h2 {
        font-size: 20px;
    }

    .synoveo-locations-list {
        max-height: 200px;
    }

    .detail-row {
        flex-direction: column;
    }

    .detail-row .label {
        min-width: auto;
        margin-bottom: 4px;
    }

    .detail-row .value {
        text-align: left;
        margin-left: 0;
    }

    .synoveo-oauth-footer {
        flex-direction: column-reverse;
    }

    .synoveo-oauth-footer .button {
        width: 100%;
    }
}

/* Loading state */
.synoveo-button-google:disabled::after {
    content: "";
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Accessibility */
.synoveo-oauth-modal *:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

button:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

input[type="radio"]:focus {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}
