/* Custom styles for Odysi application */

/* Font Display Optimization - Force all web fonts to swap */
/* Note: font-display must be set within each specific @font-face declaration */

/* Font Awesome specific font-display fix */
/* Note: font-display is a descriptor for @font-face, not a CSS property */
/* This rule has been removed as it's invalid - Font Awesome fonts need
   to have font-display: swap set in their @font-face declarations */

/* Modal Backdrop with Blur Effect */
.modal-backdrop-blur {
  /* Fallback background color for browsers that don't support backdrop-filter */
  background-color: rgba(75, 85, 99, 0.75);
  /* Modern browsers will use backdrop-filter for blur effect */
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* Odysi Color Variables */
:root {
  --color-primary: #264653;
  --color-primary-50: #f0f7f4;
  --color-primary-100: #d1e7dd;
  --color-primary-200: #a3cfbb;
  --color-primary-300: #84a98c;
  --color-primary-400: #52796f;
  --color-primary-500: #264653;
  --color-primary-600: #1e3a44;
  --color-primary-700: #162d35;
  --color-primary-800: #0e2025;
  --color-primary-900: #071316;
}

/* HTMX indicators and transitions */
.htmx-indicator {
    opacity: 0;
    transition: opacity 500ms ease-in;
}
.htmx-request .htmx-indicator {
    opacity: 1;
}
.htmx-request.htmx-indicator {
    opacity: 1;
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--color-primary);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    display: inline-block;
}

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

/* Text truncation utilities */
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Custom form styles */
.form-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(38, 70, 83, 0.2);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

/* Button styles */
.btn-primary {
    background-color: var(--color-primary);
    color: white;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--color-primary-600);
}

.btn-secondary {
    background-color: #e5e7eb;
    color: #1f2937;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: background-color 0.2s;
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

/* Card styles */
.card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    padding: 1rem;
}

/* Kanban board specific styles */
.kanban-column {
    background-color: #f3f4f6;
    border-radius: 0.5rem;
    padding: 1rem;
    min-height: 100vh;
}

.kanban-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    cursor: move;
    transition: box-shadow 0.2s;
}

.kanban-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Smooth transitions for HTMX swaps */
.htmx-swapping {
    opacity: 0;
    transition: opacity 300ms ease-out;
}

/* Modal fixes for proper display */
#modal-container {
    position: relative;
}

/* Ensure modals are properly positioned */
#modal-container .fixed {
    position: fixed !important;
}

/* Fix for modal background overlay - lower z-index */
#modal-container > div > div > .bg-gray-500.bg-opacity-75 {
    z-index: 40 !important;
}

/* Ensure modal panel appears above overlay - higher z-index */
#modal-container > div > div > .inline-block {
    position: relative;
    z-index: 50 !important;
}

/* Ensure modal content is visible */
#modal-container .bg-white {
    background-color: white !important;
}

/* Fix modal centering on smaller screens */
@media (max-width: 640px) {
    #modal-container .sm\:align-middle {
        vertical-align: middle !important;
    }
}

/* Button sizing utilities */
.btn-danger-zone {
    min-width: 200px;
    height: 40px;
    padding: 8px 16px;
}

/* Deployment info footer */
.deployment-info {
    position: fixed;
    bottom: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px;
    font-size: 11px;
    border-radius: 4px 0 0 0;
    font-family: monospace;
    z-index: 9999;
}

/* Company/application links */
.company-application-link {
    color: #264653;
}

.company-application-link:hover {
    color: #1e3a44;
}

/* Status badges with dynamic colors - use inline styles for dynamic colors */

/* Modal width utilities */
.modal-wide {
    width: 1000px;
    max-width: 90vw;
}

/* Card utilities */
.card-min-width {
    min-width: 0;
}

/* Dashboard links */
.dashboard-link {
    color: #264653;
}

.dashboard-link:hover {
    color: #0e2025;
}

/* Debug info section */
.debug-info {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 14px;
}

/* Landing page sections */
.hero-section {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: 6rem 0 8rem 0;
    margin-top: -1px;
}

.cta-section {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding: 6rem 0 8rem 0;
    margin-bottom: -2rem;
}

/* Primary color utilities */
.text-primary {
    color: #264653;
}

.bg-primary {
    background-color: #264653;
}

/* Special note badge */
.note-badge-special {
    background-color: #d1e7dd;
    color: #264653;
    border: 1px solid #b3d7c1;
}

/* Primary outline button */
.btn-primary-outline {
    color: #264653;
    border-color: #264653;
}

