/* ══════════════════════════════════════════════
   Mail7 — Modern Gmail-Style Webmail UI
   Glassmorphism · Micro-animations · Refined shadows
   ══════════════════════════════════════════════ */

/* =========== RESET =========== */
*,::before,::after{box-sizing:border-box;border:0 solid #e5e7eb}
html{line-height:1.5;-webkit-text-size-adjust:100%}
body{margin:0;font-family:system-ui,-apple-system,'Segoe UI',Roboto,Helvetica,Arial,sans-serif;background:#f8fafc}
h1,h2,h3,p{margin:0}
a{color:inherit;text-decoration:inherit}
img,svg{display:block;vertical-align:middle}
input,textarea,button,select{font:inherit;color:inherit}
button{cursor:pointer;background:0 0;-webkit-appearance:button}
[x-cloak]{display:none!important}

/* =========== MODERN KEYFRAMES =========== */
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
@keyframes slideUp{from{opacity:0;transform:translateY(16px)}to{opacity:1;transform:translateY(0)}}
@keyframes slideDown{from{opacity:0;transform:translateY(-12px)}to{opacity:1;transform:translateY(0)}}
@keyframes scaleIn{from{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}
@keyframes spin{to{transform:rotate(360deg)}}
@keyframes shimmer{0%{transform:translateX(-100%)}100%{transform:translateX(100%)}}
@keyframes pulse-soft{0%,100%{opacity:1}50%{opacity:.6}}
@keyframes skeleton{0%,100%{opacity:.35}50%{opacity:.7}}
@keyframes float{0%,100%{transform:translateY(0)}50%{transform:translateY(-6px)}}
@keyframes gradientShift{0%{background-position:0 50%}50%{background-position:100% 50%}100%{background-position:0 50%}}

/* =========== MODERN UTILITY ANIMATIONS =========== */
.animate-fade-in{animation:fadeIn .4s ease-out}
.animate-slide-up{animation:slideUp .5s cubic-bezier(.16,1,.3,1)}
.animate-slide-down{animation:slideDown .4s cubic-bezier(.16,1,.3,1)}
.animate-scale-in{animation:scaleIn .3s ease-out}
.animate-spin{animation:spin 1s linear infinite}
.animate-spin-slow{animation:spin 10s linear infinite}
.animate-pulse-soft{animation:pulse-soft 2s ease-in-out infinite}
.animate-float{animation:float 4s ease-in-out infinite}
.animate-skeleton{animation:skeleton 1.8s ease-in-out infinite}
.animate-gradient{animation:gradientShift 3s ease infinite;background-size:200% 200%}

/* =========== LAYOUT =========== */
.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}
.hidden{display:none}.block{display:block}.inline{display:inline}.contents{display:contents}
.flex-col{flex-direction:column}.flex-row{flex-direction:row}.flex-wrap{flex-wrap:wrap}
.flex-1{flex:1 1 0%}.flex-none{flex:none}.shrink-0{flex-shrink:0}.grow{flex-grow:1}
.items-start{align-items:flex-start}.items-center{align-items:center}.items-end{align-items:flex-end}
.justify-center{justify-content:center}.justify-between{justify-content:space-between}
.self-start{align-self:flex-start}
.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}
.space-y-0\.5>*+*{margin-top:.125rem}.space-y-3>*+*{margin-top:.75rem}.space-y-5>*+*{margin-top:1.25rem}
.grid-cols-2{grid-template-columns:repeat(2,1fr)}

/* =========== POSITIONING =========== */
.relative{position:relative}.absolute{position:absolute}.fixed{position:fixed}.sticky{position:sticky}
.inset-0{inset:0}.inset-y-0{top:0;bottom:0}
.top-1\/2{top:50%}.left-1\/2{left:50%}.left-3{left:.75rem}.-left-1\.5{left:-.375rem}
.right-8{right:2rem}.bottom-0{bottom:0}.bottom-6{bottom:1.5rem}
.-translate-x-1\/2{transform:translateX(-50%)}.-translate-y-1\/2{transform:translateY(-50%)}
.translate-x-0{transform:translateX(0)}.-translate-x-full{transform:translateX(-100%)}
.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}
.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}

