/**
 * DiagramPro Frontend Viewer Styles
 */

.dpro-viewer-wrap {
    position: relative;
    width: 100%;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    outline: none;
}

.dpro-viewer-wrap:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Toolbar */
.dpro-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
}

.dpro-viewer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #475569;
    transition: background 0.15s, border-color 0.15s;
    text-decoration: none;
    line-height: 1;
}

.dpro-viewer-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #1e293b;
}

.dpro-viewer-btn:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

.dpro-viewer-zoom-level {
    font-size: 12px;
    color: #64748b;
    min-width: 36px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.dpro-viewer-toolbar-sep {
    width: 1px;
    height: 20px;
    background: #e2e8f0;
    margin: 0 2px;
}

/* Canvas area */
.dpro-viewer-canvas-wrap {
    width: 100%;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}

.dpro-viewer-canvas-wrap canvas {
    display: block;
    max-width: 100%;
}

/* Loading state */
.dpro-viewer-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: #64748b;
    gap: 12px;
    font-size: 14px;
}

.dpro-viewer-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e2e8f0;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: dpro-spin 0.8s linear infinite;
}

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

/* Error state */
.dpro-viewer-error {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: #ef4444;
    gap: 8px;
    font-size: 14px;
    text-align: center;
}

.dpro-viewer-error-icon {
    font-size: 32px;
}

.dpro-viewer-error-title {
    font-weight: 600;
    color: #dc2626;
}

.dpro-viewer-error-msg {
    color: #6b7280;
    font-size: 13px;
}

/* Fullscreen */
.dpro-viewer-wrap.dpro-fullscreen {
    border-radius: 0;
    border: none;
    width: 100vw !important;
    height: 100vh !important;
    display: flex;
    flex-direction: column;
}

.dpro-viewer-wrap.dpro-fullscreen .dpro-viewer-canvas-wrap {
    flex: 1;
    overflow: auto;
}

/* No diagram message */
.dpro-viewer-no-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    color: #94a3b8;
    font-size: 14px;
    font-style: italic;
}

/* Caption */
.dpro-viewer-caption {
    padding: 8px 14px;
    font-size: 13px;
    color: #64748b;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

/* Responsive */
@media (max-width: 600px) {
    .dpro-viewer-toolbar {
        padding: 6px 8px;
    }

    .dpro-viewer-btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Print */
@media print {
    .dpro-viewer-toolbar {
        display: none;
    }
}
