@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --theme-color: #E85222;
    --theme-color-dark: #ca3300;
    --theme-dark: black;
    --theme-dark-grey: rgb(68, 68, 68);
    --light-grey: #e9e9e9;
    --sidebar-width: 80px;
    --sidebar-width-expand: 250px;
    --navbar-height: 60px;
    --table-radius: 0.8rem;

    /* Brand variables for skeleton-style header/sidebar */
    --brand-from: #FE7C22;
    --brand-to: #FFBF2E;
    --brand-secondary: #fff7f5;
    --brand-accent: #FE7C22;
}

/* Brand Gradient Utility */
.brand-gradient {
    background: #C0392B;
    /* Fallback */
    background: linear-gradient(to bottom, var(--brand-from) 0%, var(--brand-to) 100%);
}

/* Brand neutral utility */
.brand-neutral {
    background-color: var(--brand-secondary);
}



/* Scoped transitions — do NOT apply globally to avoid Safari layout animation bugs */
a,
button,
.sidebar-link,
.btn-theme,
.profile-menu,
.menu-list-item,
.dropdown-menu-list li {
    transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}

body {
    font-family: "Poppins", sans-serif !important;
    -webkit-font-smoothing: antialiased;
}

.text-theme {
    color: var(--theme-color) !important;
}

/* Legacy nav-theme kept for backward compat */
.nav-theme {
    position: fixed;
    width: 100%;
    left: 0;
    top: 0;
    height: var(--navbar-height);
    background: white;
    box-shadow: inset 0px -1px 0 #e9e9e9;
}

.nav-theme.expanded {
    width: calc(100% - var(--sidebar-width-expand));
    left: var(--sidebar-width-expand);
}

.sidebar-theme {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    background: white;
    box-shadow: inset -1px 0px 0 #e9e9e9;
}

.sidebar-theme.collapsed {
    width: var(--sidebar-width);
}

.sidebar-theme.expanded {
    width: var(--sidebar-width-expand);
}

.collapsed .side-brand span {
    display: none
}

.collapsed .menu-text {
    display: none;
}

.collapsed .dropdown-menu-list {
    display: none;
}


.side-brand {
    display: flex;
    flex-direction: row;
    align-items: center;
    padding: 0.4rem;
    gap: 10px;
    overflow: hidden;
}

.menu-list {
    padding: 0;
    margin: 0;
}

.side-brand img {
    height: calc(var(--navbar-height) - 0px);
    width: auto;
}

.sidebar-theme.collapsed .side-brand img {
    display: block;
    margin: auto;
}

.side-brand span {
    font-size: 1.1rem;
    font-weight: 600;
}

.menu-list-box {
    padding: 0.8rem;
}

.menu-list-item {
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: #f9f9f9;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 0.6rem;
}

.sidebar-theme.collapsed .menu-list-item {
    text-align: center;
}

.menu-icon {
    padding: 0.4rem;
}

.menu-text {
    padding: 0.5rem;
}


.dropdown-menu-list {
    padding-left: 40px;
    display: none;
}

.menu-list-item.dropdown {
    position: relative;
}

.menu-list-item.dropdown::after {
    content: '\f107';
    font-family: "FontAwesome";
    position: absolute;
    top: 0.4rem;
    right: 0.8rem;
    transform-origin: center;
    transition: all 0.3s ease;
}

.menu-list-item.dropdown.expanded::after {
    transform: rotate(180deg);
}



.menu-list-item.dropdown.expanded .dropdown-menu-list {
    display: block;
}

.sidebar-theme.collapsed .dropdown-menu-list,
.sidebar-theme.collapsed .menu-list-item.dropdown::after {
    display: none !important;
}

.dropdown-menu-list li {
    margin: 3px 0;
    padding: 4px;
    border-radius: 4px;

}

.dropdown-menu-list li:hover {
    background: #ebebeb;
}


.dp-img {
    height: 50px;
    width: 50px;

}

.profile-menu {
    position: fixed;
    top: var(--navbar-height);
    right: 1rem;
    padding: 1rem;
    border-radius: 0.8rem;
    max-width: 250px;
    background: white;
    border: 1px solid #e5e5e5;
    opacity: 0;
    pointer-events: none;
    transform: translateY(25px);
    z-index: 500;
}

.profile-menu.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.profile-items {
    padding: 0.4rem 0.6rem;
    width: 100%;
    border-radius: 0.4rem;
}



/* Skeleton-style layout:
   Fixed header = 80px, breadcrumb bar = ~48px → 128px-140px total top offset.
   We use 145px to be safe.
   Sidebar lives in a flex row so flex-1 fills remaining width automatically. */
.page-wrapper-theme {
    margin-top: 140px;
    margin-left: 16rem; /* Space for fixed sidebar (256px) */
    display: block;
    width: auto;
    padding: 1.2rem;
    background: #efefef;
    min-height: calc(100vh - 140px);
    min-height: -webkit-calc(100vh - 140px); /* Safari fallback */
    overflow-x: auto;
    transition: margin-left 0.3s ease;
}

/* When sidebar is closed, content fills full width */
.page-wrapper-theme.sidebar-closed {
    margin-left: 0;
}


.login-flex-box {
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
}

.login-logo {
    position: absolute;
    bottom: calc(100% + 1rem);
    left: 0;
    right: 0;
    margin: auto;
    width: 100%;
    text-align: center;
}

.login-logo img {
    max-width: 380px;
    width: 100%;
    display: block;
    margin: auto;
}

.login-box {
    position: relative;
    max-width: 550px;
    width: 100%;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 0 2px var(--theme-dark);
}


/* Inputs and Buttons */
input {
    display: block;
    width: 100%;
    border: 1px solid var(--theme-dark-grey);
    padding: 0.5rem 0.8rem;
    border-radius: 0.4rem;
}

input:hover,
input:focus,
input:active {
    outline: none;
    border: 1px solid var(--theme-dark);
}

.btn-theme {
    background: var(--theme-color);
    padding: 0.5rem 0.8rem;
    color: white;
    cursor: pointer;
    border-radius: 0.4rem;
}

.btn-theme:hover {
    background-color: var(--theme-color-dark);
}



#earning-chart {
    aspect-ratio: 16/10;
    width: 100%;
    height: auto;
}


/* Theme table  */
/* 
.theme-table{
    border: 1px solid var(--light-grey);
    border-radius: var(--table-radius);
    overflow: hidden;
    text-align: center;
} */

.theme-table table {
    display: table;
    width: 100%;
}

.theme-table table,
.theme-table td,
.theme-table th {
    border: 1px solid var(--light-grey);
    border-collapse: collapse;
}

.theme-table thead,
.theme-table tbody {
    width: 100%;
}

.theme-table td,
.theme-table th {
    padding: 0.4rem;
}