/* iOS WKWebView适配的UI组件样式 */

/* Modal Dialog Styles */
.webview-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.webview-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.webview-modal {
    background-color: #fff;
    border-radius: 12px;
    max-width: 320px;
    width: 90%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: scale(0.8);
    transition: all 0.3s ease;
}

.webview-modal-overlay.show .webview-modal {
    transform: scale(1);
}

.webview-modal-header {
    padding: 20px 20px 10px;
    text-align: center;
}

.webview-modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.webview-modal-body {
    padding: 10px 20px 20px;
    text-align: center;
}

.webview-modal-message {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.webview-modal-buttons {
    display: flex;
    border-top: 1px solid #e0e0e0;
}

.webview-modal-button {
    flex: 1;
    padding: 15px;
    border: none;
    background: none;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.webview-modal-button:not(:last-child) {
    border-right: 1px solid #e0e0e0;
}

.webview-modal-button.cancel {
    color: #666;
}

.webview-modal-button.confirm {
    color: #007AFF;
    font-weight: 600;
}

.webview-modal-button:hover {
    background-color: #f5f5f5;
}

.webview-modal-button:active {
    background-color: #e0e0e0;
}

/* Toast Notification Styles */
.webview-toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    pointer-events: none;
}

.webview-toast {
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    margin-bottom: 10px;
    transform: translateY(-50px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: auto;
    max-width: 280px;
    text-align: center;
}

.webview-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.webview-toast.success {
    background-color: rgba(76, 175, 80, 0.9);
}

.webview-toast.error {
    background-color: rgba(244, 67, 54, 0.9);
}

.webview-toast.warning {
    background-color: rgba(255, 152, 0, 0.9);
}

.webview-toast.info {
    background-color: rgba(33, 150, 243, 0.9);
}

/* Loading Spinner */
.webview-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.webview-loading-overlay.show {
    opacity: 1;
    visibility: visible;
}

.webview-loading-content {
    background-color: #fff;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.webview-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007AFF;
    border-radius: 50%;
    animation: webview-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes webview-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.webview-loading-text {
    color: #333;
    font-size: 14px;
}

/* Safe area adjustments for iOS */
@supports (padding-top: constant(safe-area-inset-top)) {
    .webview-toast-container {
        top: calc(20px + constant(safe-area-inset-top));
    }
}

@supports (padding-top: env(safe-area-inset-top)) {
    .webview-toast-container {
        top: calc(20px + env(safe-area-inset-top));
    }
}