/* =========== SIZING =========== */
.w-full{width:100%}.w-fit{width:fit-content}.w-screen{width:100vw}
.w-3{width:.75rem}.w-4{width:1rem}.w-5{width:1.25rem}.w-8{width:2rem}.w-9{width:2.25rem}
.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-20{width:5rem}.w-64{width:16rem}.w-72{width:18rem}
.h-full{height:100%}.h-screen{height:100vh}
.h-3{height:.75rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-8{height:2rem}.h-9{height:2.25rem}
.h-10{height:2.5rem}.h-12{height:3rem}.h-16{height:4rem}.h-20{height:5rem}
.min-h-screen{min-height:100vh}.min-h-0{min-height:0}
.max-w-md{max-width:28rem}.max-w-lg{max-width:32rem}.max-w-2xl{max-width:42rem}
.max-w-none{max-width:none}.max-w-\[150px\]{max-width:150px}
.max-h-\[60vh\]{max-height:60vh}
.size-full{width:100%;height:100%}

/* =========== SPACING =========== */
.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}
.p-6{padding:1.5rem}.p-8{padding:2rem}
.px-1{padding-left:.25rem;padding-right:.25rem}
.px-2{padding-left:.5rem;padding-right:.5rem}
.px-3{padding-left:.75rem;padding-right:.75rem}
.px-4{padding-left:1rem;padding-right:1rem}
.px-6{padding-left:1.5rem;padding-right:1.5rem}
.py-1{padding-top:.25rem;padding-bottom:.25rem}
.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}
.py-2{padding-top:.5rem;padding-bottom:.5rem}
.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}
.py-3{padding-top:.75rem;padding-bottom:.75rem}
.py-3\.5{padding-top:.875rem;padding-bottom:.875rem}
.py-4{padding-top:1rem;padding-bottom:1rem}
.py-8{padding-top:2rem;padding-bottom:2rem}
.py-12{padding-top:3rem;padding-bottom:3rem}
.py-16{padding-top:4rem;padding-bottom:4rem}
.pt-2{padding-top:.5rem}.pt-4{padding-top:1rem}
.pb-3{padding-bottom:.75rem}
.pl-10{padding-left:2.5rem}
.m-0{margin:0}.m-auto{margin:auto}
.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}
.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-8{margin-bottom:2rem}
.mt-0{margin-top:0}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}
.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}
.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-2{margin-right:.5rem}
.-ml-1\.5{margin-left:-.375rem}

/* =========== TYPOGRAPHY =========== */
.text-xs{font-size:.75rem;line-height:1rem}
.text-sm{font-size:.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}
.text-2xl{font-size:1.5rem;line-height:2rem}
.text-3xl{font-size:1.875rem;line-height:2.25rem}
.text-5xl{font-size:3rem;line-height:1}
.font-light{font-weight:300}.font-normal{font-weight:400}.font-medium{font-weight:500}
.font-semibold{font-weight:600}.font-bold{font-weight:700}
.uppercase{text-transform:uppercase}
.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}
.leading-relaxed{line-height:1.625}
.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}
.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.whitespace-nowrap{white-space:nowrap}
.break-words{word-wrap:break-word}.break-all{word-break:break-all}
.antialiased{-webkit-font-smoothing:antialiased}
.prose-sm :where(p){margin:.5em 0}

