/* Base styles */
html {
    height: 100%;
    overflow: hidden; /* Apply this to html to prevent body scrollbars when modals are open or content is fixed height */
}

body {
    font-family: 'Inter', sans-serif;
    display: flex;
    flex-direction: column;
    height: 100vh; /* Use viewport height */
    max-height: 100vh; /* Ensure it doesn't exceed viewport */
    overflow: hidden; /* Prevent body scroll, individual sections will scroll */
    margin: 0;
    background-color: #f3f4f6; /* Tailwind gray-100 */
    color: #1f2937; /* Tailwind gray-800, for default text */
}

/* Custom Scrollbar for elements with .custom-scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.custom-scrollbar::-webkit-scrollbar-track {
    background: #f1f5f9; /* Tailwind slate-100 */
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #94a3b8; /* Tailwind slate-400 */
    border-radius: 10px;
}
.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #64748b; /* Tailwind slate-500 */
}
.custom-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #f1f5f9;
}

/* Modal related styles - global classes for backdrop and panel transitions */
.modal-backdrop {
    transition: opacity 0.3s ease-in-out;
}

.modal-panel {
    transition: all 0.3s ease-in-out; /* For transform and opacity */
}

/* Prevent interaction on main content when modal is open */
/* This might need to be applied to a specific container if body scroll is still an issue */
body.modal-open > #app-container { /* Target direct child to avoid over-blurring if modals are inside app-container */
    filter: blur(4px);
    pointer-events: none;
}
/* If #app-container is the main wrapper and modals are outside, this is fine.
   If modals are *inside* #app-container, this would blur the modal too.
   Assuming modals are direct children of body or a dedicated modal root. */

/* Consistent input styling (example, can be extended) */
.styled-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem; /* Tailwind rounded-md */
    border: 1px solid #d1d5db; /* Tailwind gray-300 */
    background-color: #fff; /* White */
    transition: all 0.15s ease-in-out;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); /* Tailwind shadow-sm */
}
.styled-input:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    border-color: #174734; /* Custom green */
    box-shadow: 0 0 0 3px rgba(23, 71, 52, 0.3); /* Focus ring, adjust color and opacity */
}

/* General button styling - can be specialized with Tailwind or more classes */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem; /* py-2 px-4 */
    font-weight: 500; /* font-medium */
    border-radius: 0.375rem; /* rounded-md */
    border: 1px solid transparent;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    cursor: pointer;
    font-size: 0.875rem; /* text-sm */
}

.button-primary {
    background-color: #174734; /* Custom green */
    color: white;
    border-color: #174734;
}
.button-primary:hover {
    background-color: #113527; /* Darker custom green */
}

.button-secondary {
    background-color: #e5e7eb; /* gray-200 */
    color: #1f2937; /* gray-800 */
    border-color: #d1d5db; /* gray-300 */
}
.button-secondary:hover {
    background-color: #d1d5db; /* gray-300 */
}

/* Styling for tables to ensure consistency if not fully handled by Tailwind on each page */
.table-container {
    overflow-x: auto;
    border: 1px solid #e5e7eb; /* Tailwind gray-200 */
    border-radius: 0.5rem; /* Tailwind rounded-lg */
}

.table {
    min-width: 100%;
    divide-y divide-gray-200; /* For Tailwind, if table elements are styled with it */
}

.table thead th {
    background-color: #f9fafb; /* Tailwind gray-50 */
    padding: 0.75rem 1.5rem; /* px-6 py-3 */
    text-align: left;
    font-size: 0.75rem; /* text-xs */
    font-weight: 500; /* font-medium */
    color: #6b7280; /* Tailwind gray-500 */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody td {
    padding: 1rem 1.5rem; /* px-6 py-4 for more spacing, adjust as needed */
    font-size: 0.875rem; /* text-sm */
    white-space: nowrap; /* Default, can be overridden by specific table needs */
}

