/**
 * WaitN Design System - Utility Classes
 * Layout, display, and helper utilities
 */

/* ========================================
   DISPLAY UTILITIES
   ======================================== */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }
.d-flex { display: flex !important; }
.d-inline-flex { display: inline-flex !important; }
.d-grid { display: grid !important; }

/* ========================================
   FLEXBOX UTILITIES
   ======================================== */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-row-reverse { flex-direction: row-reverse; }
.flex-col-reverse { flex-direction: column-reverse; }

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

.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-initial { flex: 0 1 auto; }
.flex-none { flex: none; }

.flex-grow { flex-grow: 1; }
.flex-grow-0 { flex-grow: 0; }
.flex-shrink { flex-shrink: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* ========================================
   ALIGNMENT UTILITIES
   ======================================== */
.items-start { align-items: flex-start; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }
.items-baseline { align-items: baseline; }

.justify-start { justify-content: flex-start; }
.justify-center { justify-content: center; }
.justify-end { justify-content: flex-end; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

.self-auto { align-self: auto; }
.self-start { align-self: flex-start; }
.self-center { align-self: center; }
.self-end { align-self: flex-end; }
.self-stretch { align-self: stretch; }

/* ========================================
   GRID UTILITIES
   ======================================== */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* ========================================
   POSITION UTILITIES
   ======================================== */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.static { position: static; }

.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* ========================================
   Z-INDEX UTILITIES
   ======================================== */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-auto { z-index: auto; }

/* ========================================
   OVERFLOW UTILITIES
   ======================================== */
.overflow-auto { overflow: auto; }
.overflow-hidden { overflow: hidden; }
.overflow-visible { overflow: visible; }
.overflow-scroll { overflow: scroll; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-hidden { overflow-x: hidden; }
.overflow-y-hidden { overflow-y: hidden; }

/* ========================================
   BORDER UTILITIES
   ======================================== */
.border { border: 1px solid var(--wn-border-color); }
.border-0 { border: 0; }
.border-t { border-top: 1px solid var(--wn-border-color); }
.border-b { border-bottom: 1px solid var(--wn-border-color); }
.border-l { border-left: 1px solid var(--wn-border-color); }
.border-r { border-right: 1px solid var(--wn-border-color); }

.border-2 { border-width: 2px; }
.border-4 { border-width: 4px; }

/* ========================================
   BORDER RADIUS UTILITIES
   ======================================== */
.rounded-none { border-radius: var(--wn-rounded-none); }
.rounded-sm { border-radius: var(--wn-rounded-sm); }
.rounded-md { border-radius: var(--wn-rounded-md); }
.rounded-lg { border-radius: var(--wn-rounded-lg); }
.rounded-xl { border-radius: var(--wn-rounded-xl); }
.rounded-2xl { border-radius: var(--wn-rounded-2xl); }
.rounded-full { border-radius: var(--wn-rounded-full); }

.rounded-t-lg { border-top-left-radius: var(--wn-rounded-lg); border-top-right-radius: var(--wn-rounded-lg); }
.rounded-b-lg { border-bottom-left-radius: var(--wn-rounded-lg); border-bottom-right-radius: var(--wn-rounded-lg); }

/* ========================================
   SHADOW UTILITIES
   ======================================== */
.shadow-none { box-shadow: var(--wn-shadow-none); }
.shadow-xs { box-shadow: var(--wn-shadow-xs); }
.shadow-sm { box-shadow: var(--wn-shadow-sm); }
.shadow-md { box-shadow: var(--wn-shadow-md); }
.shadow-lg { box-shadow: var(--wn-shadow-lg); }
.shadow-xl { box-shadow: var(--wn-shadow-xl); }

/* ========================================
   CURSOR UTILITIES
   ======================================== */
.cursor-auto { cursor: auto; }
.cursor-default { cursor: default; }
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* ========================================
   POINTER EVENTS
   ======================================== */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* ========================================
   USER SELECT
   ======================================== */
.select-none { user-select: none; }
.select-text { user-select: text; }
.select-all { user-select: all; }

/* ========================================
   VISIBILITY
   ======================================== */
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* ========================================
   TRANSITION UTILITIES
   ======================================== */
.transition { transition: all var(--wn-transition-normal); }
.transition-fast { transition: all var(--wn-transition-fast); }
.transition-slow { transition: all var(--wn-transition-slow); }
.transition-none { transition: none; }

/* ========================================
   TRANSFORM UTILITIES
   ======================================== */
.rotate-45 { transform: rotate(45deg); }
.rotate-90 { transform: rotate(90deg); }
.rotate-180 { transform: rotate(180deg); }
.-rotate-45 { transform: rotate(-45deg); }
.-rotate-90 { transform: rotate(-90deg); }

.scale-95 { transform: scale(0.95); }
.scale-100 { transform: scale(1); }
.scale-105 { transform: scale(1.05); }
.scale-110 { transform: scale(1.1); }

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

.not-sr-only {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

/* ========================================
   TEXT COLOR UTILITIES
   ======================================== */
.wn-text-primary { color: var(--wn-text-primary, #0f172a); }
.wn-text-secondary { color: var(--wn-text-secondary, #64748b); }
.wn-text-muted { color: var(--wn-text-muted, #94a3b8); }
.wn-text-success { color: var(--wn-success, #10b981); }
.wn-text-warning { color: var(--wn-warning, #f59e0b); }
.wn-text-danger { color: var(--wn-danger, #ef4444); }
.wn-text-info { color: var(--wn-info, #3b82f6); }
.wn-text-purple { color: var(--wn-purple, #7c3aed); }
.wn-text-purple-light { color: var(--wn-purple-light, #a78bfa); }
.wn-text-teal { color: var(--wn-teal, #0d9488); }
.wn-text-amber { color: var(--wn-amber, #f59e0b); }
.wn-text-accent { color: var(--wn-accent, #06b6d4); }

/* Background utilities that change with palette */
.wn-bg-primary { background: var(--wn-primary); }
.wn-bg-primary-light { background: var(--wn-primary-light); }
.wn-bg-teal { background: var(--wn-teal); }
.wn-bg-teal-light { background: var(--wn-teal-light); }
.wn-bg-purple { background: var(--wn-purple); }
.wn-bg-purple-light { background: var(--wn-purple-light); }

/* ========================================
   ICON COLOR UTILITIES (with backgrounds)
   ======================================== */
.wn-icon-primary { 
    background: var(--wn-primary-light, #dbeafe); 
    color: var(--wn-primary, #3b82f6); 
}
.wn-icon-success { 
    background: var(--wn-success-light, #dcfce7); 
    color: var(--wn-success, #10b981); 
}
.wn-icon-warning { 
    background: var(--wn-warning-light, #fef3c7); 
    color: var(--wn-warning, #f59e0b); 
}
.wn-icon-danger { 
    background: var(--wn-danger-light, #fee2e2); 
    color: var(--wn-danger, #ef4444); 
}
.wn-icon-info { 
    background: var(--wn-info-light, #e0f2fe); 
    color: var(--wn-info, #0284c7); 
}
.wn-icon-teal { 
    background: var(--wn-teal-light, #ccfbf1); 
    color: var(--wn-teal, #0d9488); 
}
.wn-icon-purple { 
    background: var(--wn-purple-light, #ede9fe); 
    color: var(--wn-purple, #7c3aed); 
}
.wn-icon-amber { 
    background: var(--wn-amber-light, #fef3c7); 
    color: var(--wn-amber, #d97706); 
}

/* ========================================
   AVATAR COLOR UTILITIES
   ======================================== */
.wn-avatar-primary { 
    background: var(--wn-primary-light, #dbeafe); 
    color: var(--wn-primary, #2563eb); 
}
.wn-avatar-success { 
    background: var(--wn-success-light, #dcfce7); 
    color: var(--wn-success, #16a34a); 
}
.wn-avatar-warning { 
    background: var(--wn-warning-light, #fef3c7); 
    color: var(--wn-warning, #d97706); 
}
.wn-avatar-danger { 
    background: var(--wn-danger-light, #fee2e2); 
    color: var(--wn-danger, #dc2626); 
}
.wn-avatar-info { 
    background: var(--wn-info-light, #e0f2fe); 
    color: var(--wn-info, #0284c7); 
}
.wn-avatar-teal { 
    background: var(--wn-teal-light, #ccfbf1); 
    color: var(--wn-teal, #0d9488); 
}
.wn-avatar-purple { 
    background: var(--wn-purple-light, #ede9fe); 
    color: var(--wn-purple, #7c3aed); 
}
.wn-avatar-muted { 
    background: var(--wn-gray-100, #f1f5f9); 
    color: var(--wn-gray-500, #64748b); 
}

/* ========================================
   CARD UTILITIES
   ======================================== */
.wn-card {
    background: var(--wn-bg-card, #ffffff);
    border-radius: var(--wn-rounded-lg, 10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.wn-card-accent-purple {
    background: linear-gradient(135deg, var(--wn-purple-light, #ede9fe) 0%, #e0e7ff 100%);
}

.wn-card-accent-teal {
    background: linear-gradient(135deg, var(--wn-teal-light, #ccfbf1) 0%, #cffafe 100%);
}

.wn-card-accent-blue {
    background: linear-gradient(135deg, var(--wn-primary-light, #dbeafe) 0%, #e0f2fe 100%);
}

/* ========================================
   ALERT UTILITIES
   ======================================== */
.wn-alert {
    border-radius: var(--wn-rounded-lg, 10px);
    padding: 12px 16px;
}

.wn-alert-success {
    background: var(--wn-success-light, #dcfce7);
    border: 1px solid var(--wn-success-border, #bbf7d0);
    color: var(--wn-success-dark, #166534);
}

.wn-alert-warning {
    background: var(--wn-warning-light, #fef3c7);
    border: 1px solid var(--wn-warning-border, #fde68a);
    color: var(--wn-warning-dark, #92400e);
}

.wn-alert-danger {
    background: var(--wn-danger-light, #fee2e2);
    border: 1px solid var(--wn-danger-border, #fecaca);
    color: var(--wn-danger-dark, #991b1b);
}

.wn-alert-info {
    background: var(--wn-info-light, #e0f2fe);
    border: 1px solid var(--wn-info-border, #bae6fd);
    color: var(--wn-info-dark, #075985);
}

/* ========================================
   APP CONTENT AREA
   ======================================== */
.wn-app-content {
    background: var(--wn-bg-secondary, #f8fafc);
}

/* ========================================
   DEMO/TAG BADGES
   ======================================== */
.wn-tag {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 600;
    margin-left: 4px;
}

.wn-tag-success {
    background: var(--wn-success);
    color: var(--wn-white);
}

.wn-tag-primary {
    background: var(--wn-primary);
    color: var(--wn-white);
}

.wn-tag-purple {
    background: var(--wn-purple);
    color: var(--wn-white);
}

.wn-tag-indigo {
    background: var(--wn-indigo);
    color: var(--wn-white);
}
