/* Custom CSS for Nextcloud 32.0.5 */
/* Quelle: https://arnowelzel.de/en/nextcloud-32-custom-css */

/* Make textarea for Custom CSS bigger */

textarea#theming-customcss-input {
  height: 40em;
}

/* Disable gradient for toolbar icons (NC 32.0.0) */

:root {
  --header-menu-icon-mask: linear-gradient() !important;
}

/* Remove rounded corners and margins for the content frame */

:root
{
  --body-container-radius: 0px !important;
  --body-container-margin: 0px !important;
}

[data-theme-light],
[data-theme-dark],
[data-theme-light-highcontrast],
[data-theme-dark-highcontrast] {
  --body-container-margin: 0px !important;
}

/* Also remove rounded corners in mobile view */

#content {
  border-radius: 0px !important;
}

/* This would move labels for text input fields above the fields
   However some input fields use dynamic label placement which
   also puts the label inside the field where this rule
   does not work nicely */

/*
.input-field__label {
  margin-top: -12px;
  background: rgb(255,255,255,0) !important;
}
.input-field__main-wrapper {
  margin-top: 14px;
}
*/

/* Files: Fix navigation settings area to avoid buttons to be cut off at the top
   The correct fix would be to give .app-navigation-entry__settings a top margin,
   but this is already set at 0px with !important */

.app-files .app-navigation-entry__settings > li {
  margin-top: 4px;
}

/* Text editor: fix page width in Collectives (NC 32.0.0) */

/* Fixed in Collectives 3.3.0
.app-collectives .ProseMirror {
  padding: 4px 0 !important;
}
*/

/* Text editor: show table headers with bold text and regular text color */

div.text-editor__content-wrapper th .content {
  font-weight: bold !important;
  color: var(--color-main-text) !important;
}

/* Text editor: force scroll bar to avoid "jumping" text when the page gets longer
   (does not work well with Collectives) */

/*
div[data-text-el="editor-container"] {
  overflow-y: scroll !important;
}
*/

/* Collectives: Adjust size of title headers in Collective to avoid descenders getting cut off */

.app-collectives input.title {
  height: 43px !important;
  font-size: 30px !important;
}

/* Collectives: Fix editable headers so they won't overlap the "Done" button
   This is already part of the default styles but does not get used */

.page-title {
  padding: 0 8px !important;
}

/* Collectives: hide "recent pages" widget */

.app-collectives .recent-pages-widget {
  display: none;
}

/* Collectives: hide landing page widgets */

.landing-page-widgets,
.widget-heading.text-container-heading {
  display: none;
}

/* Collectives: fix colors for callout boxes - use element darker colors  */

/* Fixed in Collectives 3.3.0
.callout {
  --color-error: var(--color-element-error) !important;
  --color-info: var(--color-element-info) !important;
  --color-success: var(--color-element-success) !important;
  --color-warning: var(--color-element-warning) !important;  
}
*/

/* Collectives: fix main container width to make drag handles and
   header links visible */

.sheet-view [data-collectives-el=editor],
.sheet-view [data-collectives-el=reader] {
  width: 100% !important;
}

/* ... hide drag handle for read only view */
div[contenteditable=false] + div .drag-handle {
  display: none !important;
}
/* ... remove translation from outline popup, so it won't move to the left */
.editor--outline {
  translate: none !important;
}

/* Text editor: fix missing padding below HR */

div.ProseMirror > hr {
  padding-bottom: 1em !important;
}

/* Text editor: fix missing margin below code blocks */

.code-block {
  margin-bottom: 1em;
}

/* Limit width of input field for new app password and fix position */

.app-name-text-field {
  max-width: 370px;
}

.app-name-text-field input {
  margin-top: 2px;
}

/* Calendar: Fix header to have the text centered */

.app-calendar .fc-col-header-cell div {
  margin-top: -10px;
}

/* Calendar: remove vertical scroll bar from header */

.app-calendar th .fc-scroller {
  overflow: hidden !important;
}

/* Calendar: fix detail view to be a full modal without the main toolbar visible and without unneccessary scrolling (NC 32.0.0) */

.calendar-edit-full {
  height: 100% !important;
  top: 0 !important;
}
	
.calendar-edit-full .app-full {
  height: inherit !important;
}

.calendar-edit-full .modal-wrapper--full>.modal-container {
  width: min(90vw, 82em) !important;
  border-radius: var(--border-radius-container, var(--border-radius-rounded)) !important;
  max-height: 90vh !important;
  margin-top: 5vh !important;
}

.calendar-edit-full .modal-wrapper .modal-container__content {
  padding-left: 1em;
  padding-right: 1em;
}


/* Notes: Fix "+ New note " button not to scroll */

.app-notes .app-navigation__body {
  overflow-y: hidden !important;
}

/* Notes: Fix top toolbar in editor */

.app-notes .text-menubar {
  margin-top: 8px !important;
  padding-bottom: 10px !important;
  padding-right: 16px;
}

/* Fix download and link icon in public shares */

.public-page-menu__wrapper .icon-download {
  background-image: var(--icon-download-white);
}

.public-page-menu__wrapper .icon-public {
  background-image: var(--icon-public-white);
}

/* Fix placement of context menu up */
/* Note: this does not work well when used for "..." menu at the right side */

/*
.v-popper__popper[data-popper-placement=top] {
  margin-top: 64px
}
*/

/* Draw.io: Fix view so it won't show an additional scroll bar */

.app-drawio > #app-content {
  overflow: hidden;
}

/* Draw.io: Fill screen without header */

#content.app-drawio {
  margin: 0;
  height: 100%;
  padding-block-end: 0 !important;
  z-index: 2147483647;
}

/* Calendar: fix horizontal scrolling for calendar view (NC 32.0.0) */

.app-calendar > .app-content {
  overflow: hidden !important;
}

/* Calendar: Fix missing margin for "settings" button (NC 32.0.1) */

.navigation-calendar-settings {
  padding-right: 8px;
}

/* Notes: Fix too small margin for "settings" button (NC 32.0.1) */

.app-notes .app-navigation-entry-wrapper {
  padding-right: 6px;
}

/* Deck: Fix "settings" button (NC 32.0.1) - reported at https://github.com/nextcloud/deck/issues/7338 */

.app-deck .settings-button {
  border-radius: var(--border-radius-element, var(--border-radius-pill)) !important;
}
.app-deck .settings-button__icon {
  padding-left: 4px;
  padding-top: 4px;
  opacity: 1 !important;
}

/* Bookmarks: Fix missing margins for "trash bin" and "settings" - reported at https://github.com/nextcloud/bookmarks/issues/2335 */

.app-bookmarks .app-navigation-entry-wrapper:nth-last-child(2) {
  padding-left: 8px;
  padding-right: 8px;
}
.app-bookmarks .app-navigation-entry-wrapper:nth-last-child(1) {
  padding-left: 8px;
  padding-right: 8px;
  padding-bottom: 8px;
}

/* Fix for link previews in markdown documents:

   1) Remove the empty space when open graph is disabled (.widgets--list, .link-view-bubble__reference-list)
   2) Fix top/bottom margin for internal preview widgets (.link-view-bubble .widget-custom) */

.widgets--list {
  min-height: 0 !important;
}
.link-view-bubble__reference-list {
  padding: 0 !important;
}
.link-view-bubble .widget-custom {
  margin-top: 4px !important;
  margin-bottom: 0 !important;
}

/* Hide footer in pulic shares */

#body-public footer.guest-box {
  display: none;
}

#body-public #app-content-vue {
  padding-block-end: 0;
}