/* Custom CSS for animations and effects */
:root {
    --color-black: #121212;
    --color-white: #FFFFFF;
    --color-copper: #B87333;
    --color-copper-dark: #8C5828;
    --color-light-gray: #f0f0f0;
    --color-medium-gray: #999999;
    --color-dark-gray: #333333;
    --color-copper-rgb: 184, 115, 51; /* Added for RGBA box shadow */
}

.hero-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
}

.hero-overlay {
    background: rgba(18, 18, 18, 0.7);
}

.animate-list li {
    opacity: 0;
    opacity: 0;
    transform: translateX(-30px); /* Start from left */
    transition: opacity 0.5s ease-out, transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94); /* Separate transitions */
}

.animate-list li.visible {
    opacity: 1;
    transform: translateX(0);
}

.service-card {
    transition: all 0.3s ease-out; /* Changed to ease-out for a smoother end to hover */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.service-card:hover {
    transform: translateY(-8px) scale(1.03); /* More lift and slight scale */
    box-shadow: 0 12px 20px rgba(0,0,0,0.12); /* Slightly more pronounced shadow */
}

.carousel {
    position: relative;
    overflow: hidden;
}

.carousel-inner {
    display: flex;
    transition: transform 0.5s ease;
}

.carousel-item {
    min-width: 100%;
}

.carousel-control {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(18, 18, 18, 0.5);
    color: white;
    border: none;
    padding: 10px;
    cursor: pointer;
    z-index: 10; /* This is lower than the modal's z-index */
}

.carousel-control.prev {
    left: 10px;
}

.carousel-control.next {
    right: 10px;
}

.fade-in {
    opacity: 0; /* Initial state: hidden */
}

.fade-in.is-visible {
    animation: sleekFadeIn 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards; /* Smoother easing */
}

@keyframes sleekFadeIn {
    from { opacity: 0; transform: translateY(30px); } /* More pronounced upward movement */
    to { opacity: 1; transform: translateY(0); }
}

/* Enhanced Button Hover */
.btn-hover-enhanced {
    transition: all 0.2s ease-out;
    will-change: transform; /* Hint to browser for smoother animation */
}

.btn-hover-enhanced:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 4px 8px rgba(var(--color-copper-rgb), 0.3);
}


/* Gradient text */
.gradient-text {
    background: linear-gradient(90deg, var(--color-copper), var(--color-copper-dark));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Pulse animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Floating animation */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

/* Custom shape styles removed */

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--color-light-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--color-medium-gray);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-copper);
}

/* Background colors */
.bg-copper {
    background-color: var(--color-copper);
}

.bg-copper-dark {
    background-color: var(--color-copper-dark);
}

.bg-light-gray {
    background-color: var(--color-light-gray);
}

.text-copper {
    color: var(--color-copper);
}

.text-copper-dark {
    color: var(--color-copper-dark);
}

.border-copper {
    border-color: var(--color-copper);
}

/* Hero divider line */
.hero-divider {
    width: 200px;
    height: 2px;
    background-color: white;
    margin: 20px auto;
}
/* Fullscreen Modal Styles */
#fullscreen-modal {
    /* Tailwind classes handle most of this (fixed, inset-0, bg-black, bg-opacity-80, flex, items-center, justify-center, z-[100], hidden, p-4) */
}

#modal-content-wrapper {
    /* Tailwind classes: relative bg-black max-w-full max-h-full overflow-auto rounded-lg */
    /* position: relative and z-index:1 removed as we rely on parent modal's high z-index */
}

#modal-content-wrapper img,
#modal-content-wrapper video {
    max-width: 90vw; /* Max width relative to viewport width */
    max-height: 85vh; /* Max height relative to viewport height */
    display: block;
    margin: auto; /* Center the content */
    object-fit: contain; /* Ensure the whole image/video is visible */
    transition: transform 0.2s ease-out; /* For zoom */
}

/* Ensure video controls are visible on dark background if default is not good */
#modal-content-wrapper video::-webkit-media-controls-panel {
    background-color: rgba(0, 0, 0, 0.7);
}

#modal-close-btn {
    /* Tailwind classes: absolute top-4 right-4 text-white text-3xl font-bold hover:text-gray-300 z-[101] */
    line-height: 1; /* Ensure consistent positioning of '×' */
    padding: 0.5rem 1rem;
}

