/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements.  See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership.  The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License.  You may obtain a copy of the License at
*
*   http://www.apache.org
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied.  See the License for the
* specific language governing permissions and limitations
* under the License.
*/

@import url('https://fonts.googleapis.com');

:root {
  --main-verde: #3E7C59;
  --main-vermelho: #ae0000;
  --main-normal:#327355;
  --main-exception:#ae0000;

  /* FERMO BURGUNDY BRANDING */
  --main-primary-claro: #7b124533;  /* Translucent burgundy */
  --main-primary-escuro: #7b1245;  /* Your brand color */
  --main-secondary-claro: #262626;  /* Dark grey for hovers */
  --main-secondary-escuro: #303030; /* Lighter dark grey */

  --main-grey-claro: #141414;       /* Main component background */
  --main-grey-escuro: #8c8c8c;      /* Muted text color */

  --main-linear-cora: #1f1f1f;      /* Sidebar top gradient */
  --main-linear-corb: #141414;      /* Sidebar bottom gradient */

  /* 
  --main-image-menu: url("../assets/asf-logo.svg");
  --main-image-login: url("../assets/asf-logo.svg");
  --main-image-icon: url("../assets/feather.svg");
 */
}

/* GLOBAL DARK RESET */
html, body, #app {
  background-color: #000 !important;
  color: rgba(255, 255, 255, 0.85) !important;
}

* {
  font-family: 'Poppins', sans-serif !important;
}

/* LOGIN SCREEN FIXES */
#app > div > form > img.user-layout-logo { display: none !important; }
#app > div > form {
  background-image: var(--main-image-login);
  background-repeat: no-repeat;
  background-size: 250px;
  background-position: top center;
  padding-top: 120px;
  background-color: var(--main-grey-claro) !important;
}

/* SIDEBAR / MENU BASE */
.ant-layout-sider.light.ant-fixed-sidemenu > div > div {
  height: 50px !important;
  background-image: var(--main-image-menu);
  background-repeat: no-repeat;
  background-size: 100px 80px !important;
  background-position: center center !important;
  margin-bottom: 20px;
}

aside, .ant-menu-submenu ul {
  background: linear-gradient(var(--main-linear-cora), var(--main-linear-corb)) !important;
}

/* SIDEBAR MENU ITEM SELECTION (DASHBOARD FIX) */
.ant-menu-light .ant-menu-item-selected,
.ant-menu-light .ant-menu-item-selected:active,
.ant-menu-light .ant-menu-item-selected:hover,
.ant-menu-item.ant-menu-item-selected {
  background-color: var(--main-primary-escuro) !important;
}

.ant-menu-item-selected a,
.ant-menu-item-selected a:hover,
.ant-menu-item-selected .anticon,
.ant-menu-item-selected span,
.ant-menu-item-selected .ant-menu-title-content {
  color: #ffffff !important;
}

.ant-menu-item-selected::after {
  border-right: 3px solid #ffffff !important;
}

.ant-menu-light .ant-menu-item:hover,
.ant-menu-light .ant-menu-submenu-title:hover {
  color: #ffffff !important;
  background-color: rgba(255, 255, 255, 0.1) !important;
}

.sider.light .ant-menu-light a, 
.sider.light .ant-menu-submenu > .ant-menu-submenu-title {
  color: rgba(255, 255, 255, 0.65) !important;
}

