@import "tailwindcss";
@source "../views";

/* Theme Configuration */
@theme {
    --font-sans: "Instrument Sans", sans-serif;
    --primary-gradient-from: #0d9488;
    --primary-gradient-to: #14b8a6;
    --primary-color: #0d9488;
    --primary-hover: #0f766e;
    --primary-color-rgb: 13, 148, 136;
    --selection-color: #3b82f6;
    --selection-color-hover: #2563eb;
    --selection-color-light: rgba(59, 130, 246, 0.1);
    --selection-color-dark: rgba(37, 99, 235, 0.2);
    --error-color: #ef4444;
    --error-color-rgb: 239, 68, 68;
}

@custom-variant dark (&:where(.dark, .dark *));

/* Base Styles */
textarea:focus,
input:focus {
    outline: none;
}

/* FilePond Customizations */
.filepond--drop-label {
    font-family: var(--font-sans);
}

/* Disable FilePond animations */
.filepond--image-preview-overlay-idle {
    animation: none !important;
}

.filepond--image-preview-overlay-success {
    animation: none !important;
}

.filepond--image-preview {
    background: none !important;
}

.filepond--image-preview-wrapper {
    animation: none !important;
}

.filepond--image-preview-overlay {
    animation: none !important;
    opacity: 0 !important;
}

/* Utility Classes */
.main-heading,
.sub-heading {
    font-size: 1.5rem;
    line-height: 2rem;
    font-weight: 700;
    color: #1f2937;
}

.dark .main-heading,
.dark .sub-heading {
    color: white;
}

.container-border {
    background-color: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.75rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.dark .container-border {
    background-color: #1f2937;
    border-color: #6b7280;
}

.container-border-table {
    background-color: white;
    border: 1px solid #d1d5db;
    border-radius: 0.25rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 0.125rem;
}

/* Table Styles */
.table-header {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    text-align: left;
    font-size: 0.75rem;
    line-height: 1rem;
    font-weight: 500;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    font-weight: 500;
    color: #374151;
    background-color: white;
    cursor: pointer;
}

.pagination-btn:hover {
    background-color: #f9fafb;
}

.pagination-btn:focus {
    outline: none;
    ring-offset: 2px;
    --tw-ring-opacity: 1;
    --tw-ring-color: rgba(168, 85, 247, var(--tw-ring-opacity));
    --tw-ring-offset-width: 2px;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn:disabled:hover {
    background-color: white;
}

/* Form Elements */
.select-input {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.select-input:focus {
    border-color: var(--selection-color);
    outline: none;
    --tw-ring-color: var(--selection-color);
    --tw-ring-opacity: 1;
    --tw-ring-offset-width: 0px;
    --tw-ring-offset-color: #fff;
    --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
    --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);
    box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}

.dark .select-input:focus {
    --tw-ring-color: var(--selection-color);
    border-color: var(--selection-color);
}

.checkbox-input {
    border-radius: 0.25rem;
    border-color: #d1d5db;
    color: #a855f7;
}

.checkbox-input:focus {
    --tw-ring-color: #a855f7;
    --tw-ring-opacity: 1;
    --tw-ring-offset-width: 0px;
    --tw-ring-offset-color: #fff;
    --tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);
    --tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(3px + var(--tw-ring-offset-width)) var(--tw-ring-color);
    box-shadow: var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow, 0 0 #0000);
}

/* Link Styles */
.link {
    color: var(--primary-color);
    text-decoration: underline;
    transition: color 0.2s ease-in-out;
}

.link:hover {
    color: var(--primary-hover);
}

.dark .link {
    color: var(--primary-color);
}

.dark .link:hover {
    color: var(--primary-hover);
}

/* Form Input States */
input:focus,
textarea:focus,
select:focus {
    outline: 0;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.15);
}

.dark input:focus,
.dark textarea:focus,
.dark select:focus {
    outline: 0;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.15);
}

/* Form Input Error States */
.error {
    border-color: var(--error-color);
    transition-property: box-shadow;
    transition-duration: 150ms;
    transition-timing-function: ease-in-out;
}

.error:focus {
    outline: 0;
    border-color: var(--error-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--error-color-rgb), 0.15);
}

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

.dark .error:focus {
    outline: 0;
    border-color: var(--error-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--error-color-rgb), 0.15);
}

/* Autofill Styles */
input:-webkit-autofill {
    -webkit-text-fill-color: inherit !important;
    background-color: white !important;
    box-shadow: inset 0 0 0 9999px white !important;
}

.dark input:-webkit-autofill {
    -webkit-text-fill-color: white !important;
    background-color: rgb(31, 41, 55) !important;
    box-shadow: inset 0 0 0 9999px rgb(31, 41, 55) !important;
}

/* Code Block Styles */
pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-words;
    max-width: 100%;
}

