@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

body {
  /* Background + text color are theme-aware via Tailwind body classes
     (bg-slate-50 dark:bg-dark-900 / text-slate-600 dark:text-slate-200).
     Hardcoding dark values here broke light mode (white text on light bg),
     especially for inherited rich-text content. */
  overflow-x: hidden;
}

/* Page Transitions */
.page-transition {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease-out, transform 0.4s ease-out;
}

.page-transition-leave {
    opacity: 0;
    transform: translateY(-15px);
}

.page-transition-enter {
    opacity: 0;
    transform: translateY(15px);
}

/* RTL Helpers */
[dir="rtl"] .rtl-flip {
    transform: scaleX(-1);
}

/* Abstract placeholders */
.placeholder-box {
  background: linear-gradient(135deg, #151C2C 0%, #0B0F19 100%);
  border: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
  overflow: hidden;
}

.placeholder-box::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(to right, transparent, rgba(255, 255, 255, 0.03), transparent);
  transform: skewX(-20deg);
  animation: shimmer 3s infinite;
}

@keyframes shimmer {
  100% { left: 200%; }
}

/* Animations for JS IntersectionObserver */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Portfolio Filtering Animation */
.portfolio-item {
    transition: opacity 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

/* Custom Gradients and Glows */
/* Solid brand blue for emphasis words (was a blue→purple gradient) */
.text-gradient {
  color: #0072ff;
}

/* Tasteful blue shadow on primary buttons (was a purple neon glow) */
.btn-glow {
  box-shadow: 0 4px 14px rgba(0, 114, 255, 0.25);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.btn-glow:hover {
  box-shadow: 0 6px 18px rgba(0, 114, 255, 0.35);
  transform: translateY(-2px);
}

/* Enhanced Modal Layouts */
.modal-container {
    display: flex;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    overflow: hidden;
}

/* Portrait: Split Layout (Side-by-Side) */
.modal-portrait {
    flex-direction: row;
}
.modal-portrait .modal-media {
    width: 60%;
    height: 100%;
    border-inline-end: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-portrait .modal-info {
    width: 40%;
    padding: 2.5rem;
    overflow-y: auto;
}

/* Landscape: Stacked Layout (Top/Bottom) */
.modal-landscape {
    flex-direction: column;
}
.modal-landscape .modal-media {
    width: 100%;
    height: 65%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.modal-landscape .modal-info {
    width: 100%;
    height: 35%;
    padding: 2rem 2.5rem;
    overflow-y: auto;
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
    .modal-portrait {
        flex-direction: column;
    }
    .modal-portrait .modal-media, .modal-portrait .modal-info {
        width: 100%;
    }
    .modal-portrait .modal-media {
        height: 50%;
    }
    .modal-portrait .modal-info {
        height: 50%;
    }
}

/* Rich Text Styling */
.content-block-text p { margin-bottom: 1.5rem; }
.content-block-text p:last-child { margin-bottom: 0; }
.content-block-text strong { font-weight: 700; color: inherit; }
.content-block-text em { font-style: italic; }

/* Rich Text Styling Overrides */
.rich-text-content ul {
  list-style-type: disc !important;
  padding-left: 1.5rem !important;
  margin-bottom: 1rem !important;
}
.rich-text-content ol {
  list-style-type: decimal !important;
  padding-left: 1.5rem !important;
  margin-bottom: 1rem !important;
}
.rich-text-content li {
  display: list-item !important;
}

/* Ensure Quill editor content takes our theme colors */
.ql-editor {
    color: inherit !important;
    font-family: inherit !important;
    font-size: inherit !important;
    line-height: inherit !important;
}

.ql-editor .ql-ui {
    display: none !important;
}

/* Software Stack Header Styles */
.software-stack-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.software-item {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    width: 32px;
    height: 32px;
    border-radius: 0.6rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}
.software-item:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px) scale(1.05);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.software-item img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    transition: transform 0.3s ease;
}
.software-item:hover img {
    transform: scale(1.1);
}

/* Pinterest-style Masonry Gallery */
.masonry-gallery {
  column-count: 1;
  column-gap: 1.5rem;
  margin-top: 2rem;
  padding-bottom: 2rem;
}

@media (min-width: 768px) {
  .masonry-gallery {
    column-count: 2;
  }
}

.masonry-gallery img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 1.5rem;
  border-radius: 0.75rem;
  break-inside: avoid;
  page-break-inside: avoid;
  box-shadow: 0 4px 20px rgba(11, 135, 147, 0.15);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: zoom-in;
}

.masonry-gallery img:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 30px rgba(11, 135, 147, 0.35);
}

/* Specific Grid for Galleries (Compatibility) */
.project-image-grid {
    column-count: 1;
    column-gap: 1.5rem;
    margin: 2rem 0;
}

@media (min-width: 768px) {
    .project-image-grid {
        column-count: 2;
    }
}

.project-image-grid figure {
    margin: 0 0 1.5rem 0 !important;
    display: block;
    break-inside: avoid;
}


/* Premium Section Image Glow */
.section-image-glow {
    box-shadow: 0 20px 50px -10px rgba(59, 130, 246, 0.4);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    position: relative;
}
.section-image-glow img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.section-image-glow:hover {
    box-shadow: 0 30px 60px -12px rgba(0, 114, 255, 0.5);
    transform: translateY(-8px);
    border-color: rgba(0, 114, 255, 0.3);
}
.section-image-glow:hover img {
    transform: scale(1.05);
}

/* =====================================================================
   Public-UX polish: accessibility, scroll affordances, reveal-on-scroll
   ===================================================================== */

/* Keyboard focus ring (only shows for keyboard users, not mouse clicks) */
:focus-visible {
    outline: 2px solid #0072ff;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Never allow horizontal scroll/zoom-out on mobile — the page must fit the
   viewport width exactly (no element may push the layout wider than 100vw). */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Hide scrollbars on horizontal scroll strips (filters, sliders) */
.no-scrollbar { scrollbar-width: none; -ms-overflow-style: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }

/* Portfolio category filters: always a single row that scrolls sideways
   on small screens rather than wrapping into several tall rows. */
#category-filters .filter-btn { flex: 0 0 auto; white-space: nowrap; }

/* Scroll-to-top button (injected by nav.js) */
.to-top {
    position: fixed;
    bottom: 1.5rem;
    inset-inline-end: 1.5rem;
    z-index: 90;
    width: 2.85rem;
    height: 2.85rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0072ff;
    color: #fff;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s, background 0.2s ease;
}
.to-top.show { opacity: 1; visibility: visible; transform: translateY(0); }
.to-top:hover { background: #005fd6; }

/* Reading-progress bar (present on project pages) */
.read-progress {
    position: fixed;
    top: 0;
    inset-inline-start: 0;
    height: 3px;
    width: 0;
    background: #0072ff;
    z-index: 95;
    transition: width 0.1s linear;
}

/* Generic reveal-on-scroll (used by portfolio cards + project blocks) */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s ease, transform 0.7s ease;
    will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: none; }

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1 !important; transform: none !important; }
}