/* Zoom controls have been removed from HTML and JS, so these CSS shells are no longer needed. */
/* #modal-zoom-controls { ... } */
/* #modal-zoom-controls button { ... } */

/* Hide carousel controls when modal is open */
body.modal-is-open .carousel .carousel-control {
    display: none !important; /* Use !important to ensure override if necessary */
}

/* Ensure back-to-top icon is white */
#back-to-top i.fas.fa-arrow-up {
    color: white !important;
}

/* Styles for rendered Markdown content in markdown_viewer.html */
#markdown-content {
  background-color: var(--color-white);
  border: 1px solid #e5e7eb; /* Tailwind gray-200 */
  border-radius: 4px;
  padding: 2rem;
  margin-top: 0;
  font-family: 'Georgia', 'Times New Roman', Times, serif; /* Base font for article */
  font-size: 1.1rem; /* Base font size */
}

#markdown-content h1,
#markdown-content h2,
#markdown-content h3,
#markdown-content h4,
#markdown-content h5,
#markdown-content h6 {
  color: var(--color-black);
  /* Assuming Tailwind's font-sans is suitable for headings, so no explicit font-family override here */
  /* font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; */ /* Example if needed */
  margin-bottom: 1em; /* Updated bottom margin */
}

#markdown-content h1 {
  font-size: 2.5rem; /* Updated */
  border-bottom: 1px solid var(--color-copper);
  padding-bottom: 0.3em;
  margin-top: 1.5em; /* Adjusted from 1em, more top space for main heading */
}

#markdown-content h2 {
  font-size: 2rem; /* Updated */
  border-bottom: 1px solid var(--color-copper);
  padding-bottom: 0.3em;
  margin-top: 1.5em; /* Adjusted from 1.2em */
}

#markdown-content h3 {
  font-size: 1.75rem; /* Updated */
  margin-top: 1.5em; /* Adjusted from 1em */
}

#markdown-content h4 {
  font-size: 1.5rem; /* New */
  margin-top: 1.5em;
  color: var(--color-dark-gray); /* Slightly less prominent than h1-h3 */
}

#markdown-content h5 {
  font-size: 1.25rem; /* New, was h3 before */
  margin-top: 1.5em;
  color: var(--color-dark-gray);
}

#markdown-content h6 {
  font-size: 1.1rem; /* New */
  margin-top: 1.5em;
  color: var(--color-medium-gray);
}

#markdown-content p {
  color: var(--color-dark-gray);
  line-height: 1.8; /* Updated */
  margin-bottom: 1.25em; /* Updated */
  text-align: justify; /* Added */
}

#markdown-content a {
  color: var(--color-copper);
  text-decoration: none;
  font-weight: 500;
}

#markdown-content a:hover {
  text-decoration: underline;
  color: var(--color-copper-dark);
}

#markdown-content ul,
#markdown-content ol {
  padding-left: 1.5em;
  margin-bottom: 1.25em; /* Match paragraph bottom margin */
  color: var(--color-dark-gray);
}

#markdown-content li {
  margin-bottom: 0.75em; /* Updated */
  line-height: 1.8; /* Added for consistency */
}

/* Prism.js will handle most pre/code block styling. These are overrides/complements. */
#markdown-content pre {
  border: 1px solid #555; /* Example: if okaidia theme doesn't have a border or you want different */
  padding: 1em; /* Keep this, Prism themes might not set it consistently */
  border-radius: 0.375rem; /* Tailwind 'rounded-md', keep for consistency */
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace; /* Ensure monospace */
  font-size: 1rem; /* Control base size for code blocks */
  overflow-x: auto; /* Essential for long lines */
  /* Prism themes (e.g., okaidia) add their own background and text colors */
  /* Remove: background-color, color (Prism handles) */
}

/* Styles for INLINE code - keep these distinct from code blocks */
#markdown-content code:not(pre code) { /* Target only inline code */
  background-color: rgba(var(--color-copper-rgb), 0.08); /* Slightly more subtle */
  color: var(--color-copper-dark);
  padding: 0.2em 0.4em;
  border-radius: 0.25rem;
  font-size: 0.9em; /* Relative to surrounding text */
  font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
}

