/*
 * Jacob's Well (JW) Dedicated Stylesheet
 * Scoped styles and enhancements for the JW module
 */

/* General & Layout Enhancements */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #2d3748;
    background-color: #f7fafc;
}

/* Navbar */
.site-header .navbar {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.site-header .navbar-brand {
    display: flex;
    align-items: center;
}

.site-header .navbar-nav .nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: 0.25rem;
    transition: all 0.2s ease-in-out;
}

.site-header .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    margin-top: 0;
}

.site-header .navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-bottom: none;
    margin-top: 0;
}

/* Sidebar Styling */
.sidebar {
    background: linear-gradient(180deg, #4a75a0 0%, #34577c 100%);
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.06);
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar h4 {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 1rem;
    margin-bottom: 1rem;
}

.sidebar-link-wrapper .btn {
    display: block;
    width: calc(100% - 1.5rem);
    margin: 0.25rem 0.75rem;
    padding: 0.5rem 0.85rem;
    color: #e2e8f0 !important;
    font-size: 0.9rem;
    font-weight: 500;
    text-align: left;
    border-radius: 0.35rem;
    border: none;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.sidebar-link-wrapper .btn:hover {
    background-color: rgba(255, 255, 255, 0.15) !important;
    color: #ffffff !important;
    margin-left: 0.75rem;
    transform: translateX(3px);
}

.sidebar-link-wrapper .btn.sidebar-active {
    background-color: rgba(255, 255, 255, 0.22) !important;
    color: #ffffff !important;
    border-left: 3px solid #f6ad55;
    font-weight: 600;
    margin-left: 0.75rem;
}

/* Main Content Area */
.main-header {
    margin-left: 220px;
    padding-top: 1rem;
    padding-bottom: 5rem;
}

@media (max-width: 768px) {
    .main-header {
        margin-left: 0;
        padding-left: 15px;
        padding-right: 15px;
        padding-top: 1.5rem;
    }
}

/* Cards & Containers */
.card {
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.04);
    background-color: #ffffff;
    margin-bottom: 1.5rem;
}

.card-header {
    background-color: #f8fafc;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    padding: 0.75rem 1.25rem;
    font-weight: 600;
}

.card-header .btn-link {
    color: #2b6cb0;
    font-weight: 600;
    text-decoration: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.card-header .btn-link:hover {
    color: #1a4971;
    text-decoration: none;
}

/* Accordion Polishing */
.accordion .card {
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.accordion .card-header button.btn-link::after {
    font-family: "Font Awesome 5 Free";
    content: "\f078";
    font-weight: 900;
    font-size: 0.85rem;
    transition: transform 0.2s ease;
    margin-left: auto;
}

.accordion .card-header button.btn-link.collapsed::after {
    transform: rotate(-90deg);
}

/* Profile / Hero Banner */
.jw-profile-hero {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.04);
}

.jw-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #ebf8ff;
    color: #3182ce;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    margin-right: 1.25rem;
    border: 2px solid #bee3f8;
}

/* Modern Data Table */
.table {
    color: #2d3748;
    margin-bottom: 0;
}

.table thead th {
    background-color: #f8fafc;
    color: #4a5568;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    vertical-align: middle;
}

.table tbody td {
    padding: 0.85rem 1rem;
    vertical-align: middle;
    border-top: 1px solid #edf2f7;
    font-size: 0.95rem;
}

.table-hover tbody tr:hover {
    background-color: #f7fafc;
}

/* Clickable Field Links in Resident Profiles */
.editable-field-link {
    color: #3182ce;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px dashed #bee3f8;
    transition: all 0.2s ease;
}

.editable-field-link:hover {
    color: #2b6cb0;
    border-bottom-color: #3182ce;
    text-decoration: none;
}

.field-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #718096;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.field-value {
    font-size: 0.95rem;
    color: #2d3748;
}

/* Badges */
.badge-active {
    background-color: #c6f6d5;
    color: #22543d;
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 0.25rem;
}

.badge-discharged {
    background-color: #edf2f7;
    color: #4a5568;
    font-weight: 600;
    padding: 0.35em 0.65em;
    border-radius: 0.25rem;
}

/* Buttons */
.btn {
    border-radius: 0.35rem;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
}

.btn-primary {
    background-color: #3182ce;
    border-color: #3182ce;
}

.btn-primary:hover {
    background-color: #2b6cb0;
    border-color: #2b6cb0;
}

.btn-outline-primary {
    color: #3182ce;
    border-color: #3182ce;
}

.btn-outline-primary:hover {
    background-color: #3182ce;
    color: #ffffff;
}

/* Forms */
.form-control {
    border-radius: 0.35rem;
    border: 1px solid #cbd5e0;
    font-size: 0.95rem;
}

.form-control:focus {
    border-color: #63b3ed;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.15);
}

/* Empty State Cards */
.empty-state-card {
    background: #ffffff;
    border: 1px dashed #cbd5e0;
    border-radius: 0.5rem;
    padding: 3rem 1.5rem;
    text-align: center;
    margin: 1.5rem 0;
}

.empty-state-card .empty-icon {
    font-size: 2.5rem;
    color: #a0aec0;
    margin-bottom: 1rem;
}

/* Footer Polish */
footer.jw-footer {
    padding: 2rem 0 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: #718096;
}

footer.jw-footer a {
    color: #4a5568;
    text-decoration: underline;
}

footer.jw-footer a:hover {
    color: #2d3748;
}

/* Legacy Form & Toggle Compatibility Enhancement */
label.toggle {
    display: block;
    cursor: pointer;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    color: #2b6cb0;
    background: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

label.toggle:hover {
    background: #ebf8ff;
    color: #2b6cb0;
    border-color: #bee3f8;
}

.toggle-el {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.submit-btn {
    background-color: #3182ce;
    border: 1px solid #3182ce;
    color: #ffffff;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 0.35rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-btn:hover {
    background-color: #2b6cb0;
    border-color: #2b6cb0;
}

.submit-btn#cancel {
    background-color: #ffffff;
    border: 1px solid #cbd5e0;
    color: #4a5568;
    margin-left: 0.5rem;
}

.submit-btn#cancel:hover {
    background-color: #f7fafc;
    border-color: #a0aec0;
}

input.form-text-field,
input.form-datefield,
textarea.form-text-field,
select.form-dropdown {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

input.form-text-field:focus,
input.form-datefield:focus,
textarea.form-text-field:focus,
select.form-dropdown:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}
