/**
 * Doozer Admin Overlay Toolbox
 * Glassmorphism design with smooth animations
 * Only visible to logged-in admins on business pages
 */

/* Floating Admin Bug/Icon */
.doozer-admin-bug {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
    cursor: pointer;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    animation: pulse 2s infinite;
}

.doozer-admin-bug:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 48px rgba(102, 126, 234, 0.6);
}

.doozer-admin-bug.active {
    transform: scale(0.9);
    opacity: 0.7;
}

.doozer-admin-bug svg {
    width: 32px;
    height: 32px;
    fill: white;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.4);
    }
    50% {
        box-shadow: 0 8px 32px rgba(102, 126, 234, 0.6), 0 0 0 8px rgba(102, 126, 234, 0.1);
    }
}

/* Overlay Panel */
.doozer-admin-overlay {
    position: fixed;
    top: 0;
    right: -450px;
    width: 420px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: -4px 0 32px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    transition: right 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.doozer-admin-overlay.active {
    right: 0;
}

/* Dark mode variant */
@media (prefers-color-scheme: dark) {
    .doozer-admin-overlay {
        background: rgba(26, 32, 44, 0.95);
        color: #f7fafc;
    }
}

/* Overlay Header */
.doozer-overlay-header {
    padding: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.doozer-overlay-title {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.doozer-overlay-title svg {
    width: 24px;
    height: 24px;
}

.doozer-overlay-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.doozer-overlay-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Domain Info Bar */
.doozer-domain-info {
    padding: 16px 24px;
    background: rgba(102, 126, 234, 0.1);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
    flex-shrink: 0;
}

.doozer-domain-name {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 4px;
}

.doozer-domain-status {
    font-size: 12px;
    color: #718096;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doozer-status-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.doozer-status-badge.configured {
    background: #48bb78;
    color: white;
}

.doozer-status-badge.pending {
    background: #ed8936;
    color: white;
}

/* Tab Navigation */
.doozer-tabs {
    display: flex;
    padding: 0 24px;
    background: rgba(247, 250, 252, 0.8);
    border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    flex-shrink: 0;
}

.doozer-tab {
    padding: 16px 20px;
    background: none;
    border: none;
    color: #718096;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.doozer-tab svg {
    width: 16px;
    height: 16px;
}

.doozer-tab:hover {
    color: #667eea;
}

.doozer-tab.active {
    color: #667eea;
}

.doozer-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px 3px 0 0;
}

/* Tab Content */
.doozer-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.doozer-tab-panel {
    display: none;
    animation: fadeIn 0.3s ease;
}

.doozer-tab-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Styles */
.doozer-section {
    margin-bottom: 24px;
}

.doozer-section-title {
    font-size: 14px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.doozer-section-description {
    font-size: 13px;
    color: #718096;
    margin-bottom: 16px;
    line-height: 1.5;
}

/* Action Buttons */
.doozer-action-btn {
    width: 100%;
    padding: 14px 20px;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    color: #2d3748;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
}

.doozer-action-btn:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
    transform: translateX(4px);
}

.doozer-action-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}

.doozer-action-btn.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.3), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100%);
    }
}

.doozer-action-btn-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.doozer-action-btn svg {
    width: 20px;
    height: 20px;
    fill: #667eea;
}

.doozer-action-btn-text {
    text-align: left;
}

.doozer-action-btn-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
}

.doozer-action-btn-desc {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #718096;
    margin-top: 2px;
}

.doozer-action-btn-arrow {
    width: 16px;
    height: 16px;
    fill: #cbd5e0;
    transition: transform 0.2s ease;
}

.doozer-action-btn:hover .doozer-action-btn-arrow {
    transform: translateX(4px);
}

/* Primary Action Button */
.doozer-action-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
}

.doozer-action-btn.primary .doozer-action-btn-label {
    color: white;
}

.doozer-action-btn.primary .doozer-action-btn-desc {
    color: rgba(255, 255, 255, 0.9);
}

.doozer-action-btn.primary svg {
    fill: white;
}

.doozer-action-btn.primary .doozer-action-btn-arrow {
    fill: white;
}

.doozer-action-btn.primary:hover {
    transform: translateX(4px) scale(1.02);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

/* Danger Action Button */
.doozer-action-btn.danger {
    border-color: #fc8181;
}

.doozer-action-btn.danger:hover {
    background: rgba(252, 129, 129, 0.1);
    border-color: #f56565;
}

.doozer-action-btn.danger svg {
    fill: #f56565;
}

/* Stats Grid */
.doozer-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.doozer-stat-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.doozer-stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #667eea;
    display: block;
}

.doozer-stat-label {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
    display: block;
}

/* Alert Messages */
.doozer-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.doozer-alert svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.doozer-alert-content {
    flex: 1;
}

.doozer-alert-title {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.doozer-alert-message {
    font-size: 13px;
    line-height: 1.5;
}

.doozer-alert.success {
    background: rgba(72, 187, 120, 0.1);
    border: 1px solid rgba(72, 187, 120, 0.3);
}

.doozer-alert.success svg {
    fill: #48bb78;
}

.doozer-alert.success .doozer-alert-title {
    color: #2f855a;
}

.doozer-alert.success .doozer-alert-message {
    color: #38a169;
}

.doozer-alert.error {
    background: rgba(245, 101, 101, 0.1);
    border: 1px solid rgba(245, 101, 101, 0.3);
}

.doozer-alert.error svg {
    fill: #f56565;
}

.doozer-alert.error .doozer-alert-title {
    color: #c53030;
}

.doozer-alert.error .doozer-alert-message {
    color: #e53e3e;
}

.doozer-alert.info {
    background: rgba(66, 153, 225, 0.1);
    border: 1px solid rgba(66, 153, 225, 0.3);
}

.doozer-alert.info svg {
    fill: #4299e1;
}

.doozer-alert.info .doozer-alert-title {
    color: #2c5282;
}

.doozer-alert.info .doozer-alert-message {
    color: #3182ce;
}

/* Loading Spinner */
.doozer-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Diagnostic Results */
.doozer-diagnostic-results {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-top: 16px;
}

.doozer-diagnostic-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.doozer-diagnostic-label {
    font-size: 13px;
    color: #4a5568;
    font-weight: 500;
}

.doozer-diagnostic-value {
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.doozer-diagnostic-value.pass {
    color: #48bb78;
}

.doozer-diagnostic-value.fail {
    color: #f56565;
}

.doozer-diagnostic-value svg {
    width: 16px;
    height: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .doozer-admin-overlay {
        width: 100%;
        right: -100%;
    }

    .doozer-admin-bug {
        bottom: 16px;
        right: 16px;
        width: 56px;
        height: 56px;
    }
}

/* Smooth Scrollbar */
.doozer-content::-webkit-scrollbar {
    width: 8px;
}

.doozer-content::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.3);
}

.doozer-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 4px;
}

.doozer-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}