@layer components {
    /* Button Styles */
    .btn-primary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 0.5rem;
        font-weight: 600;
        letter-spacing: 0.025em;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        color: white;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        transition-property: all;
        transition-duration: 300ms;
        transition-timing-function: ease-in-out;
        background-color: var(--primary-color);
        box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    }

    .btn-primary.btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .btn-primary:hover {
        background-color: var(--primary-hover);
        transform: scale(1.02);
        box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    }

    .btn-secondary {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 0.5rem;
        font-weight: 600;
        letter-spacing: 0.025em;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        color: #4b5563;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        transition-property: all;
        transition-duration: 300ms;
        transition-timing-function: ease-in-out;
        background-color: #f3f4f6;
        border: 1px solid #eff1f3;
        box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    }

    .btn-secondary.btn-sm {
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .btn-secondary:hover {
        background-color: #e5e7eb;
        transform: scale(1.02);
        box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    }

    .dark .btn-secondary {
        background-color: #374151;
        color: #e5e7eb;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    }

    .dark .btn-secondary:hover {
        background-color: #4b5563;
        color: white;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    }

    .btn-primary-outline {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 0.5rem;
        font-weight: 600;
        letter-spacing: 0.025em;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        transition-property: all;
        transition-duration: 300ms;
        transition-timing-function: ease-in-out;
        background-color: white;
        color: var(--primary-color);
        border: 2px solid var(--primary-color);
        box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    }

    .btn-primary-outline:hover {
        background-color: var(--primary-color);
        color: white;
        transform: scale(1.02);
        box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    }

    .btn-danger {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 0.5rem;
        font-weight: 600;
        letter-spacing: 0.025em;
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
        color: white;
        cursor: pointer;
        position: relative;
        overflow: hidden;
        transition-property: all;
        transition-duration: 300ms;
        transition-timing-function: ease-in-out;
        background-color: rgb(239 68 68);
        box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    }

    .btn-danger:hover {
        background-color: rgb(220 38 38);
        transform: scale(1.02);
        box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    }

    .btn-danger:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
        box-shadow: none;
    }

    .dark .btn-danger {
        background-color: rgb(239 68 68);
        color: white;
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    }

    .dark .btn-danger:hover {
        background-color: rgb(220 38 38);
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    }

    .dark .btn-primary {
        background-color: var(--primary-color);
        color: rgb(241 245 249);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    }

    .dark .btn-primary:hover {
        background-color: var(--primary-hover);
        color: white;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    }

    .dark .btn-primary-outline {
        background-color: rgb(15 23 42);
        color: rgb(203 213 225);
        border-color: var(--primary-color);
        box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    }

    .dark .btn-primary-outline:hover {
        background-color: var(--primary-color);
        color: white;
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    }
}

/* Navigation Styles */
.nav-sidebar {
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transition-property: all;
    transition-duration: 300ms;
    transition-timing-function: ease-in-out;
}

.dark .nav-sidebar {
    background-color: #1f2937;
}

.nav-item {
    display: flex;
    align-items: center;
    padding-left: 0.625rem;
    padding-right: 0.625rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border-radius: 0.5rem;
    transition-property: all;
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
}

.nav-item-active {
    color: var(--primary-color);
}

.dark .nav-item-active {
    color: var(--primary-color);
}

.nav-item-default {
    color: #4b5563;
}

.dark .nav-item-default {
    color: #d1d5db;
}

.nav-item-default:hover {
    color: #111827;
    background-color: #f3f4f6;
}

.dark .nav-item-default:hover {
    color: white;
    background-color: rgba(55, 65, 81, 0.5);
}

.nav-icon {
    width: 18px;
    height: 18px;
    margin-right: 0.625rem;
    transition-property: color;
    transition-duration: 200ms;
    transition-timing-function: linear;
}

.nav-icon-active {
    color: var(--primary-color);
}

.dark .nav-icon-active {
    color: var(--primary-color);
}

.nav-icon-default {
    color: #4b5563;
}

.dark .nav-icon-default {
    color: #6b7280;
}

.nav-dropdown {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 0.625rem;
    padding-right: 0.625rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    border-radius: 0.5rem;
    transition-property: all;
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
    cursor: pointer;
}

.nav-dropdown-active {
    color: var(--primary-color);
}

.dark .nav-dropdown-active {
    color: var(--primary-color);
}

.nav-dropdown-default {
    color: #4b5563;
}

.dark .nav-dropdown-default {
    color: #d1d5db;
}

.nav-dropdown-default:hover {
    color: #111827;
    background-color: #f3f4f6;
}

.dark .nav-dropdown-default:hover {
    color: white;
    background-color: rgba(55, 65, 81, 0.5);
}

.nav-child-item {
    display: flex;
    align-items: center;
    padding-left: 0.375rem;
    padding-right: 0.375rem;
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    border-radius: 0.5rem;
    transition-property: all;
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
}

.nav-child-item-active {
    color: var(--primary-color);
    font-weight: 500;
}

.dark .nav-child-item-active {
    color: var(--primary-color);
}

.nav-child-item-default {
    color: #6b7280;
}

.dark .nav-child-item-default {
    color: #9ca3af;
}

.nav-child-item-default:hover {
    color: #111827;
    background-color: #f3f4f6;
}

.dark .nav-child-item-default:hover {
    color: white;
    background-color: rgba(55, 65, 81, 0.5);
}

.nav-divider {
    height: 1px;
    width: 100%;
    background-color: #f3f4f6;
}

.dark .nav-divider {
    background-color: #374151;
}

.nav-footer {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
    border-top: 1px solid #e5e7eb;
    background-color: white;
}

.dark .nav-footer {
    border-color: #374151;
    background-color: #1f2937;
}