/*
Theme Name: Custom Component Theme
Description: A custom WordPress theme with resizable panels and component diagrams
Version: 1.0
*/

/* Reset and Base Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #374151;
}

/* Layout Styles */
.site-main {
    display: flex;
    height: 100vh;
    background-color: #f9fafb;
}

#left-panel {
    flex: 1;
    padding: 1.5rem;
    background-color: white;
    border-right: 1px solid #e5e7eb;
    overflow: auto;
}

#right-panel {
    background-color: white;
    border-left: 1px solid #e5e7eb;
    overflow: auto;
    min-width: 300px;
    max-width: 800px;
}

#resize-handle {
    width: 4px;
    background-color: #d1d5db;
    cursor: col-resize;
    transition: background-color 0.2s ease;
    position: relative;
}

#resize-handle:hover {
    background-color: #3b82f6;
}

#resize-handle:active {
    background-color: #1d4ed8;
}

/* Component Styles */
.component-item {
    transition: all 0.2s ease;
    transform-origin: center;
}

.component-item:hover {
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.1));
}

.component-item rect {
    transition: stroke-width 0.2s ease;
}

/* Panel Content Styles */
.component-details {
    animation: fadeIn 0.3s ease-in;
}

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

/* Status Badge Styles */
.status-badge {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
    font-size: 0.75rem;
    letter-spacing: 0.025em;
    text-transform: uppercase;
}

.status-badge.bg-green-100 {
    background-color: #dcfce7;
    color: #166534;
}

.status-badge.bg-yellow-100 {
    background-color: #fef3c7;
    color: #92400e;
}

.status-badge.bg-red-100 {
    background-color: #fee2e2;
    color: #991b1b;
}

.status-badge.bg-gray-100 {
    background-color: #f3f4f6;
    color: #374151;
}

/* Button Styles */
.btn-primary {
    background-color: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-secondary {
    background-color: white;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background-color: #f9fafb;
    border-color: #9ca3af;
}

/* Close Button */
#close-panel {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s ease;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#close-panel:hover {
    color: #374151;
}

/* Loading Animation */
.animate-spin {
    animation: spin 1s linear infinite;
}

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

/* Utility Classes */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

.space-y-2 > * + * {
    margin-top: 0.5rem;
}

.space-y-6 > * + * {
    margin-top: 1.5rem;
}

.space-x-3 > * + * {
    margin-left: 0.75rem;
}

.text-center {
    text-align: center;
}

.font-bold {
    font-weight: 700;
}

.font-semibold {
    font-weight: 600;
}

.font-medium {
    font-weight: 500;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-gray-900 {
    color: #111827;
}

.text-gray-800 {
    color: #1f2937;
}

.text-gray-700 {
    color: #374151;
}

.text-gray-600 {
    color: #4b5563;
}

.text-gray-500 {
    color: #6b7280;
}

.text-red-600 {
    color: #dc2626;
}

.text-blue-800 {
    color: #1e40af;
}

.text-green-500 {
    color: #10b981;
}

.bg-gray-50 {
    background-color: #f9fafb;
}

.bg-gray-100 {
    background-color: #f3f4f6;
}

.bg-blue-100 {
    background-color: #dbeafe;
}

.bg-blue-600 {
    background-color: #2563eb;
}

.bg-red-600 {
    background-color: #dc2626;
}

.border {
    border-width: 1px;
}

.border-gray-200 {
    border-color: #e5e7eb;
}

.border-gray-300 {
    border-color: #d1d5db;
}

.border-t {
    border-top-width: 1px;
}

.border-b {
    border-bottom-width: 1px;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-md {
    border-radius: 0.375rem;
}

.rounded-full {
    border-radius: 9999px;
}

.p-6 {
    padding: 1.5rem;
}

.p-8 {
    padding: 2rem;
}

.py-8 {
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.py-12 {
    padding-top: 3rem;
    padding-bottom: 3rem;
}

.px-3 {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

.py-1 {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.pb-4 {
    padding-bottom: 1rem;
}

.pt-4 {
    padding-top: 1rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 0.75rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mb-6 {
    margin-bottom: 1.5rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

.mr-3 {
    margin-right: 0.75rem;
}

.ml-3 {
    margin-left: 0.75rem;
}

.min-h-96 {
    min-height: 24rem;
}

.max-w-4xl {
    max-width: 56rem;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}

.w-1 {
    width: 0.25rem;
}

.w-4 {
    width: 1rem;
}

.h-4 {
    height: 1rem;
}

.w-8 {
    width: 2rem;
}

.h-8 {
    height: 2rem;
}

.w-12 {
    width: 3rem;
}

.h-12 {
    height: 3rem;
}

.w-full {
    width: 100%;
}

.h-auto {
    height: auto;
}

.h-screen {
    height: 100vh;
}

.flex-1 {
    flex: 1 1 0%;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-2 {
    gap: 0.5rem;
}

.leading-none {
    line-height: 1;
}

.leading-relaxed {
    line-height: 1.625;
}

.cursor-pointer {
    cursor: pointer;
}

.cursor-col-resize {
    cursor: col-resize;
}

.transition-opacity {
    transition-property: opacity;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.hover\:opacity-80:hover {
    opacity: 0.8;
}

.hover\:text-gray-700:hover {
    color: #374151;
}

.hover\:bg-blue-500:hover {
    background-color: #3b82f6;
}

.hover\:bg-blue-700:hover {
    background-color: #1d4ed8;
}

.hover\:bg-gray-50:hover {
    background-color: #f9fafb;
}

.hover\:bg-red-700:hover {
    background-color: #b91c1c;
}

/* Responsive Design */
@media (max-width: 768px) {
    .site-main {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    
    #left-panel {
        border-right: none;
        border-bottom: 1px solid #e5e7eb;
    }
    
    #right-panel {
        width: 100% !important;
        max-width: none;
        border-left: none;
        border-top: 1px solid #e5e7eb;
    }
    
    #resize-handle {
        display: none !important;
    }
}

@media (max-width: 480px) {
    #left-panel,
    #right-panel {
        padding: 1rem;
    }
    
    .component-details .flex.space-x-3 {
        flex-direction: column;
    }
    
    .component-details .flex.space-x-3 > * + * {
        margin-left: 0;
        margin-top: 0.75rem;
    }
}

/* Focus States for Accessibility */
.btn-primary:focus,
.btn-secondary:focus,
#close-panel:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.component-item:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    #right-panel,
    #resize-handle {
        display: none !important;
    }
    
    #left-panel {
        border: none;
        padding: 0;
    }
    
    .site-main {
        height: auto;
    }
}