/* iOS Cordova Tweak */
.device-cordova.device-ios {
    height: 100vh;
}

/* Fix messNavBar - remove margin from .blink class */
#messNavBar {
    margin: 0 !important;
}

/* Position badge absolutely to not affect icon width */
#messNavBar .icon {
    position: relative;
}

#messNavBar .badge {
    position: absolute;
    top: -6px;
    right: -6px;
}

/* iOS Input Field Visibility Fix - Only for login page */
.ios [data-name="loginPage"] .item-input-wrap input {
    background-color: #ffffff !important;
    border: 1px solid #c8c7cc !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    padding-right: 35px !important; /* Extra space for clear button */
}

/* Make sure input text is visible on iOS login page */
.ios [data-name="loginPage"] .item-input-wrap input::placeholder {
    color: #8e8e93 !important;
    opacity: 1 !important;
}

/* Position clear button properly on iOS login page */
.ios [data-name="loginPage"] .input-clear-button {
    right: 8px !important;
}

/* iOS Input Field Visibility Fix - For administer profiles popup */
.ios .administerProfiles .item-input-wrap input {
    background-color: #ffffff !important;
    border: 1px solid #c8c7cc !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    padding-right: 35px !important; /* Extra space for clear button and eye icon */
}

/* Make sure input text is visible in administer profiles popup */
.ios .administerProfiles .item-input-wrap input::placeholder {
    color: #8e8e93 !important;
    opacity: 1 !important;
}

/* Position clear button properly in administer profiles popup */
.ios .administerProfiles .input-clear-button {
    right: 8px !important;
}

/* Position eye icon properly when both clear button and eye icon are present */
.ios .administerProfiles .item-input-wrap[style*="position: relative"] input {
    padding-right: 70px !important; /* Extra space for both clear button and eye icon */
}


:root {
    --f7-keypad-buttons-rows: 5;
}

/* Force keypad/calculator to be centered with max-width on large screens */
.sheet-modal.keypad.keypad-sheet.keypad-type-calculator {
    max-width: 500px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    border-radius: 16px 16px 0 0 !important;
}

.sheet-modal.keypad.keypad-sheet.keypad-type-calculator.modal-in {
    transform: translateX(-50%) translateY(0) !important;
}

.sheet-modal.keypad.keypad-sheet.keypad-type-calculator.modal-out {
    transform: translateX(-50%) translateY(100%) !important;
}

/* Rounded toolbar corners */
.sheet-modal.keypad .toolbar {
    border-radius: 16px 16px 0 0;
}

/* iOS Keypad Fix - Adjust toolbar to prevent overlap with calculator buttons */
.ios .sheet-modal.keypad.keypad-sheet .toolbar {
    min-height: 44px !important;
    height: 44px !important;
}

.ios .sheet-modal.keypad.keypad-sheet .toolbar .toolbar-inner {
    padding-top: 4px !important;
    padding-bottom: 4px !important;
    min-height: 44px !important;
}

.ios .sheet-modal.keypad.keypad-sheet .sheet-modal-inner {
    padding-top: 44px !important;
}

/* Box-sizing fix for consistent layout across browsers */
*, *::before, *::after {
    box-sizing: border-box;
}

html,body {
    width: 100vw;
    /* Use dvh (dynamic viewport height) for better mobile support, fallback to 100vh */
    height: 100vh;
    height: 100dvh;
    margin: 0;
    padding: 0;
    overflow: hidden; /* Prevent scrolling on body - critical for iOS */
    -webkit-touch-callout: none;
    /* prevent callout to copy image, etc when tap to hold */
    -webkit-text-size-adjust: none;
    /* prevent webkit from resizing text to fit */
    /* Remove tap highlight on mobile */
    -webkit-tap-highlight-color: transparent;
    /* Better font rendering on mobile */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* iOS Safe Area Support for notch/home indicator */
@supports (padding: env(safe-area-inset-top)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-right: env(safe-area-inset-right);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
    }
}

/* Smooth scrolling on iOS */
.page-content,
.list,
.scrollable {
    -webkit-overflow-scrolling: touch;
}

.fc-event{
    margin-bottom: 1px;
    padding: 0;
    overflow: hidden;
    outline: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    white-space: normal !important;
    word-break: break-word;
    /* prevent select text*/
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    /* Better touch handling */
    touch-action: manipulation;
}

.fc-event-main	{
    margin-bottom: 1px;
    padding: 0;
    overflow: hidden !important;
    outline: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    white-space: normal !important;
    /* prevent select text*/
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    /* Better touch handling */
    touch-action: manipulation;
}

.fc-daygrid-day-events {
    /* prevent select text*/
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    padding-bottom: 24px !important;
}
.fc-col-header-cell-cushion{
    color: black;
    text-transform: uppercase;
}
.fc-daygrid-day-number{
    color: black;
}
.fc-daygrid-week-number{
    font-size: small;
}

/* Scheduler view - make header text black like dayGrid */
.fc-timeline-slot-cushion {
    color: black;
    text-transform: uppercase;
}

/* Scheduler view - ensure resource names are visible on mobile */
.fc-datagrid-cell-main {
    min-width: 100px !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

.fc-datagrid-cell-cushion {
    padding: 4px 8px !important;
    overflow: visible !important;
    white-space: normal !important;
    word-wrap: break-word !important;
}

/* On mobile, give resource column more space */
@media (max-width: 768px) {
    .fc-datagrid {
        min-width: 120px !important;
        max-width: 150px !important;
    }

    .fc-datagrid-cell-main {
        min-width: 120px !important;
    }
}

/* FullCalendar button consistency - active/disabled buttons darker, no confusing outline */
.fc-button {
    outline: none !important;
}

.fc-button:focus {
    outline: none !important;
    box-shadow: none !important;
}

.fc-button-active {
    opacity: 0.65;
}

.fc-button:disabled {
    opacity: 0.65;
}

/* Planning radio buttons - vertical layout to prevent jumping on resize */
#planningOptionButtonDiv p {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
}

#planningOptionButtonDiv label {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

/* Planning horizon - mark dates beyond configured limit */
.fc-day-beyond-horizon {
    background-color: #e8e8e8 !important;
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.fc-day-beyond-horizon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 0, 0, 0.05) 10px,
        rgba(0, 0, 0, 0.05) 20px
    );
}

.fc-slot-beyond-horizon {
    background-color: #e8e8e8 !important;
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.fc-slot-beyond-horizon::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0, 0, 0, 0.05) 10px,
        rgba(0, 0, 0, 0.05) 20px
    );
}

/* Planning file links - ensure long filenames wrap properly */
.planning-file-link {
    word-break: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.signature-pad {
    /* prevent select text*/
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}
.panel-left {
    box-shadow: none !important;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    background-color: #ffffff !important;
}
.panel-right {
    box-shadow: none !important;
    -webkit-box-shadow: none;
    -moz-box-shadow: none;
    background-color: #ffffff !important;
}
.prevent-select {
    /* prevent select text*/
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
}
.selectedlistitem
{
    background-color:orange;
}
.litextoverflow {
    white-space: nowrap;
    width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.activity {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;

}
/*Notifiering om meddelande*/
.blink {
    margin-right: 0.5rem;
    animation: blink 1s steps(5, start) infinite;
    -webkit-animation: blink 1s steps(5, start) infinite;
}
@keyframes blink {
    to {
        visibility: hidden;
    }
}
@-webkit-keyframes blink {
    to {
        visibility: hidden;
    }
}
.noblink {
    margin-right: 0.5rem;
}