/* =========== MODERN COLOR SYSTEM =========== */
/* Primary: Refined blue */
.text-primary{color:#1d4ed8}.bg-primary{background:#1d4ed8}
.text-primary-50{color:#eff6ff}.text-primary-500{color:#3b82f6}
.bg-primary-50{background:#eff6ff}.bg-primary-500{background:#3b82f6}

/* Neutrals */
.text-white{color:#fff}
.text-gray-100{color:#f3f4f6}.text-gray-200{color:#e5e7eb}.text-gray-300{color:#d1d5db}
.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-gray-900{color:#111827}
.text-red-500{color:#ef4444}.text-red-600{color:#dc2626}
.text-blue-600{color:#2563eb}.text-blue-700{color:#1d4ed8}
.text-green-500{color:#22c55e}.text-green-600{color:#16a34a}
.bg-white{background:#fff}
.bg-black{background:#000}.bg-black\/30{background:rgba(0,0,0,.3)}
.bg-gray-50{background:#f9fafb}.bg-gray-100{background:#f3f4f6}.bg-gray-200{background:#e5e7eb}
.bg-gray-700{background:#374151}.bg-gray-900{background:#111827}
.bg-red-50{background:#fef2f2}.bg-red-100{background:#fee2e2}
.bg-blue-50{background:#eff6ff}.bg-blue-100{background:#dbeafe}
.bg-green-50{background:#f0fdf4}
.border-white{border-color:#fff}
.border-gray-100{border-color:#f3f4f6}.border-gray-200{border-color:#e5e7eb}
.border-gray-300{border-color:#d1d5db}.border-gray-400{border-color:#9ca3af}
.placeholder\:\:text-gray-400::placeholder{color:#9ca3af}
.placeholder\:\:text-gray-500::placeholder{color:#6b7280}

/* Gmail custom colors (refined) */
.text-gmail-blue{color:#1a56db}.text-gmail-unread{color:#1e40af}
.text-gmail-red{color:#dc2626}.text-gmail-secondary{color:#64748b}.text-gmail-text{color:#1e293b}
.bg-gmail-sidebar{background:#f1f5f9}.bg-gmail-blue{background:#1a56db}
.bg-gmail-active{background:#eff6ff}.bg-gmail-hover{background:#f8fafc}
.border-gmail-blue{border-color:#1a56db}.border-l-gmail-blue{border-left-color:#1a56db}

/* =========== BORDERS =========== */
.border{border-width:1px}.border-0{border-width:0}
.border-t{border-top-width:1px}.border-b{border-bottom-width:1px}
.border-l-4{border-left-width:4px}.border-r{border-right-width:1px}
.rounded-sm{border-radius:.125rem}.rounded{border-radius:.25rem}
.rounded-lg{border-radius:.5rem}.rounded-xl{border-radius:.75rem}
.rounded-2xl{border-radius:1rem}.rounded-full{border-radius:9999px}
.rounded-t-xl{border-top-left-radius:.75rem;border-top-right-radius:.75rem}

/* =========== GLASS EFFECTS =========== */
.glass{background:rgba(255,255,255,.8);backdrop-filter:blur(20px) saturate(180%);-webkit-backdrop-filter:blur(20px) saturate(180%);border-bottom:1px solid rgba(0,0,0,.06)}
.glass-heavy{background:rgba(255,255,255,.92);backdrop-filter:blur(32px) saturate(180%);-webkit-backdrop-filter:blur(32px) saturate(180%)}
.glass-card{background:rgba(255,255,255,.7);backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);border:1px solid rgba(255,255,255,.8);box-shadow:0 1px 3px rgba(0,0,0,.04),0 4px 16px rgba(0,0,0,.04)}
.glass-dark{background:rgba(15,23,42,.85);backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px)}

/* =========== MODERN SHADOWS =========== */
.shadow-xs{box-shadow:0 1px 2px rgba(0,0,0,.03)}
.shadow-sm{box-shadow:0 1px 2px rgba(0,0,0,.04),0 1px 3px rgba(0,0,0,.04)}
.shadow-md{box-shadow:0 1px 3px rgba(0,0,0,.04),0 4px 12px rgba(0,0,0,.06)}
.shadow-lg{box-shadow:0 1px 3px rgba(0,0,0,.04),0 8px 24px rgba(0,0,0,.08)}
.shadow-xl{box-shadow:0 1px 3px rgba(0,0,0,.04),0 16px 48px rgba(0,0,0,.1)}
.shadow-2xl{box-shadow:0 1px 3px rgba(0,0,0,.04),0 24px 64px rgba(0,0,0,.12)}
.shadow-glow{box-shadow:0 0 40px rgba(26,86,219,.08)}
.shadow-inner-ring{box-shadow:inset 0 1px 0 rgba(255,255,255,.5)}
.opacity-0{opacity:0}.opacity-25{opacity:.25}.opacity-50{opacity:.5}
.opacity-75{opacity:.75}.opacity-100{opacity:1}

/* =========== MODERN TRANSITIONS =========== */
.transition-all{transition:all .2s cubic-bezier(.4,0,.2,1)}
.transition{transition-property:color,background,border,outline,text-decoration,transform,box-shadow,opacity;transition-duration:.2s;transition-timing-function:cubic-bezier(.4,0,.2,1)}
.transition-transform{transition-property:transform;transition-duration:.25s;transition-timing-function:cubic-bezier(.16,1,.3,1)}
.transition-opacity{transition:opacity .2s ease}
.transition-shadow{transition:box-shadow .25s ease}
.duration-150{transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.duration-500{transition-duration:.5s}
.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}
.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}
.ease-spring{transition-timing-function:cubic-bezier(.16,1,.3,1)}

/* =========== MICRO-INTERACTIONS =========== */
/* Hover lift */
.hover-lift{transition:transform .25s cubic-bezier(.16,1,.3,1),box-shadow .25s ease}
.hover-lift:hover{transform:translateY(-2px);box-shadow:0 4px 16px rgba(0,0,0,.08)}

/* Hover scale */
.hover-scale{transition:transform .2s ease}
.hover-scale:hover{transform:scale(1.04)}

/* Press effect */
.press:active{transform:scale(.97);transition:transform .1s ease}

/* Focus ring (refined) */
.focus-ring:focus-visible{outline:2px solid #3b82f6;outline-offset:2px;border-radius:4px}

.cursor-pointer{cursor:pointer}
.cursor-not-allowed{cursor:not-allowed}
.select-none{user-select:none}
.resize-none{resize:none}
.outline-none{outline:2px solid transparent;outline-offset:2px}
.pointer-events-none{pointer-events:none}

/* Focus states */
.focus\:border-gmail-blue:focus{border-color:#1a56db}
.focus\:ring-1:focus{box-shadow:0 0 0 1px rgba(0,0,0,.05)}
.focus\:ring-2:focus{box-shadow:0 0 0 2px rgba(59,130,246,.15)}
.focus\:ring-blue-100:focus{box-shadow:0 0 0 3px rgba(59,130,246,.1)}
.focus\:shadow-md:focus{box-shadow:0 1px 3px rgba(0,0,0,.04),0 4px 12px rgba(0,0,0,.06)}
.focus\:bg-white:focus{background:#fff}

/* Hover states (refined) */
.hover\:bg-gray-50:hover{background:#f8fafc}
.hover\:bg-gray-100:hover{background:#f1f5f9}
.hover\:bg-gray-200:hover{background:#e2e8f0}
.hover\:bg-gray-700:hover{background:#334155}
.hover\:bg-blue-50:hover{background:#eff6ff}
.hover\:bg-blue-600:hover{background:#1d4ed8}
.hover\:bg-green-600:hover{background:#16a34a}
.hover\:text-blue-600:hover{color:#2563eb}
.hover\:text-red-500:hover{color:#ef4444}
.hover\:text-gmail-blue:hover{color:#1a56db}
.hover\:border-gmail-blue:hover{border-color:#1a56db}
.hover\:shadow-md:hover{box-shadow:0 1px 3px rgba(0,0,0,.04),0 4px 12px rgba(0,0,0,.06)}
.hover\:shadow-lg:hover{box-shadow:0 1px 3px rgba(0,0,0,.04),0 8px 24px rgba(0,0,0,.08)}
.hover\:underline:hover{text-decoration:underline}
.hover\:opacity-80:hover{opacity:.8}
.hover\:brightness-105:hover{filter:brightness(1.05)}

/* Disabled */
.disabled\:opacity-50:disabled{opacity:.5}
.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}

/* Group hover */
.group:hover .group-hover\:text-blue-600{color:#2563eb}
.group:hover .group-hover\:text-gmail-blue{color:#1a56db}
.group:hover .group-hover\:opacity-100{opacity:1}
.group:hover .group-hover\:block{display:block}

/* =========== MODERN COMPONENTS =========== */

/* Email row — refined card-like feel */
.email-row{transition:box-shadow .2s ease,transform .15s ease,border-color .2s ease;border-left:4px solid transparent}
.email-row:hover{box-shadow:0 1px 3px rgba(0,0,0,.04),0 4px 12px rgba(0,0,0,.04);z-index:1;position:relative;border-left-color:transparent}

/* Sidebar — refined */
.sidebar-item{transition:all .2s cubic-bezier(.4,0,.2,1);border-radius:0 20px 20px 0;margin-right:4px}
.sidebar-item:hover{background:rgba(0,0,0,.04)}
.sidebar-item.active{background:linear-gradient(135deg,#eff6ff,#dbeafe);color:#1a56db;font-weight:600;box-shadow:inset 3px 0 0 #1a56db}

/* Compose panel — glass + refined shadow */
.compose-panel{box-shadow:0 1px 3px rgba(0,0,0,.06),0 16px 48px rgba(0,0,0,.14);border-radius:12px 12px 0 0;overflow:hidden}

/* Toast — glass + refined */
.toast{animation:slideUp .4s cubic-bezier(.16,1,.3,1),fadeOut .3s ease 3s forwards;box-shadow:0 1px 3px rgba(0,0,0,.06),0 8px 24px rgba(0,0,0,.12)}

/* Scrollbar (refined) */
.scrollbar-thin::-webkit-scrollbar{width:5px}
.scrollbar-thin::-webkit-scrollbar-track{background:transparent}
.scrollbar-thin::-webkit-scrollbar-thumb{background:#cbd5e1;border-radius:10px}
.scrollbar-thin::-webkit-scrollbar-thumb:hover{background:#94a3b8}

/* Attachment card */
.attachment-card{transition:all .2s ease}
.attachment-card:hover{transform:translateY(-1px);box-shadow:0 2px 8px rgba(0,0,0,.06)}

/* Modern input fields */
.input-modern{transition:all .2s ease;background:#f8fafc;border:1px solid #e2e8f0}
.input-modern:focus{background:#fff;border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59,130,246,.08)}

/* Compose header bar */
.compose-header{background:linear-gradient(135deg,#1e293b,#334155)}

/* Send button gradient */
.btn-send{background:linear-gradient(135deg,#2563eb,#1d4ed8);transition:all .2s ease;box-shadow:0 1px 2px rgba(0,0,0,.06),0 2px 8px rgba(37,99,235,.2)}
.btn-send:hover{background:linear-gradient(135deg,#1d4ed8,#1e40af);box-shadow:0 1px 2px rgba(0,0,0,.06),0 4px 16px rgba(37,99,235,.3);transform:translateY(-1px)}
.btn-send:active{transform:translateY(0);box-shadow:0 1px 2px rgba(0,0,0,.06)}

/* Compose button (sidebar) */
.btn-compose{background:#fff;border:1px solid #e2e8f0;transition:all .2s ease;box-shadow:0 1px 2px rgba(0,0,0,.03)}
.btn-compose:hover{box-shadow:0 1px 3px rgba(0,0,0,.06),0 8px 16px rgba(0,0,0,.05);transform:translateY(-1px)}
.btn-compose:active{transform:scale(.98)}

/* Avatar — refined */
.avatar-ring{box-shadow:0 0 0 2px #fff,0 0 0 3px rgba(0,0,0,.06)}

/* Login card */
.login-card{background:#fff;border:1px solid rgba(0,0,0,.06);box-shadow:0 1px 3px rgba(0,0,0,.03),0 16px 48px rgba(0,0,0,.06)}

/* Empty state */
.empty-state{animation:scaleIn .4s ease-out}

/* Skeleton loading */
.skeleton-line{height:.875rem;border-radius:4px;background:#e2e8f0;animation:skeleton 1.8s ease-in-out infinite}
.skeleton-avatar{width:2.25rem;height:2.25rem;border-radius:50%;background:#e2e8f0;animation:skeleton 1.8s ease-in-out infinite}

/* =========== RESPONSIVE =========== */
@media(min-width:640px){
  .sm\:inline{display:inline}.sm\:block{display:block}.sm\:hidden{display:none}.sm\:flex{display:flex}
  .sm\:px-6{padding-left:1.5rem;padding-right:1.5rem}.sm\:text-sm{font-size:.875rem}
}
@media(min-width:768px){
  .md\:flex{display:flex}.md\:hidden{display:none}.md\:flex-row{flex-direction:row}
  .md\:w-\[360px\]{width:360px}.md\:min-w-\[320px\]{min-width:320px}
}
@media(min-width:1024px){
  .lg\:flex{display:flex}.lg\:hidden{display:none}.lg\:relative{position:relative}
  .lg\:translate-x-0{transform:translateX(0)}.lg\:w-\[420px\]{width:420px}
  .lg\:min-w-\[360px\]{min-width:360px}.lg\:max-w-\[360px\]{max-width:360px}
  .lg\:grid-cols-3{grid-template-columns:repeat(3,1fr)}.lg\:col-span-2{grid-column:span 2}
}

/* =========== MISC =========== */
.overflow-ellipsis{text-overflow:ellipsis}
.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}
.gpu{transform:translateZ(0)}
@media print{.no-print{display:none!important}body{background:white!important}}
