towerops/assets/css/app.css

191 lines
5.4 KiB
CSS

/* See the Tailwind configuration guide for advanced usage
https://tailwindcss.com/docs/configuration */
@import "tailwindcss" source(none);
@source "../css";
@source "../js";
@source "../../lib/towerops_web";
/* Heroicons plugin */
@plugin "../vendor/heroicons";
/* ── Custom variants ── */
@custom-variant phx-click-loading (.phx-click-loading&, .phx-click-loading &);
@custom-variant phx-submit-loading (.phx-submit-loading&, .phx-submit-loading &);
@custom-variant phx-change-loading (.phx-change-loading&, .phx-change-loading &);
/* Use the data attribute for dark mode */
@custom-variant dark (&:where([data-theme=dark], [data-theme=dark] *));
/* ── Reusable utility classes (replaces daisyUI component classes) ── */
/* Card — replaces daisyUI `card card-body bg-base-100 border-base-200` */
@utility card {
border-radius: 0.5rem;
border: 1px solid #e5e7eb;
background: #f9fafb;
padding: 1.5rem;
}
[data-theme="dark"] .card {
border-color: #374151;
background: #111827;
}
/* Badge — replaces daisyUI `badge` */
@utility badge {
display: inline-flex;
align-items: center;
border-radius: 9999px;
padding-inline: 0.625rem;
padding-block: 0.125rem;
font-size: 0.75rem;
font-weight: 500;
line-height: 1.25rem;
}
/* Button base — replaces daisyUI `btn` (for standalone usage outside core_components) */
@utility btn {
display: inline-flex;
align-items: center;
gap: 0.5rem;
border-radius: 0.25rem;
padding-inline: 1rem;
padding-block: 0.5rem;
font-size: 0.875rem;
font-weight: 500;
line-height: 1.25rem;
cursor: pointer;
border: 1px solid transparent;
background: #e5e7eb;
color: #111827;
transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}
[data-theme="dark"] .btn {
background: #374151;
color: #f9fafb;
}
/* ── Base element styles (replaces daisyUI resets) ── */
/* Make LiveView wrapper divs transparent for layout */
[data-phx-session], [data-phx-teleported-src] { display: contents }
/* Hide 1Password live region */
[id="1p-live-region"] { display: none !important; }
/* Sidebar layout */
#app-sidebar {
width: 14rem;
transition: width 0.2s ease;
}
html.sidebar-collapsed #app-sidebar {
width: 4rem;
}
html.sidebar-collapsed [data-sidebar-text] {
display: none;
}
html.sidebar-collapsed [data-sidebar-section] {
display: none;
}
html.sidebar-collapsed .sidebar-collapse-icon {
transform: rotate(180deg);
}
.sidebar-collapse-icon {
transition: transform 0.2s ease;
}
html.sidebar-collapsed [data-sidebar-tooltip] {
position: relative;
}
html.sidebar-collapsed [data-sidebar-tooltip]:hover::after {
content: attr(data-sidebar-tooltip);
position: absolute;
left: 100%;
top: 50%;
transform: translateY(-50%);
margin-left: 0.5rem;
padding: 0.25rem 0.5rem;
border-radius: 0.25rem;
font-size: 0.75rem;
white-space: nowrap;
z-index: 50;
background-color: #1f2937;
color: #fff;
pointer-events: none;
}
#main-wrapper {
transition: width 0.2s ease;
}
/* ── Animations ── */
/* Page transitions */
@keyframes fadeIn {
from { opacity: 0; transform: translateY(4px); }
to { opacity: 1; transform: translateY(0); }
}
.page-fade-in { animation: fadeIn 0.15s ease-out; }
/* Smooth transitions on interactive elements */
.card, .btn, .badge {
transition: box-shadow 0.15s ease, transform 0.15s ease;
}
/* Subtle hover lift on cards */
.card-hover:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
transform: translateY(-1px);
}
@media (prefers-color-scheme: dark) {
.card-hover:hover {
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
}
/* Status pulse animation for live indicators */
@keyframes statusPulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.status-pulse { animation: statusPulse 2s ease-in-out infinite; }
/* Skeleton shimmer effect */
@keyframes shimmer {
0% { background-position: -200% 0; }
100% { background-position: 200% 0; }
}
.skeleton-shimmer {
background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.08) 50%, transparent 75%);
background-size: 200% 100%;
animation: shimmer 1.5s ease-in-out infinite;
}
/* ── Global element styles ── */
/* Scrollbar styling for webkit */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.25); }
[data-theme="dark"] ::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.15); }
[data-theme="dark"] ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.25); }
/* Table row hover highlight */
tbody tr:hover td { background-color: rgba(59, 130, 246, 0.04); }
[data-theme="dark"] tbody tr:hover td { background-color: rgba(59, 130, 246, 0.08); }
/* Focus ring styling */
:focus-visible {
outline: 2px solid #3b82f6;
outline-offset: 2px;
}
/* Global smooth transitions for interactive elements */
a, button, input, select, textarea {
transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
/* Password strength indicator (JS-driven via classes) */
.password-strength-bar.strength-weak { background-color: #ef4444; }
.password-strength-bar.strength-fair { background-color: #eab308; }
.password-strength-bar.strength-good { background-color: #22c55e; }
.password-strength-bar.strength-strong { background-color: #16a34a; }