/* ChatStack WordPress Plugin Admin Styles */

.chatstack-header {
    background: linear-gradient(135deg, #1a73e8 0%, #4285f4 100%);
    color: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    box-shadow: 0 2px 10px rgba(26, 115, 232, 0.2);
}

.chatstack-header h2 {
    color: white;
    margin: 0 0 8px 0;
    font-size: 24px;
}

.chatstack-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 16px;
}

.chatstack-logo {
    display: flex;
    flex-direction: column;
}

/* Field Groups */
.chatstack-field-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.chatstack-field-group input[type="text"] {
    min-width: 300px;
}

.chatstack-field-group .description {
    flex-basis: 100%;
    margin: 8px 0 0 0;
}

/* Verification Status */
.verification-status {
    display: inline-block;
    margin-left: 10px;
    font-weight: 600;
}

.verification-status .success {
    color: #46b450;
}

.verification-status .error {
    color: #dc3232;
}

.verification-status .loading {
    color: #0073aa;
    position: relative;
}

.verification-status .loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    margin-left: 8px;
    border: 2px solid #0073aa;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: chatstack-spin 1s linear infinite;
    vertical-align: middle;
}

@keyframes chatstack-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Color Preview */
.color-preview {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    vertical-align: middle;
}

/* Character Counter */
.character-count {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

.character-count.over-limit {
    color: #dc3232;
    font-weight: 600;
}

/* Info Box */
.chatstack-info-box {
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}

.chatstack-info-box h3 {
    margin-top: 0;
    color: #1a73e8;
}

.chatstack-info-box ul {
    list-style: none;
    padding: 0;
}

.chatstack-info-box li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.chatstack-info-box li:last-child {
    border-bottom: none;
}

.chatstack-info-box a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.chatstack-info-box a:hover {
    text-decoration: underline;
}

/* Verify Button */
#verify-chatbot {
    background: #2271B1 !important;
    border-color: #2271B1 !important;
    color: white !important;
    transition: all 0.3s ease;
}

#verify-chatbot:hover:not(:disabled) {
    background: #1557b0 !important;
    border-color: #1557b0 !important;
}

#verify-chatbot:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Advanced Toggle */
.chatstack-advanced-toggle {
    background: transparent !important;
    border: 1px solid #ddd !important;
    color: #555 !important;
    padding: 8px 16px !important;
    border-radius: 4px !important;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chatstack-advanced-toggle:hover {
    background: #f7f7f7 !important;
    border-color: #ccc !important;
}

/* Form Table Enhancements */
.form-table th {
    font-weight: 600;
    color: #333;
}

.form-table td {
    padding: 20px 10px 15px 0;
}

.form-table input[type="text"],
.form-table textarea {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 12px;
    transition: border-color 0.3s ease;
}

.form-table input[type="text"]:focus,
.form-table textarea:focus {
    border-color: #1a73e8;
    outline: none;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
}

/* Color Input */
.form-table input[type="color"] {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px;
    width: 60px;
    height: 40px;
    cursor: pointer;
}

/* Checkbox Styling */
.form-table input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .chatstack-field-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .chatstack-field-group input[type="text"] {
        min-width: 100%;
        margin-bottom: 10px;
    }
    
    .chatstack-header {
        padding: 15px;
    }
    
    .chatstack-header h2 {
        font-size: 20px;
    }
}

/* Success/Error Messages */
.notice.chatstack-notice {
    border-left-color: #1a73e8;
}

.notice.chatstack-notice.notice-success {
    border-left-color: #46b450;
}

.notice.chatstack-notice.notice-error {
    border-left-color: #dc3232;
}

/* Settings Page Layout */
.wrap .form-table {
    margin-top: 0;
}

/* Tooltip Styles */
.chatstack-tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
}

.chatstack-tooltip::after {
    content: '?';
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #666;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    line-height: 16px;
    text-align: center;
    margin-left: 5px;
}

.chatstack-tooltip:hover::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}