:root {
    --bg-primary: #f3f4f6;
    --bg-secondary: #ffffff;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --border-color: #e5e7eb;
    --hover-bg: rgba(209,213,219,var(--tw-border-opacity));
}

.dark {
    --bg-primary: #131415;
    --bg-secondary: #1d1f22;
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --border-color: #272a2d;
    --hover-bg: #272a2d;
}

@font-face {
    font-family: 'Malinton';
    src: local('Malinton Light'), local('Malinton-Light'),
        url('../fonts/Malinton-Light.woff2') format('woff2'),
        url('../fonts/Malinton-Light.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Malinton';
    src: local('Malinton Medium'), local('Malinton-Medium'),
        url('../fonts/Malinton-Medium.woff2') format('woff2'),
        url('../fonts/Malinton-Medium.woff') format('woff');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Malinton';
    src: local('Malinton Bold'), local('Malinton-Bold'),
        url('../fonts/Malinton-Medium.woff2') format('woff2'),
        url('../fonts/Malinton-Medium.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}


/* Update existing styles to use variables */
body {
    font-family: 'Malinton', 'Inter', Arial, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

.input-clear {
    background: transparent;
    border: 0;
    outline: 0;
}

button:focus,
input[type="submit"]:focus{
    outline: 0 !important;
}

.upload-progress {
    transition: width 0.3s ease-in-out;
}

select {
    -webkit-appearance: none;
    -moz-appearance: none;
    text-indent: 1px;
    text-overflow: '';
}

.select-input-helper {
    display: flex;
    position: relative;
}

.select-input-helper .icon {
    position: absolute;
    top: 50%;
    right: 0;
    bottom: 0;
    transform: translateY(-50%) translateX(-50%);
}

#loadingIndicator {
    z-index: 9999;
}

#stickyHeader {
    z-index: 1;
}

body.admin-bar #stickyHeader.fixed {
    transform: translateY(32px);
}

#stickyHeader.fixed > * {
    margin-left: -0.5rem;
    margin-right: -0.5rem;
}

#stickyHeader.fixed::before {
    content: "";
    position: absolute;
    bottom: 0;
    transform: translateY(50%);
    width: 100%;
    height: 0.5rem;
    background: rgb(0 0 0 / 50%);
    z-index: -1;
    border-radius: 100%;
    filter: blur(8px);
}

#stickyHeader.sticky-light > * {
    background-color: var(--bg-primary);
}

#stickyHeader.sticky-dark > * {
    background-color: var(--bg-primary);
}

#stickyHeader.sticky-dark::before {
    background: rgb(0 0 0 / 100%);
}

#fileList {
    position: relative;
    padding-top: 1rem;
}

#fileList .no-files,
#fileList .refreshing-files {
    position: absolute;
    width: 100%;
}

.file-item {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

/* Add more dark mode styles */
.dark .text-gray-800 {
    color: var(--text-primary);
}

.dark .text-gray-500 {
    color: var(--text-secondary);
}

.dark .bg-white {
    background-color: var(--bg-secondary);
}

.dark .border-gray-300 {
    border-color: var(--border-color);
}

.grid .file-item {
    display: flex;
    flex-direction: column;
}
.grid .icon-wrapper {
    position: relative;
    width: 100%;
}
.grid .icon-wrapper img {
    width: 100%;
    margin: 0 auto;
    font-size: 0;
    text-indent: -9999;
}
.grid .icon-wrapper .icon {
    width: 100%;
    min-height: 256px;
    margin: 0 auto;
}
.grid.file-item {
    position: relative;
}
.grid.file-item .actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    align-items: center;
    transition: all 250ms ease;
    background: rgb(255 255 255 / 80%);
    backdrop-filter: blur(2px);
    border-radius: 5px;
}
.grid.file-item:hover .actions {
    opacity: 1;
}
.list.file-item .actions {
    opacity: 0;
    transition: all 250ms ease;
}
.list.file-item:hover .actions {
    opacity: 1;
}
.loading {
    animation: spin 1s linear infinite;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.icon-wrapper .icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 96px;
    height: 64px;
    border-radius: 8px;
}
.meta {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}
.meta .type {
    display: inline-flex;
    text-transform: capitalize;
    align-items: center;
    gap: 0.25rem;
}
.meta .type .icon {
    background: transparent !important;
    position: relative;
    transform: translateY(-2px);
}
.meta .type .icon svg {
    width: 16px;
    height: 16px;
}

/* Add to your existing CSS */
#typeFilter button:hover {
    background-color: var(--hover-bg);
}

#typeFilter button.active {
    position: relative;
    background-color: rgba(67,56,202,var(--tw-bg-opacity)) !important;
    border-color: rgba(67,56,202,var(--tw-bg-opacity)) !important;
}

#typeFilter button.active .icon > svg {
    color: white;
}

/* Dark mode support */
.dark #typeFilter button:hover {
    background-color: var(--hover-bg);
}

.select-type {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 10px;
    word-break: keep-all;
    white-space: nowrap;
}
.select-type .icon {
    background: none;
}
.select-type .icon > svg {
    position: relative;
    width: 16px;
    height: 16px;
    transform: translateY(-1px)
}

/* Add to your CSS */
#typeFilter button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Add to your CSS */
.dark input,
.dark select {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border-color: var(--border-color);
}

.dark input::placeholder {
    color: var(--text-secondary);
}

.dark .shadow {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
}

.dark .svg-icon {
    filter: invert(1) brightness(2);
}

#uploadModal .inner {
    background: var(--bg-primary);
}

#uploadFileList {
    max-height: 200px;
    overflow: auto;
    background: var(--bg-primary);
}

#uploadFileList > div {
    background: var(--bg-secondary);
}

.text-md {
    font-size: 1rem !important;
}