.table tbody tr:nth-child(even) {
    /* background-color: #f9fafb; */ /* Optional striping, if not using Tailwind's divide-y */
}

.table tbody tr:hover {
    background-color: #f3f4f6; /* Tailwind gray-100, for hover effect */
    transition: background-color 0.15s ease-in-out;
}

/* Toast Notification Base - positioning and initial state */
.toast-notification {
    position: fixed;
    top: 1.25rem; /* top-5 */
    right: 1.25rem; /* right-5 */
    padding: 0.75rem 1rem; /* py-3 px-4 */
    border-radius: 0.5rem; /* rounded-lg */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06); /* shadow-md */
    transition: transform 0.3s ease-in-out, opacity 0.3s ease-in-out;
    transform: translateX(150%); /* Start off-screen */
    opacity: 0;
    z-index: 100; /* Ensure it's above most content */
    font-size: 0.875rem; /* text-sm */
}

.toast-notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* Specific toast types */
.toast-success {
    background-color: #10b981; /* Tailwind green-500 */
    color: white;
}
.toast-error {
    background-color: #ef4444; /* Tailwind red-500 */
    color: white;
}
.toast-info {
    background-color: #3b82f6; /* Tailwind blue-500 */
    color: white;
}

/* Loading spinner - a simple one */
.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border-left-color: #174734; /* Theme color */
    animation: spin 1s ease infinite;
    margin: 20px auto; /* For centering if used alone */
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Helper class for screen reader only content */
.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;
}
#app-container.modal-open {
    filter: blur(4px);
    pointer-events: none;
}
/* Highlight for generated code (from dependencies.html) */
pre code.language-json { /* Assuming Prism.js or similar might be used for syntax highlighting */
    border-radius: 0.5rem; /* rounded-lg */
    display: block;
    padding: 1rem;
    background-color: #f3f4f6; /* gray-100 for the code block itself */
    color: #1f2937; /* gray-800 for text */
    overflow-x: auto; /* Scroll if code is too wide */
}
/* Add a general style for any textareas used for code display if not using <pre><code> */
textarea.code-display {
    font-family: monospace;
    font-size: 0.875rem;
    line-height: 1.25rem;
    border: 1px solid #d1d5db; /* gray-300 */
    border-radius: 0.375rem; /* rounded-md */
    padding: 0.5rem 0.75rem;
    width: 100%;
    box-sizing: border-box;
    resize: vertical; /* Allow vertical resize, or none if fixed */
}

/* Ensure that the main app container and content areas behave as expected within the flex body */
/* The template uses #app-container > div (for the white box) > header, nav, main */
/* This ensures the main content area within the white box can scroll if its content overflows */
#app-content { /* This ID is used in the template for the main scrollable area */
    overflow-y: auto; /* Allow vertical scrolling */
    flex-grow: 1; /* Allow it to take available space */
    /* padding is already set in the template, but confirm it's suitable or adjust here */
}
/* Make sure the overall app container does not introduce extra scrollbars if html/body are overflow:hidden */
#app-container {
    display: flex; /* Already in template, ensure it works with body flex */
    flex-direction: column;
    align-items: center; /* Centers the max-w-4xl box */
    width: 100%;
    height: 100%; /* Take full height of body */
    /* py-4 is in template, ensure it doesn't cause overflow with 100vh body */
}

/* Adjust body if py-4 on app-container is causing overflow with 100vh */
/* This is tricky; it might be better to ensure app-container uses box-sizing: border-box
   and its children sum up to 100% of its height, rather than body itself.
   For now, assuming Tailwind's default box-sizing and the flex setup manage this.
*/

/* Responsive table text wrapping */
.table-wrap-text td, .table-wrap-text th {
    white-space: normal; /* Allow text to wrap */
    word-break: break-word; /* Break words if they are too long */
}

/* Fixed width table for the dashboard, no horizontal scroll */
.table-fixed-layout {
    table-layout: fixed;
    width: 100%;
}
