/* Custom styles for Digital Process Map */

/* Base styles */
body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
}

/* Navigation styles */
.nav-btn {
    @apply px-4 py-2 text-sm font-medium text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded-md transition-colors;
}

.nav-btn.active {
    @apply text-blue-600 bg-blue-50;
}

.mobile-nav-btn {
    @apply block px-3 py-2 text-base font-medium text-gray-600 hover:text-gray-900 hover:bg-gray-100 rounded-md transition-colors w-full text-left;
}

/* Button styles */
.btn-primary {
    @apply inline-flex items-center px-4 py-2 bg-blue-600 text-white text-sm font-medium rounded-md hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors;
}

.btn-secondary {
    @apply inline-flex items-center px-4 py-2 bg-purple-600 text-white text-sm font-medium rounded-md hover:bg-purple-700 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:ring-offset-2 transition-colors;
}

.btn-accent {
    @apply inline-flex items-center px-4 py-2 bg-emerald-600 text-white text-sm font-medium rounded-md hover:bg-emerald-700 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2 transition-colors;
}

.btn-outline {
    @apply inline-flex items-center px-3 py-2 border border-gray-300 text-gray-700 text-sm font-medium rounded-md hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:ring-offset-2 transition-colors;
}

/* Tab content */
.tab-content {
    @apply transition-opacity duration-300;
}

.tab-content.hidden {
    @apply opacity-0;
}

/* Process Map Styles */
.process-node {
    cursor: move;
    transition: all 0.2s ease;
}

.process-node:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.process-node.selected {
    stroke: #2563eb;
    stroke-width: 3;
}