/* Kanban scroll container */
.kanban-scroll-container {
    scroll-behavior: smooth;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Time display utilities */
.time-display {
    font-size: 10px;
    color: #9ca3af;
    margin-top: 2px;
}

/* Positioning utilities */
.position-relative {
    position: relative;
}

.position-absolute {
    position: absolute;
}

.top-2 {
    top: 0.5rem;
}

.right-2 {
    right: 0.5rem;
}

/* Small margin utilities */
.mt-1 {
    margin-top: 0.25rem;
}

/* Text size utilities */
.text-xs {
    font-size: 0.75rem;
}

/* Color utilities */
.text-gray-400 {
    color: #9ca3af;
}

.text-gray-500 {
    color: #6b7280;
}

/* Border utilities */
.border-r {
    border-right: 1px solid #e5e7eb;
}

/* Padding utilities */
.px-6 {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.py-4 {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

/* Width utilities */
.w-full-important {
    width: 100% !important;
}

/* Z-index utilities */
.z-10 {
    z-index: 10;
}

/* Background utilities */
.bg-white-75 {
    background-color: rgba(255, 255, 255, 0.75);
}

/* Flex utilities */
.flex-shrink-0 {
    flex-shrink: 0;
}

/* Height utilities */
.h-64 {
    height: 16rem;
}

/* Overflow utilities */
.overflow-y-auto {
    overflow-y: auto;
}

/* Max width utilities */
.max-w-md {
    max-width: 28rem;
}

/* Transform utilities */
.transform {
    transform: translateX(var(--tw-translate-x)) translateY(var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
}

.translate-x-full {
    --tw-translate-x: 100%;
}

.translate-x-0 {
    --tw-translate-x: 0px;
}

/* Transition utilities */
.transition-transform {
    transition: transform 0.15s ease-in-out;
}

.ease-in-out {
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.duration-300 {
    transition-duration: 300ms;
}

#waitlist-modal[open] {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Error notification styles */
.error-notification {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* HTMX loading states for buttons */
.htmx-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.htmx-loading::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 0.8s linear infinite;
}

/* For secondary buttons */
.btn-secondary.htmx-loading::after {
    border-color: #374151;
    border-top-color: transparent;
}

/* Form error states */
.form-input.error {
    border-color: #ef4444;
}

.form-input.error:focus {
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.error-message {
    color: #dc2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Success notification styles */
.success-notification {
    animation: slideIn 0.3s ease-out;
}

/* Loading notification styles */
.loading-notification {
    animation: slideIn 0.3s ease-out;
}

/* Retry button hover states */
.error-notification button:hover {
    text-decoration: underline;
}

/* Error page styles */
.error-page-container {
    min-height: calc(100vh - 200px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Cursor pointer for interactive elements */
.cursor-pointer,
button:not(:disabled),
a[href],
[role="button"],
[onclick],
/* Only apply cursor pointer to HTMX elements that are actually interactive */
[hx-get][role="button"],
[hx-post][role="button"],
[hx-put][role="button"],
[hx-delete][role="button"],
[hx-patch][role="button"],
[hx-get].cursor-pointer,
[hx-post].cursor-pointer,
[hx-put].cursor-pointer,
[hx-delete].cursor-pointer,
[hx-patch].cursor-pointer,
[data-bs-toggle],
.clickable,
.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
input[type="submit"],
input[type="button"],
input[type="checkbox"],
input[type="radio"],
label[for],
select,
.kanban-card,
.nav-link,
.dropdown-toggle,
.dropdown-item,
.tab-button,
.modal-close,
.pagination a,
.badge.clickable,
.list-group-item-action {
    cursor: pointer !important;
}

/* Disabled state cursor */
button:disabled,
input:disabled,
select:disabled,
.disabled,
[aria-disabled="true"] {
    cursor: not-allowed !important;
    opacity: 0.6;
}

/* Loading state cursor */
.htmx-request,
.loading,
.htmx-loading {
    cursor: wait !important;
}

/* Text selection cursor */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
textarea,
[contenteditable="true"] {
    cursor: text !important;
}

/* Move cursor for draggable items */
.draggable,
[draggable="true"] {
    cursor: move !important;
}

/* Tooltip styles */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #374151;
    color: white;
    text-align: center;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 0.25rem;
    transition: opacity 0.2s ease-in-out, visibility 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Show tooltip on hover */
.tooltip:hover .tooltip-content {
    visibility: visible;
    opacity: 1;
}

/* Tooltip arrow */
.tooltip .tooltip-content::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 4px;
    border-style: solid;
    border-color: #374151 transparent transparent transparent;
}

/* Help cursor for tooltips - only for specific help elements */
.tooltip,
.help-icon,
abbr[title] {
    cursor: help !important;
}

/* Custom tooltip styles for dashboard icons */
.group {
    position: relative;
}

/* Dashboard tooltips - using specific class for maintainability */
.dashboard-tooltip {
    /* Base styles applied via Tailwind classes in HTML */
}

/* Utility class for right-edge tooltips */
.tooltip-right-edge .dashboard-tooltip,
.tooltip-right-edge > .group-hover\:visible {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.tooltip-right-edge .dashboard-tooltip > div,
.tooltip-right-edge > .group-hover\:visible > div {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* Tooltip responsive adjustments */
/* Ensure tooltips stay within viewport bounds */
.group:hover .group-hover\:visible {
    z-index: 50;
}

/* Mobile specific tooltip adjustments */
@media (max-width: 640px) {
    /* Target dashboard tooltips specifically */
    .group:hover .dashboard-tooltip,
    .group:hover > .group-hover\:visible {
        left: auto !important;
        right: -0.5rem;
        transform: translateX(0) !important;
        max-width: 200px;
        white-space: normal;
    }
    
    /* Target tooltip arrow */
    .group:hover .dashboard-tooltip > div,
    .group:hover > .group-hover\:visible > div {
        left: auto !important;
        right: 1rem;
        transform: translateX(0) !important;
    }
}

/* Legacy: Adjust tooltip position for elements near right edge - kept for backward compatibility */
.card-header .group:last-child .dashboard-tooltip,
.card-header .group:last-child > .group-hover\:visible,
.card-header .group:last-child .group-hover\:visible,
.card-header > div:last-child .group-hover\:visible {
    left: auto;
    right: 0;
    transform: translateX(0);
}

.card-header .group:last-child .dashboard-tooltip > div,
.card-header .group:last-child > .group-hover\:visible > div {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* Ensure interactive elements with titles use pointer cursor
   This comprehensive list matches the interactive elements defined in main.css
   to ensure consistent cursor behavior across the entire application.
   
   Note: This rule is intentionally broad to fix a specific issue where elements
   with title attributes were showing help cursors instead of pointer cursors.
   The !important is necessary to override third-party library styles (e.g., FullCalendar)
   and any conflicting rules. The specificity ensures only interactive elements
   are affected, not static elements with titles. */
[title]:not([title=""]):is(
    a:not([disabled]),
    button:not([disabled]),
    [role="button"]:not([disabled]),
    [onclick]:not([disabled]),
    [hx-get]:not([disabled]),
    [hx-post]:not([disabled]),
    [hx-put]:not([disabled]),
    [hx-patch]:not([disabled]),
    [hx-delete]:not([disabled]),
    [hx-target]:not([disabled]),
    input[type="submit"]:not([disabled]),
    input[type="button"]:not([disabled]),
    input[type="reset"]:not([disabled]),
    select:not([disabled]),
    .btn:not([disabled]),
    .btn-primary:not([disabled]),
    .btn-secondary:not([disabled]),
    .btn-success:not([disabled]),
    .btn-danger:not([disabled]),
    .btn-outline-secondary:not([disabled]),
    .btn-cta:not([disabled]),
    .nav-item:not([disabled]),
    .application-card-link:not([disabled]),
    .kanban-card-link:not([disabled]),
    .accordion-header:not([disabled]),
    .tab-button:not([disabled]),
    .view-toggle:not([disabled]),
    .toast-close:not([disabled]),
    .modal-close:not([disabled]),
    .dropdown-toggle:not([disabled]),
    .company-card:not([disabled]),
    .load-more-btn:not([disabled]),
    .clickable,
    .cursor-pointer
) {
    cursor: pointer !important;
}

/* Navigation Icon Alignment Fix */
/* Ensure SVG icons in navigation are properly centered */
.nav-item svg {
    flex-shrink: 0;
    vertical-align: middle;
}

/* Additional vertical centering for inline-flex items */
.nav-item.inline-flex {
    align-items: center;
}

/* Ensure consistent icon sizing and spacing */
.nav-item svg.w-4.h-4 {
    width: 1rem;
    height: 1rem;
}

/* Responsive Navigation Styles */
/* Let Tailwind handle the responsive behavior with its utility classes */
/* Additional styling for mobile navigation items */
.mobile-nav .nav-item {
    font-size: 0.75rem; /* 12px */
    padding: 0.25rem 0.5rem; /* 4px 8px */
    margin-right: 0.5rem; /* 8px */
    white-space: nowrap;
}


/* Calendar-specific cursor overrides
 * The calendar grid itself is not clickable even though it has hx-get
 * Individual calendar events within cells are clickable
 */
#events-container[hx-get] {
    cursor: auto;
}

/* Ensure calendar day cells don't have pointer cursor */
.calendar-day-cell {
    cursor: auto;
}

/* Google Calendar sync status indicator positioning */
.gcal-status-indicator {
    right: -8px;
    top: 14px;
}