/* HEADER FIXES */
.layout.ant-layout .header {
  background: linear-gradient(var(--main-linear-cora), var(--main-linear-corb)) !important;
}
.layout.ant-layout .header .user-menu > span * {
  color: rgba(255, 255, 255, 0.85) !important;
}
.layout.ant-layout .header .anticon-menu-unfold,
.layout.ant-layout .header .anticon-menu-fold { color: #fff !important; }

/* --- HARDENED TABLE CELL FIXES --- */
.ant-layout .ant-table,
.ant-layout .ant-table-thead > tr > th,
.ant-layout .ant-table-tbody > tr > td,
.ant-layout .ant-table-cell,
.ant-table-content,
.ant-table-tbody {
  background-color: var(--main-grey-claro) !important;
  background: var(--main-grey-claro) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  border-bottom: 1px solid #303030 !important;
}

.ant-layout .ant-table-tbody > tr.ant-table-row:hover > td,
.ant-layout .ant-table-tbody > tr:hover > td,
.ant-layout .ant-table-cell-row-hover {
  background-color: var(--main-secondary-claro) !important;
  background: var(--main-secondary-claro) !important;
}

/* --- MODAL & POP-UP OVERRIDES --- */
.ant-modal-content,
.ant-modal-header,
.ant-modal-footer,
.ant-modal-confirm-content {
  background-color: #1f1f1f !important;
  background: #1f1f1f !important;
  color: rgba(255, 255, 255, 0.85) !important;
}
.ant-modal-header { border-bottom: 1px solid #303030 !important; }
.ant-modal-footer { border-top: 1px solid #303030 !important; }
.ant-modal-title, .ant-modal-close, .ant-modal-confirm-title { color: #fff !important; }

/* --- ALERTS & NOTIFICATIONS --- */
.ant-alert {
  background-color: #1f1f1f !important;
  border: 1px solid #434343 !important;
  color: rgba(255, 255, 255, 0.85) !important;
}
.ant-alert-warning {
  background-color: #2b2111 !important;
  border: 1px solid #d89614 !important;
}
.ant-alert-warning .ant-alert-message { color: #faad14 !important; }

/* DROPDOWNS & SELECT MENUS */
.ant-dropdown-menu,
.ant-select-dropdown,
.ant-menu-vertical.ant-menu-sub,
.ant-select-item-option {
  background-color: #1f1f1f !important;
  background: #1f1f1f !important;
  color: rgba(255, 255, 255, 0.85) !important;
}
.ant-select-item-option-active, 
.ant-select-item-option-selected,
.ant-dropdown-menu-item:hover {
  background-color: var(--main-primary-escuro) !important;
  color: #fff !important;
}

/* FORM INPUTS */
.ant-select-selector, .ant-input, .ant-input-number, .ant-input-affix-wrapper {
  background-color: #1f1f1f !important;
  color: #fff !important;
  border-color: #434343 !important;
}

/* PAGINATION */
.ant-pagination .ant-pagination-item.ant-pagination-item-active {
  background-color: var(--main-primary-escuro) !important;
  border-color: var(--main-primary-escuro) !important;
}
.ant-pagination .ant-pagination-item:not(.ant-pagination-item-active) {
  background-color: #1f1f1f !important;
}
.ant-pagination .ant-pagination-item a { color: rgba(255, 255, 255, 0.85) !important; }


/* Fix for the input field container */
  .ant-picker.ant-picker-focused,
  .ant-picker {
    background-color: transparent !important;
    background-image: none !important;
  }

  /* Fix for the popup dropdown */
  .ant-picker-dropdown .ant-picker-panel-container,
  .ant-picker-dropdown .ant-picker-panel,
  .ant-picker-dropdown .ant-picker-header,
  .ant-picker-dropdown .ant-picker-body,
  .ant-picker-dropdown .ant-picker-content {
    background-color: rgb(31, 31, 31) !important;
    color: #fff !important;
  }

  /* Ensure cells and interactive elements are visible */
  .ant-picker-dropdown .ant-picker-cell {
    color: rgba(255, 255, 255, 0.65) !important;
  }

  .ant-picker-dropdown .ant-picker-cell-inner {
    background-color: transparent !important;
    color: #fff !important;
  }

  .ant-picker-dropdown .ant-picker-cell-in-view {
    color: #fff !important;
  }

  .ant-picker-dropdown .ant-picker-header button {
    color: rgba(255, 255, 255, 0.65) !important;
  }

   /* 1. Main Select Container */
  .ant-select-selector {
    background-color: #141414 !important;
    border-color: #434343 !important;
    color: rgba(255, 255, 255, 0.85) !important;
  }

  /* 2. Selection Tags (Normal State) */
  .ant-select-selection-item {
    background-color: #7b1245 !important;
    border-color: #7b1245 !important;
    color: #ffffff !important;
  }

  /* 3. Text and Icons inside Tags */
  .ant-select-selection-item-content,
  .ant-select-selection-item-remove,
  .ant-select-selection-item-remove .anticon {
    color: #ffffff !important;
  }

  /* 4. Dropdown Menu Background */
  .ant-select-dropdown {
    background-color: #1f1f1f !important;
    border: 1px solid #434343 !important;
  }

  /* 5. Dropdown Items (Normal and Selected) */
  .ant-select-item-option {
    color: rgba(255, 255, 255, 0.85) !important;
  }

  .ant-select-item-option-selected:not(.ant-select-item-option-disabled) {
    background-color: #7b1245 !important;
    color: #ffffff !important;
  }

  /* 6. Hover States */
  .ant-select-item-option-active:not(.ant-select-item-option-selected) {
    background-color: rgba(123, 18, 69, 0.15) !important;
  }

  .ant-select-item-option-selected.ant-select-item-option-active {
    background-color: #9e1a5a !important; /* Lighter burgundy */
  }

  /* 7. Checkmarks and Icons */
  .ant-select-item-option-selected .ant-select-item-option-state,
  .ant-select-item-option-selected .ant-select-item-option-state .anticon {
    color: #ffffff !important;
  }

  /* 8. Search Input and Placeholder */
  .ant-select-selection-search-input {
    color: rgba(255, 255, 255, 0.85) !important;
  }

  .ant-select-selection-placeholder {
    color: rgba(255, 255, 255, 0.3) !important;
  }

  .ant-input-number-group-addon {
  background-color: #1f1f1f !important;
  color: #ffffff !important;
  }

  /* Dropdown Menu Background */
.ant-dropdown .ant-menu {
  background-color: #1f1f1f !important;
}

/* Menu Item Text Color */
.ant-dropdown .ant-menu-item {
  color: rgba(255, 255, 255, 0.85) !important;
}

/* Hover/Active State for Items */
.ant-dropdown .ant-menu-item:hover,
.ant-dropdown .ant-menu-item-active {
  background-color: rgba(255, 255, 255, 0.08) !important;
}

/* Checkbox Base State */
.ant-dropdown .ant-checkbox-inner {
  background-color: transparent !important;
  border-color: rgba(255, 255, 255, 0.45) !important;
}

/* Checkbox Checked State */
.ant-dropdown .ant-checkbox-checked .ant-checkbox-inner {
  background-color: #177ddc !important; /* Standard Ant Blue, or change to your preference */
  border-color: #177ddc !important;
}