.process-connection {
    stroke: #6b7280;
    stroke-width: 2;
    fill: none;
    marker-end: url(#arrowhead);
}

.process-connection:hover {
    stroke: #2563eb;
    stroke-width: 3;
}

/* Process node types */
.process-start {
    fill: #10b981;
    rx: 50%;
}

.process-task {
    fill: #3b82f6;
    rx: 8;
}

.process-decision {
    fill: #f59e0b;
    transform-origin: center;
    transform: rotate(45deg);
}

.process-end {
    fill: #ef4444;
    rx: 50%;
}

.process-text {
    fill: white;
    font-size: 12px;
    font-weight: 500;
    text-anchor: middle;
    dominant-baseline: middle;
    pointer-events: none;
}

/* Activity styles */
.activity-item {
    @apply flex items-center p-4 border-l-4 border-gray-200 hover:border-blue-500 transition-colors;
}

.activity-item.audit {
    @apply border-purple-500;
}

.activity-item.compliance {
    @apply border-emerald-500;
}

.activity-item.issue {
    @apply border-red-500;
}

.activity-item.improvement {
    @apply border-blue-500;
}

/* Report button styles */
.report-btn {
    @apply flex flex-col items-center justify-center p-6 border-2 border-dashed border-gray-300 rounded-lg hover:border-blue-500 hover:bg-blue-50 transition-colors cursor-pointer text-center;
}

.report-btn:hover {
    @apply text-blue-600;
}

/* Audit styles */
.audit-checklist {
    @apply space-y-3;
}

.audit-item {
    @apply flex items-start p-3 bg-gray-50 rounded-lg;
}

.audit-item input[type="checkbox"] {
    @apply mr-3 mt-1 h-4 w-4 text-blue-600 border-gray-300 rounded focus:ring-blue-500;
}

.audit-item.completed {
    @apply bg-green-50;
}

.audit-item.failed {
    @apply bg-red-50;
}

/* Compliance badge styles */
.compliance-badge {
    @apply px-2 py-1 text-xs font-medium rounded-full;
}

.compliance-badge.conformant {
    @apply bg-green-100 text-green-800;
}

.compliance-badge.review {
    @apply bg-yellow-100 text-yellow-800;
}

.compliance-badge.non-conformant {
    @apply bg-red-100 text-red-800;
}

/* Chart container styles */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Modal styles */
.modal-header {
    @apply flex items-center justify-between p-6 border-b border-gray-200;
}

.modal-body {
    @apply p-6;
}

.modal-footer {
    @apply flex items-center justify-end space-x-3 p-6 border-t border-gray-200;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .process-node {
        transform: scale(0.8);
    }
    
    .process-text {
        font-size: 10px;
    }
    
    .nav-btn {
        @apply px-3 py-1 text-xs;
    }
    
    /* Mobile optimizations */
    .grid {
        @apply gap-3;
    }
    
    .modal-content {
        @apply mx-2 max-h-screen overflow-y-auto;
    }
    
    .chart-container canvas {
        @apply max-w-full;
    }
}

@media (max-width: 640px) {
    /* Small mobile devices */
    h1 {
        @apply text-lg;
    }
    
    h2 {
        @apply text-xl;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-accent,
    .btn-outline {
        @apply px-3 py-2 text-sm;
    }
    
    .grid-cols-1 {
        @apply space-y-4;
    }
    
    .process-map {
        min-height: 400px;
    }
    
    .audit-checklist {
        @apply text-sm;
    }
    
    .activity-item {
        @apply p-3 text-sm;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    /* Tablet optimizations */
    .process-node {
        transform: scale(0.9);
    }
    
    .grid-cols-2 {
        @apply grid-cols-1;
    }
    
    .grid-cols-3 {
        @apply grid-cols-2;
    }
    
    .grid-cols-4 {
        @apply grid-cols-2;
    }
}

@media (min-width: 1025px) {
    /* Desktop optimizations */
    .process-node {
        transform: scale(1);
    }
    
    .modal-content {
        @apply max-w-4xl;
    }
}

/* Animation utilities */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes slideIn {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body {
        @apply bg-gray-900 text-white;
    }
    
    .nav-btn {
        @apply text-gray-300 hover:text-white hover:bg-gray-700;
    }
    
    .nav-btn.active {
        @apply text-blue-400 bg-gray-800;
    }
}

/* Print styles */
@media print {
    .nav-btn,
    .btn-primary,
    .btn-secondary,
    .btn-accent,
    .btn-outline {
        @apply text-black bg-white border border-black;
    }
    
    #process-map {
        @apply border-black;
    }
    
    .tab-content.hidden {
        @apply block opacity-100;
    }
}

/* Accessibility improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
button:focus,
input:focus,
select:focus,
textarea:focus {
    @apply outline-none ring-2 ring-blue-500 ring-offset-2;
}

/* Custom scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    @apply bg-gray-100 rounded-full;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    @apply bg-gray-400 rounded-full hover:bg-gray-600;
}

/* Touch device optimizations */
.touch-device {
    /* Larger touch targets */
    button, .btn-primary, .btn-secondary, .btn-accent, .btn-outline {
        @apply min-h-11 min-w-11;
    }
    
    /* Better touch feedback */
    .process-node {
        cursor: grab;
    }
    
    .process-node:active {
        cursor: grabbing;
    }
    
    /* Improved scrolling */
    .overflow-y-auto {
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent text selection during drag operations */
    .process-map {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Touch-friendly form elements */
    input[type="text"], 
    input[type="number"], 
    input[type="date"], 
    select, 
    textarea {
        @apply min-h-11 text-base; /* Prevent zoom on iOS */
    }
}

/* Loading states */
.loading {
    @apply opacity-50 pointer-events-none;
}

.spinner {
    @apply animate-spin h-5 w-5 border-2 border-gray-300 border-t-blue-600 rounded-full;
}

/* Tooltip styles */
.tooltip {
    @apply absolute z-10 px-2 py-1 text-xs text-white bg-gray-900 rounded shadow-lg pointer-events-none;
    transform: translateX(-50%);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1f2937 transparent transparent transparent;
}

/* Drag and drop styles */
.drag-over {
    @apply border-blue-500 bg-blue-50;
}

.dragging {
    @apply opacity-50;
}

/* Status indicators */
.status-dot {
    @apply inline-block w-2 h-2 rounded-full mr-2;
}

.status-dot.active {
    @apply bg-green-500;
}

.status-dot.warning {
    @apply bg-yellow-500;
}

.status-dot.error {
    @apply bg-red-500;
}

.status-dot.inactive {
    @apply bg-gray-400;
}

/* Progress indicators */
.progress-bar {
    @apply w-full bg-gray-200 rounded-full h-2;
}

.progress-fill {
    @apply h-2 rounded-full transition-all duration-300 ease-out;
}

.progress-fill.low {
    @apply bg-red-500;
}

.progress-fill.medium {
    @apply bg-yellow-500;
}

.progress-fill.high {
    @apply bg-green-500;
}