/* Linkshow Contact Popup Styles */

/* Popup Overlay */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(2px);
    display: none; /* Hidden by default */
}

/* Show popup when active */
.popup-overlay.show,
.popup-overlay.active,
.popup-overlay[style*="display: flex"] {
    display: flex !important;
}

/* Popup Container */
.popup-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: popupSlideIn 0.3s ease-out;
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Popup Header */
.popup-header {
    display: flex;
    justify-content: flex-end;
    padding: 15px 20px 0;
}

.popup-close {
    background: #f5f5f5;
    border: 2px solid #d3d3d3;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    color: #999999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.popup-close:hover {
    background: #e8e8e8;
    color: #777777;
    border-color: #c0c0c0;
}

/* Popup Content */
.popup-content {
    padding: 0 30px 30px;
}

.popup-title {
    font-size: 32px;
    font-weight: 700;
    color: #333;
    margin: 0 0 8px;
    text-align: center;
}

.popup-description {
    color: #666;
    font-size: 16px;
    text-align: center;
    margin: 0 0 8px;
    line-height: 1.5;
}

.popup-subtitle {
    color: #666;
    font-size: 14px;
    text-align: center;
    margin: 0 0 30px;
    line-height: 1.4;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

/* 双列布局 */
.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.form-col {
    flex: 1;
    margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .form-row {
        flex-direction: row;
        gap: 15px;
        flex-wrap: wrap;
    }
    
    .form-col {
        flex: 1;
        min-width: calc(50% - 7.5px);
        margin-bottom: 20px;
    }
    
    .popup-container {
        max-width: 95%;
        margin: 20px;
    }
}

/* 更小屏幕时保持双列布局 */
@media (max-width: 480px) {
    .form-row {
        flex-direction: row;
        gap: 10px;
        flex-wrap: wrap;
    }
    
    .form-col {
        flex: 1;
        min-width: calc(50% - 5px);
        margin-bottom: 20px;
    }
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.required {
    color: #e74c3c;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* Popup Actions */
.popup-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 25px;
}

/* 提交按钮样式 - 使用更高优先级 */
.popup-overlay .btn-submit,
#contactPopup .btn-submit,
button.btn-submit {
    padding: 12px 24px !important;
    border: none !important;
    border-radius: 8px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
    display: inline-block !important;
    text-align: center !important;
    background-color: #00a65a !important;
    color: white !important;
    box-shadow: none !important;
}

/* 提交按钮悬停和激活状态 */
.popup-overlay .btn-submit:hover,
#contactPopup .btn-submit:hover,
button.btn-submit:hover {
    background-color: #008d4c !important;
    transform: translateY(-1px) !important;
    box-shadow: none !important;
}

.popup-overlay .btn-submit:active,
#contactPopup .btn-submit:active,
button.btn-submit:active {
    transform: translateY(0) !important;
}

.btn-icon {
    font-size: 14px;
}

/* 保留原有按钮样式以兼容 */
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #ecf0f1;
    color: #333;
}

.btn-secondary:hover {
    background-color: #d5dbdb;
}

/* Popup Message */
.popup-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    text-align: center;
}

.popup-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.popup-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Loading State */
.btn-primary.loading {
    opacity: 0.7;
    cursor: not-allowed;
    position: relative;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
}

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

/* Popup Button Styles - 使用主题默认样式 */
.linkshow-popup-trigger {
    /* 继承主题的按钮样式 */
    background-color: #00a65a !important;
    color: white !important;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 166, 90, 0.3);
}

.linkshow-popup-trigger:hover {
    background-color: #008d4c !important;
    color: white !important;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 166, 90, 0.4);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .popup-container {
        width: 95%;
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .popup-content {
        padding: 0 20px 20px;
    }
    
    .popup-title {
        font-size: 24px;
    }
    
    .popup-actions {
        flex-direction: column;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        margin: 0;
    }
}

@media (max-width: 480px) {
    .popup-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        margin: 0;
        max-height: 100vh;
    }
    
    .popup-content {
        padding: 0 15px 15px;
    }
    
    .form-group input,
    .form-group textarea {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

/* Prevent body scroll when popup is open */
body.popup-open {
    overflow: hidden;
}