/**
 * WCAS Utility CSS System
 * Tailwind-inspired utility classes for WCAS theme components
 * Provides atomic CSS classes for rapid development
 */

/* ==========================================================================
   BUTTON RESET - Override WordPress theme defaults
   ========================================================================== */

/* ==========================================================================
   BUTTON RESET UTILITIES - Apply selectively
   ========================================================================== */

/* Complete reset utility - use .wcas-btn-reset class when needed */
.wcas-btn-reset {
    all: unset !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-style: none !important;
    border-width: 0 !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    text-decoration: none !important;
    text-align: center !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    -webkit-border-radius: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    background-color: transparent !important;
    color: inherit !important;
    font-size: inherit !important;
    outline: none !important;
    vertical-align: baseline !important;
    display: inline-block !important;
    cursor: pointer !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Targeted reset only for modal close buttons */
.wcas-modal-close,
.wcas-btn-remove-x {
    /* Reset all WordPress/theme button styles for X button only */
    all: unset !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    border-style: none !important;
    border-width: 0 !important;
    font-family: inherit !important;
    font-weight: inherit !important;
    line-height: inherit !important;
    text-decoration: none !important;
    text-align: center !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    -webkit-border-radius: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    background-color: transparent !important;
    color: inherit !important;
    font-size: inherit !important;
    outline: none !important;
    vertical-align: baseline !important;
    display: inline-block !important;
    cursor: pointer !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
}

/* Specific modal close button styling after reset */
.wcas-modal-close,
.wcas-btn-remove-x {
    /* Position and layout */
    position: absolute !important;
    top: -0.5rem !important;
    right: -0.5rem !important;
    width: 2rem !important;
    height: 2rem !important;
    
    /* Visual styling */
    background-color: rgba(255, 255, 255, 0.95) !important;
    border-radius: 50% !important;
    color: #9ca3af !important;
    
    /* Layout */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    /* Effects */
    box-shadow: 0 10px 25px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05) !important;
    backdrop-filter: blur(8px) !important;
    transition: all 200ms cubic-bezier(0.4, 0, 0.2, 1) !important;
    
    /* Interaction */
    cursor: pointer !important;
    z-index: 100 !important;
}

.wcas-modal-close:hover,
.wcas-btn-remove-x:hover {
    background-color: #f3f4f6 !important;
    color: #6b7280 !important;
    transform: scale(1.05) !important;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15), 0 8px 12px rgba(0,0,0,0.1) !important;
}

/* SVG icon inside close button */
.wcas-modal-close svg,
.wcas-btn-remove-x svg {
    width: 1.25rem !important;
    height: 1.25rem !important;
    pointer-events: none !important;
    stroke: currentColor !important;
    fill: none !important;
}

/* Debug: Visual confirmation that CSS is loading */
.wcas-legacy-card {
    position: relative !important;
}

/* ==========================================================================
   POSITIONING UTILITIES
   ========================================================================== */

.absolute { position: absolute; }
.relative { position: relative; }
.fixed { position: fixed; }
.static { position: static; }

/* Position values */
.top-0 { top: 0; }
.top-1 { top: 0.25rem; }
.top-2 { top: 0.5rem; }
.-top-2 { top: -0.5rem; }
.-top-3 { top: -0.75rem; }
.right-0 { right: 0; }
.right-1 { right: 0.25rem; }
.right-2 { right: 0.5rem; }
.-right-2 { right: -0.5rem; }
.-right-3 { right: -0.75rem; }

/* Z-Index */
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-50 { z-index: 50; }

/* ==========================================================================
   SIZING UTILITIES
   ========================================================================== */

