/* Shadcn UI Style Components */

/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-decoration: none;
    white-space: nowrap;
}

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

.btn-primary {
    background-color: #3B82F6;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2563EB;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary {
    background-color: #8B5CF6;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #7C3AED;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-success {
    background-color: #10B981;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-danger {
    background-color: #EF4444;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #DC2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-white {
    background-color: white;
    color: #3B82F6;
}

.btn-white:hover:not(:disabled) {
    background-color: #F9FAFB;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #3B82F6;
    color: #3B82F6;
}

.btn-outline:hover:not(:disabled) {
    background-color: #3B82F6;
    color: white;
}

.btn-ghost {
    background-color: transparent;
    color: #4B5563;
}

.btn-ghost:hover:not(:disabled) {
    background-color: #F3F4F6;
}

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

.btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
}

.btn-xl {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* Input Components */
.input {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: #111827;
    background-color: white;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
}

.input:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input:disabled {
    background-color: #F3F4F6;
    cursor: not-allowed;
}

.input::placeholder {
    color: #9CA3AF;
}

.input-error {
    border-color: #EF4444;
}

.input-error:focus {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Select Component */
select.input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Checkbox Component */
.checkbox {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #D1D5DB;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.checkbox:checked {
    background-color: #3B82F6;
    border-color: #3B82F6;
}

.checkbox:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Radio Component */
.radio {
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid #D1D5DB;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.radio:checked {
    background-color: #3B82F6;
    border-color: #3B82F6;
}

.radio:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Switch Component */
.switch {
    position: relative;
    display: inline-block;
    width: 3rem;
    height: 1.5rem;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #D1D5DB;
    transition: 0.3s;
    border-radius: 1.5rem;
}

.switch-slider:before {
    position: absolute;
    content: "";
    height: 1.125rem;
    width: 1.125rem;
    left: 0.1875rem;
    bottom: 0.1875rem;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
}

.switch input:checked + .switch-slider {
    background-color: #3B82F6;
}

.switch input:checked + .switch-slider:before {
    transform: translateX(1.5rem);
}

/* Alert Component */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    border: 1px solid;
    margin-bottom: 1rem;
}

.alert-info {
    background-color: #EFF6FF;
    border-color: #BFDBFE;
    color: #1E40AF;
}

.alert-success {
    background-color: #F0FDF4;
    border-color: #BBF7D0;
    color: #15803D;
}

.alert-warning {
    background-color: #FFFBEB;
    border-color: #FDE68A;
    color: #92400E;
}

.alert-error {
    background-color: #FEF2F2;
    border-color: #FECACA;
    color: #991B1B;
}

/* Dialog/Modal Component */
.dialog-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    animation: fade-in 0.2s ease-out;
}

.dialog {
    background-color: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    max-width: 32rem;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slide-in-right 0.3s ease-out;
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.dialog-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
}

.dialog-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6B7280;
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.25rem;
}

.dialog-close:hover {
    background-color: #F3F4F6;
    color: #111827;
}

.dialog-body {
    margin-bottom: 1.5rem;
}

.dialog-footer {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

/* Tabs Component */
.tabs {
    border-bottom: 1px solid #E5E7EB;
}

.tabs-list {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tab {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #6B7280;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.tab:hover {
    color: #111827;
}

.tab.active {
    color: #3B82F6;
    border-bottom-color: #3B82F6;
}

/* Accordion Component */
.accordion-item {
    border: 1px solid #E5E7EB;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 1rem;
    background-color: white;
    border: none;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease-in-out;
}

.accordion-header:hover {
    background-color: #F9FAFB;
}

.accordion-content {
    padding: 0 1rem 1rem;
    color: #6B7280;
    display: none;
}

.accordion-content.active {
    display: block;
}

/* Tooltip Component */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip-text {
    visibility: hidden;
    background-color: #111827;
    color: white;
    text-align: center;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    position: absolute;
    z-index: 9999;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Progress Component */
.progress {
    width: 100%;
    height: 0.5rem;
    background-color: #E5E7EB;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background-color: #3B82F6;
    transition: width 0.3s ease-in-out;
}

/* Skeleton Loader */
.skeleton {
    background: linear-gradient(90deg, #F3F4F6 25%, #E5E7EB 50%, #F3F4F6 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 0.25rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    margin-bottom: 1rem;
}

.skeleton-circle {
    border-radius: 50%;
}

/* Navigation Links */
.nav-link {
    position: relative;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9CA3AF;
    text-decoration: none;
    padding: 0.5rem 0;
    transition: color 0.2s ease-in-out;
}

.nav-link:hover {
    color: #FFFFFF;
}

.nav-link.active {
    color: #FFFFFF;
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #3B82F6, #8B5CF6);
    border-radius: 2px 2px 0 0;
}

/* Flatpickr Customization */
/* Using dark theme CSS, only minor tweaks */
.flatpickr-calendar {
    z-index: 9999 !important;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5) !important;
}

.flatpickr-day.selected {
    background: #3B82F6 !important;
    border-color: #3B82F6 !important;
}

.flatpickr-day.today {
    border-color: #8B5CF6 !important;
}

.flatpickr-day.today:hover {
    background: #8B5CF6 !important;
}
