/* FRC Dashboard Shared Styles */

body {
    font-family: 'Inter', sans-serif;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

body::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* Sidebar Active State */
.sidebar-active {
    border-left: 3px solid #3abff8;
    background-color: rgba(58, 191, 248, 0.1);
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 10px;
}

/* Smooth Transitions */
.transition-smooth {
    transition: all 0.2s ease-in-out;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-urgent {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.badge-medium {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-low {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-pending {
    background: rgba(100, 116, 139, 0.1);
    color: #64748b;
    border: 1px solid rgba(100, 116, 139, 0.2);
}

.badge-approved {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-rejected {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Table Styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    text-align: left;
    padding: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    border-bottom: 1px solid #1e293b;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(30, 41, 59, 0.5);
    color: #e2e8f0;
}

.data-table tr:hover td {
    background-color: rgba(51, 65, 85, 0.3);
}

/* Modal Backdrop */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    z-index: 80;
    display: none;
}

.modal-backdrop.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Content */
.modal-content {
    background-color: #111827;
    border: 1px solid #1e293b;
    border-radius: 0.75rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #e2e8f0;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: #0f172a !important;
    border: 1px solid #334155 !important;
    border-radius: 0.5rem;
    color: #e2e8f0 !important;
    font-size: 0.875rem;
    resize: vertical;
}

/* Date input color scheme */
.form-input[type="date"] {
    color-scheme: dark;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #3abff8;
    box-shadow: 0 0 0 2px rgba(58, 191, 248, 0.3);
}

/* Select Option Styles - Dark theme */
.form-select option,
.form-select optgroup {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 0.5rem;
}

.form-select optgroup {
    font-weight: 700;
    color: #3abff8;
}

.form-select option:hover,
.form-select option:checked {
    background-color: #334155;
}

/* Button Styles */
.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    border: none;
}

.btn-primary {
    background-color: #3abff8;
    color: #0f172a;
}

.btn-primary:hover {
    background-color: #22d3ee;
}

.btn-secondary {
    background-color: #334155;
    color: #e2e8f0;
}

.btn-secondary:hover {
    background-color: #475569;
}

.btn-danger {
    background-color: #ef4444;
    color: #ffffff;
}

.btn-danger:hover {
    background-color: #dc2626;
}

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

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

/* Status Indicators */
.status-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    margin-right: 0.5rem;
}

.status-dot-success {
    background-color: #10b981;
}

.status-dot-warning {
    background-color: #f59e0b;
}

.status-dot-danger {
    background-color: #ef4444;
}

.status-dot-info {
    background-color: #3abff8;
}

/* SPA View Management */
.view-section {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.view-section.hidden {
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 3D Tilt Card Effect */
.tilt-card {
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out, box-shadow 0.3s ease;
    will-change: transform;
    perspective: 1000px;
}

.tilt-card:hover {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Inner content lift effect */
.tilt-card .tilt-inner {
    transform: translateZ(30px);
    transition: transform 0.3s ease;
}

.tilt-card:hover .tilt-inner {
    transform: translateZ(40px);
}

.app-content-shell {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem;
}

.app-content-shell-wide {
    max-width: 1600px;
}

.auth-content-shell {
    width: 100%;
    padding: 1rem;
}

#app-sidebar-overlay {
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(2, 6, 23, 0.76);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

#app-header-primary {
    min-width: 0;
}

#app-header-primary #auth-member-btn {
    min-width: 0;
}

body.app-drawer-open {
    overflow: hidden;
}

body.app-drawer-open #app-sidebar-overlay {
    opacity: 1;
    pointer-events: auto;
}

@media (min-width: 640px) {
    .app-content-shell,
    .auth-content-shell {
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .app-content-shell {
        padding: 2rem;
    }

    .auth-content-shell {
        padding: 1.5rem 3rem 1.5rem;
    }

    #app-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
    }

    #app-header-main {
        flex: 1 1 auto;
        min-width: 0;
    }

    #app-header-actions {
        margin-top: 0 !important;
        justify-content: flex-end;
    }

    #app-sidebar-overlay {
        display: none;
    }
}

@media (max-width: 1023px) {
    #app-shell {
        overflow-x: clip;
    }

    #app-sidebar {
        width: min(20rem, 86vw);
        transform: translateX(-110%);
        transition: transform 0.28s ease, box-shadow 0.28s ease;
        box-shadow: none;
    }

    body.app-drawer-open #app-sidebar {
        transform: translateX(0);
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    }

    #app-main {
        margin-left: 0 !important;
        width: 100%;
        min-width: 0;
    }

    #app-header {
        height: auto;
    }

    #app-header-main {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0.75rem;
    }

    #app-header-actions {
        margin-top: 0.75rem;
        display: flex;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    #app-header-actions > * {
        flex: 1 1 100%;
        min-width: 0;
    }

    #app-header-primary {
        width: 100%;
    }

    #app-header-primary #auth-member-btn,
    #app-header-actions > button,
    #app-header-actions > div {
        width: 100%;
    }

    #weekly-growth-widget > div {
        width: 100%;
        justify-content: center;
    }

    #auth-shell .auth-content-shell {
        padding-top: 0.75rem;
    }

    #auth-shell aside {
        position: relative;
        width: 100%;
        border-right: 0;
    }

    #auth-shell nav {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    #auth-shell [data-auth-view="login"],
    #auth-shell [data-auth-view="signup-info"] {
        max-width: none;
    }
}

@media (max-width: 767px) {
    .modal-backdrop {
        padding: 0.75rem;
    }

    .modal-backdrop.active {
        align-items: flex-end;
    }

    .modal-content {
        width: 100%;
        max-width: none;
        max-height: calc(100vh - 0.75rem);
        border-radius: 1.25rem 1.25rem 0 0;
    }

    #toast-container {
        left: 1rem !important;
        right: 1rem !important;
        bottom: 1rem !important;
    }

    #entry-modal .grid.grid-cols-2,
    #add-entry-modal .grid.grid-cols-2,
    #edit-entry-modal .grid.grid-cols-2,
    #rop-add-manual-modal .grid.grid-cols-2,
    #rop-settings-modal .grid.grid-cols-2,
    #rop-inv-picker-modal .grid.grid-cols-2 {
        grid-template-columns: 1fr;
    }

    #rop-add-manual-modal,
    #rop-settings-modal,
    #rop-inv-picker-modal,
    #add-entry-modal,
    #edit-entry-modal,
    #delete-confirm-modal {
        padding: 0.75rem;
        align-items: flex-end;
    }

    #rop-add-manual-modal > div,
    #rop-settings-modal > div,
    #rop-inv-picker-modal > div,
    #add-entry-modal > div,
    #edit-entry-modal > div,
    #delete-confirm-modal > div {
        width: 100% !important;
        max-width: none !important;
        max-height: calc(100vh - 0.75rem);
        overflow-y: auto;
        border-radius: 1.25rem 1.25rem 0 0;
    }
}