/* Styles for code INSIDE pre - let Prism theme mostly handle this. */
#markdown-content pre code {
  font-family: inherit; /* Inherit monospace from pre */
  font-size: inherit; /* Inherit font size from pre */
  background: none; /* Override any inline styles if necessary */
  padding: 0; /* Usually no padding needed here */
  color: inherit; /* Let Prism theme dictate text color */
  border: none; /* Ensure no borders from inline code styles */
}

#markdown-content blockquote {
  border-left: 4px solid var(--color-copper);
  padding: 1em 1.5em; /* Added vertical padding */
  color: var(--color-medium-gray);
  background-color: var(--color-light-gray);
  margin-left: 0;
  margin-bottom: 1.5em;
  font-style: italic; /* Often good for blockquotes */
}

/* Refined Table Styles for #markdown-content */
#markdown-content table {
    width: 100%;
    border-collapse: separate; /* Changed from collapse for better spacing control with border-spacing */
    border-spacing: 0; /* Control spacing manually */
    margin-bottom: 2em; /* Increased bottom margin */
    font-size: 1rem; /* Base font size for tables, adjust as needed */
    border: 1px solid #dee2e6; /* Outer border for the table - Tailwind gray-300 */
    border-radius: 0.375rem; /* Tailwind 'rounded-md' for the table itself */
    overflow: hidden; /* Ensures border-radius clips th/td backgrounds */
}

#markdown-content th,
#markdown-content td {
    border-bottom: 1px solid #dee2e6; /* Bottom border for rows */
    padding: 1em 1.25em; /* Increased padding */
    text-align: left;
    vertical-align: top; /* Align content to the top of the cell */
    border-left: none; /* Remove from individual cells */
    border-right: none; /* Remove from individual cells */
}

#markdown-content th {
    background-color: #f8f9fa; /* Lighter header background - Tailwind gray-100 */
    font-weight: 600; /* Tailwind 'font-semibold' */
    color: #212529; /* Darker text for header - Tailwind gray-900 */
    border-top: none; /* Remove top border for headers if table has its own */
    border-bottom-width: 2px; /* Thicker bottom border for header cells */
    border-bottom-color: #ced4da; /* Tailwind gray-400 */
}

#markdown-content tr:last-child td {
    border-bottom: none; /* No bottom border for the last row's cells */
}

#markdown-content tbody tr:nth-child(odd) td {
    background-color: rgba(0,0,0,0.025); /* Subtle alternating row color for light mode */
}

#markdown-content tbody tr:hover td {
    background-color: rgba(var(--color-copper-rgb), 0.1); /* Hover effect using copper */
}

#markdown-content table caption {
    caption-side: bottom;
    padding: 0.75em;
    font-size: 0.9em;
    color: #6c757d; /* Tailwind gray-600 */
    text-align: center;
}

/* Style for the copy code button */
.copy-code-button {
    background-color: var(--color-copper);
    color: var(--color-white);
    border: none;
    padding: 0.3em 0.6em;
    font-size: 0.8em;
    border-radius: 0.25rem; /* Tailwind 'rounded-sm' */
    cursor: pointer;
    opacity: 0.7; /* Slightly transparent until hover */
    transition: opacity 0.2s ease-in-out, background-color 0.2s ease-in-out;
}

#markdown-content pre:hover .copy-code-button {
    opacity: 1; /* Fully opaque on hover of the pre block */
}

.copy-code-button:hover {
    background-color: var(--color-copper-dark);
}

.copy-code-button:active {
    transform: translateY(1px);
}

/* Styling for Mermaid diagram containers */
.mermaid-diagram-container {
    margin-bottom: 1.5em; /* Space below diagrams */
    padding: 1em;
    border: 1px solid var(--color-light-gray, #e5e7eb); /* Use theme variable or fallback */
    border-radius: 0.375rem; /* Tailwind 'rounded-md' */
    background-color: var(--color-white, #fff); /* Ensure background for diagrams */
    display: flex; /* For centering if needed */
    justify-content: center; /* Center diagram if it's smaller than container */
}

.mermaid-diagram-container svg {
    max-width: 100%; /* Ensure responsiveness */
    height: auto; /* Maintain aspect ratio */
}

.mermaid-error {
    color: red;
    font-weight: bold;
}