/* Width */
.w-4 { width: 1rem; }
.w-5 { width: 1.25rem; }
.w-6 { width: 1.5rem; }
.w-7 { width: 1.75rem; }
.w-8 { width: 2rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-full { width: 100%; }

/* Height */
.h-4 { height: 1rem; }
.h-5 { height: 1.25rem; }
.h-6 { height: 1.5rem; }
.h-7 { height: 1.75rem; }
.h-8 { height: 2rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }

/* ==========================================================================
   FLEXBOX UTILITIES
   ========================================================================== */

.flex { display: flex; }
.inline-flex { display: inline-flex; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* ==========================================================================
   SPACING UTILITIES
   ========================================================================== */

/* Padding */
.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }

/* Margin */
.m-0 { margin: 0; }
.m-1 { margin: 0.25rem; }
.m-2 { margin: 0.5rem; }
.m-auto { margin: auto; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mr-2 { margin-right: 0.5rem; }

/* ==========================================================================
   BORDER RADIUS UTILITIES
   ========================================================================== */

.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* ==========================================================================
   BACKGROUND UTILITIES
   ========================================================================== */

/* Colors */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-400 { background-color: #9ca3af; }
.bg-gray-600 { background-color: #6b7280; }
.bg-red-500 { background-color: #ef4444; }
.bg-blue-500 { background-color: #3b82f6; }
.bg-green-500 { background-color: #10b981; }

/* Opacity backgrounds */
.bg-white\/90 { background-color: rgba(255, 255, 255, 0.9); }
.bg-white\/95 { background-color: rgba(255, 255, 255, 0.95); }
.bg-gray-100\/90 { background-color: rgba(243, 244, 246, 0.9); }

/* ==========================================================================
   TEXT UTILITIES
   ========================================================================== */

/* Colors */
.text-white { color: #ffffff; }
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-600 { color: #4b5563; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-red-500 { color: #ef4444; }
.text-blue-600 { color: #2563eb; }

/* Font weights */
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* Font sizes */
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }

/* ==========================================================================
   BORDER UTILITIES
   ========================================================================== */

.border { border-width: 1px; }
.border-0 { border-width: 0; }
.border-2 { border-width: 2px; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.border-red-300 { border-color: #fca5a5; }

/* ==========================================================================
   SHADOW UTILITIES
   ========================================================================== */

.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06); }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); }
.shadow-2xl { box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); }

/* Modal-specific shadows */
.shadow-modal { box-shadow: 0 10px 25px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05); }
.shadow-modal-hover { box-shadow: 0 20px 40px rgba(0,0,0,0.15), 0 8px 12px rgba(0,0,0,0.1); }

/* ==========================================================================
   TRANSITION UTILITIES
   ========================================================================== */

.transition { transition-property: color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }
.transition-all { transition-property: all; 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; }
.transition-transform { transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms; }

/* Duration */
.duration-200 { transition-duration: 200ms; }
.duration-300 { transition-duration: 300ms; }

/* ==========================================================================
   TRANSFORM UTILITIES
   ========================================================================== */

.scale-105 { transform: scale(1.05); }
.scale-110 { transform: scale(1.1); }

/* ==========================================================================
   CURSOR UTILITIES
   ========================================================================== */

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* ==========================================================================
   BACKDROP FILTER UTILITIES
   ========================================================================== */

.backdrop-blur-sm { backdrop-filter: blur(4px); }
.backdrop-blur { backdrop-filter: blur(8px); }
.backdrop-blur-md { backdrop-filter: blur(12px); }

/* ==========================================================================
   WCAS-SPECIFIC COMPONENT CLASSES
   ========================================================================== */

/* Modal Close Button */
.wcas-modal-close {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    width: 2rem;
    height: 2rem;
    background-color: rgba(255, 255, 255, 0.95);
    color: #9ca3af;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
    backdrop-filter: blur(8px);
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
    cursor: pointer;
    z-index: 10;
    border: none;
}

.wcas-modal-close:hover {
    background-color: #f3f4f6;
    color: #6b7280;
    transform: scale(1.05);
    box-shadow: 0 20px 40px rgba(0,0,0,0.15), 0 8px 12px rgba(0,0,0,0.1);
}

/* Button Base */
.wcas-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition-property: color, background-color, border-color;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
    cursor: pointer;
    border: 1px solid transparent;
}

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

.wcas-btn-primary:hover {
    background-color: #1d4ed8;
}

.wcas-btn-secondary {
    background-color: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.wcas-btn-secondary:hover {
    background-color: #e5e7eb;
}

.wcas-btn-danger {
    background-color: #ef4444;
    color: #ffffff;
}

.wcas-btn-danger:hover {
    background-color: #dc2626;
}

/* Card Components */
.wcas-card {
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    position: relative;
}

.wcas-card-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
}

.wcas-card-body {
    padding: 1rem;
}

/* Product Card Specific */
.wcas-product-card {
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    position: relative;
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 200ms;
}

.wcas-product-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Legacy Enhanced Theme Specific */
.wcas-legacy-enhanced .wcas-existing-item {
    border-color: #bbf7d0;
    background-color: rgba(240, 253, 244, 0.3);
}

/* ==========================================================================
   RESPONSIVE UTILITIES
   ========================================================================== */

/* Mobile-first approach */
@media (min-width: 640px) {
    .sm\:w-auto { width: auto; }
    .sm\:p-6 { padding: 1.5rem; }
}

@media (min-width: 768px) {
    .md\:w-1\/2 { width: 50%; }
    .md\:p-8 { padding: 2rem; }
    .md\:text-lg { font-size: 1.125rem; line-height: 1.75rem; }
}

@media (min-width: 1024px) {
    .lg\:w-1\/3 { width: 33.333333%; }
    .lg\:p-10 { padding: 2.5rem; }
}