/**
 * LDS Ags Authentication Plugin Styles
 * Matches the site's maroon/pink design system.
 */

/* =============================================
   Utility Bar (Login | Create Account above nav)
   ============================================= */
#ldsags-utility-bar {
    background-color: #4a0e1f;
    padding: 5px 0;
    font-size: 13px;
    font-family: 'Roboto', sans-serif;
    letter-spacing: 0.3px;
    position: relative;
}

#ldsags-utility-bar .ldsags-utility-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

#ldsags-utility-bar a {
    color: #FFD1E1;
    text-decoration: none;
    transition: color 0.2s;
}

#ldsags-utility-bar a:hover {
    color: #fff;
    text-decoration: underline;
}

.ldsags-utility-sep {
    color: #B4778A;
    margin: 0 8px;
}

.ldsags-utility-scholarship {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-weight: 600;
    white-space: nowrap;
    z-index: 1;
}

#ldsags-utility-bar .ldsags-utility-scholarship a {
    color: #fff !important;
    text-decoration: underline !important;
}

@media (max-width: 699px) {
    #ldsags-utility-bar .ldsags-utility-inner {
        flex-direction: column;
        gap: 2px;
        padding: 4px 1rem;
    }
    #ldsags-utility-bar {
        font-size: 12px;
    }
    .ldsags-utility-scholarship {
        position: static;
        transform: none;
    }
}

/* =============================================
   Auth Form Container
   ============================================= */
.ldsags-auth-form {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 35px 30px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

/* =============================================
   Buttons
   ============================================= */
.btn.ldsags-btn-primary,
a.ldsags-btn-primary {
    background-color: #691D33;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 18px 20px;
    font-size: 18px;
    font-weight: 600;
    width: 100%;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
}

.btn.ldsags-btn-primary:hover,
a.ldsags-btn-primary:hover {
    background-color: #7d2440;
    color: #fff;
}

.btn.ldsags-btn-primary:active,
a.ldsags-btn-primary:active {
    transform: scale(0.98);
}

.btn.ldsags-btn-primary:disabled,
a.ldsags-btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Google Button */
.btn.ldsags-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px 20px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 17px;
    font-weight: 500;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.btn.ldsags-btn-google:hover {
    border-color: #bbb;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    background: #fafafa;
}

/* =============================================
   Form Elements
   ============================================= */
.ldsags-auth-form .form-control,
.ldsags-auth-form .form-select {
    border-radius: 8px;
    padding: 10px 14px;
    border: 1px solid #d0d0d0;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ldsags-auth-form .form-control:focus,
.ldsags-auth-form .form-select:focus {
    border-color: #691D33;
    box-shadow: 0 0 0 3px rgba(105, 29, 51, 0.1);
    outline: none;
}

.ldsags-auth-form .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 15px;
}

.ldsags-auth-form .form-text {
    font-size: 13px;
    color: #888;
}

.ldsags-select {
    border-radius: 8px !important;
}

/* =============================================
   Alerts
   ============================================= */
.ldsags-alert {
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 15px;
    margin-bottom: 20px;
    line-height: 1.5;
}

.ldsags-alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.ldsags-alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ldsags-alert-info {
    background-color: #FFF5F8;
    color: #691D33;
    border: 1px solid #FFD1E1;
}

/* =============================================
   Divider ("or" separator)
   ============================================= */
.ldsags-divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.ldsags-divider::before,
.ldsags-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #ddd;
}

.ldsags-divider span {
    padding: 0 16px;
    color: #999;
    font-size: 14px;
    font-weight: 500;
}

/* =============================================
   Links
   ============================================= */
.ldsags-link {
    color: #691D33;
    text-decoration: none;
    transition: color 0.2s;
}

.ldsags-link:hover {
    color: #7d2440;
    text-decoration: underline;
}

/* =============================================
   Role Badges (Account page)
   ============================================= */
.ldsags-role-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    margin-right: 6px;
}

.ldsags-role-student {
    background-color: #FFF5F8;
    color: #691D33;
    border: 1px solid #FFD1E1;
}

.ldsags-role-donor {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.ldsags-role-admin {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

.ldsags-role-super-admin {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

/* =============================================
   Role Selection (Registration)
   ============================================= */
.ldsags-role-option {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px;
    transition: border-color 0.2s, background-color 0.2s;
    cursor: pointer;
    height: 100%;
}

.ldsags-role-option:hover {
    border-color: #FFD1E1;
    background-color: #FFF5F8;
}

.ldsags-role-option label {
    cursor: pointer;
    display: block;
}

.ldsags-role-option input[type="checkbox"] {
    accent-color: #691D33;
    margin-right: 6px;
    transform: scale(1.15);
}

.ldsags-role-option input[type="checkbox"]:checked ~ strong {
    color: #691D33;
}

/* =============================================
   Spinner
   ============================================= */
.spinner {
    display: none;
    width: 32px;
    height: 32px;
    border: 3px solid #e8e8e8;
    border-top-color: #691D33;
    border-radius: 50%;
    animation: ldsags-spin 0.7s linear infinite;
    margin: 15px auto;
}

@keyframes ldsags-spin {
    to { transform: rotate(360deg); }
}

/* =============================================
   Account Header
   ============================================= */
.ldsags-account-header {
    background: #FFF5F8;
    border: 1px solid #FFD1E1;
    border-radius: 12px;
    padding: 24px 28px;
}

/* =============================================
   Account Page — Sidebar Navigation
   ============================================= */
.ldsags-account-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 100px;
}

.ldsags-account-nav-item {
    display: block;
    padding: 12px 18px;
    color: #691D33;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.ldsags-account-nav-item:hover {
    background-color: #FFF5F8;
    color: #691D33;
    text-decoration: none;
}

.ldsags-account-nav-item.active {
    background-color: #691D33;
    color: #fff;
    border-left-color: #691D33;
}

.ldsags-account-nav-item.active:hover {
    background-color: #7d2440;
    color: #fff;
}

/* Mobile: horizontal pills */
@media (max-width: 991.98px) {
    .ldsags-account-nav {
        flex-direction: row;
        gap: 8px;
        position: static;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
    }

    .ldsags-account-nav-item {
        white-space: nowrap;
        border-left: none;
        padding: 10px 20px;
        font-size: 14px;
        border-radius: 20px;
        text-align: center;
    }
}

/* =============================================
   Admin Dashboard Styles
   ============================================= */
.ldsags-admin-tabs .nav-link {
    color: #691D33;
    font-weight: 600;
    border: none;
    padding: 10px 20px;
    border-radius: 8px 8px 0 0;
}

.ldsags-admin-tabs .nav-link.active {
    background-color: #691D33;
    color: #fff;
}

.ldsags-admin-tabs .nav-link:hover:not(.active) {
    background-color: #FFF5F8;
}

/* Dashboard stat cards */
.ldsags-stat-section {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e8e8e8;
}

.ldsags-stat-card {
    background: #fff;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
    padding: 20px;
    text-align: center;
    height: 100%;
    transition: box-shadow 0.2s;
}

.ldsags-stat-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.ldsags-stat-card .stat-label {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.ldsags-stat-card .stat-number {
    font-size: 36px;
    font-weight: 800;
    color: #691D33;
    line-height: 1.1;
}

.ldsags-stat-card-primary {
    background: #691D33 !important;
    border-color: #691D33 !important;
}

.ldsags-stat-card-primary .stat-label {
    color: rgba(255,255,255,0.8) !important;
}

.ldsags-stat-card-primary .stat-number {
    color: #fff !important;
}

.ldsags-admin-toolbar {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e8e8e8;
}

.ldsags-admin-toolbar .form-control,
.ldsags-admin-toolbar .form-select {
    border-radius: 8px !important;
    padding: 10px 14px !important;
    border: 1px solid #d0d0d0 !important;
    font-size: 15px !important;
    height: auto !important;
    line-height: 1.5 !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ldsags-admin-toolbar .form-control:focus,
.ldsags-admin-toolbar .form-select:focus {
    border-color: #691D33;
    box-shadow: 0 0 0 3px rgba(105, 29, 51, 0.1);
    outline: none;
}

.ldsags-admin-toolbar .form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
    font-size: 15px;
}

.ldsags-admin-table {
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
}

.ldsags-admin-table thead {
    background-color: #691D33;
    color: #fff;
}

.ldsags-admin-table thead th {
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 13px 16px;
    border: none;
}

.ldsags-admin-table thead th[data-sort] {
    cursor: pointer;
    user-select: none;
}

.ldsags-admin-table thead th[data-sort]:hover {
    background-color: rgba(255,255,255,0.1);
}

.ldsags-admin-table thead th .sort-arrow {
    font-size: 11px;
    opacity: 0.8;
}

/* Contact modal - match select height to inputs */
#ldsags-edit-contact-modal .form-select {
    padding: 0.375rem 2.25rem 0.375rem 0.75rem !important;
    height: auto !important;
    min-height: calc(1.5em + 0.75rem + 2px);
    line-height: 1.5;
}

#ldsags-edit-contact-modal .form-control,
#ldsags-edit-contact-modal .form-select {
    font-size: 1rem !important;
    padding-top: 0.6rem !important;
    padding-bottom: 0.6rem !important;
}

/* Bulk import grid */
#marketing-import-table input.form-control-sm {
    padding: 4px 8px !important;
    font-size: 13px !important;
    border-radius: 4px !important;
}

#marketing-import-table .import-row:nth-child(even) {
    background-color: #fafafa;
}

#marketing-import-table .import-row:hover {
    background-color: #FFF5F8;
}

.ldsags-admin-table tbody td {
    vertical-align: middle;
    padding: 13px 16px;
    font-size: 15px;
}

.ldsags-admin-table tbody tr:hover {
    background-color: #FFF5F8;
}

.ldsags-admin-table .badge {
    font-weight: 500;
    font-size: 13px;
    padding: 5px 12px;
    border-radius: 12px;
}

.badge.badge-student {
    background-color: #FFF5F8;
    color: #691D33;
    border: 1px solid #FFD1E1;
}

.badge.badge-donor {
    background-color: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
}

.badge.badge-ldsags-admin {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
}

.badge.badge-admin {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.badge.badge-verified {
    background-color: #d4edda;
    color: #155724;
}

.badge.badge-unverified {
    background-color: #f8d7da;
    color: #721c24;
}

.badge.badge-enabled {
    background-color: #d4edda;
    color: #155724;
}

.badge.badge-disabled {
    background-color: #f8d7da;
    color: #721c24;
}

/* Admin action buttons */
.ldsags-admin-table .btn-sm {
    padding: 7px 16px;
    font-size: 14px;
    border-radius: 6px;
}

/* =============================================
   Modal Overrides
   ============================================= */
#ldsags-edit-user-modal .modal-content {
    border-radius: 12px;
    border: none;
}

#ldsags-edit-user-modal .modal-header {
    border-radius: 12px 12px 0 0;
}

#ldsags-edit-user-modal .form-check-input:checked {
    background-color: #691D33;
    border-color: #691D33;
}

/* =============================================
   Responsive
   ============================================= */
@media (max-width: 768px) {
    .ldsags-auth-form {
        padding: 25px 20px;
    }

    .ldsags-account-header {
        padding: 18px 20px;
    }

    .ldsags-account-header .d-flex {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .ldsags-admin-toolbar .row {
        gap: 8px;
    }

    .ldsags-admin-table {
        font-size: 13px;
    }

    .ldsags-admin-table thead th,
    .ldsags-admin-table tbody td {
        padding: 10px 8px;
    }
}

/* =============================================
   Turnstile Widget
   ============================================= */
.cf-turnstile {
    margin: 0 auto;
    min-height: 65px !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.cf-turnstile iframe {
    display: block !important;
    visibility: visible !important;
    min-height: 65px !important;
}

/* Override for narrow containers */
.col-md-5 .cf-turnstile iframe {
    max-width: 100%;
}

/* =============================================
   Back Link (Scholarship → My Account)
   ============================================= */
.ldsags-back-link {
    color: #691D33;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: color 0.2s;
}

.ldsags-back-link:hover {
    color: #7d2440;
    text-decoration: underline;
}

/* =============================================
   Scholarship Application — Progress Bar
   ============================================= */
.ldsags-progress-bar {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    padding: 20px 24px 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.ldsags-progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.ldsags-progress-step {
    text-align: center;
    cursor: pointer;
    flex: 1;
    position: relative;
}

.ldsags-step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e8e8e8;
    color: #888;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
    transition: background-color 0.3s, color 0.3s;
}

.ldsags-progress-step.active .ldsags-step-circle {
    background-color: #691D33;
    color: #fff;
}

.ldsags-progress-step.completed .ldsags-step-circle {
    background-color: #28a745;
    color: #fff;
}

.ldsags-step-label {
    font-size: 11px;
    color: #888;
    font-weight: 500;
    transition: color 0.3s;
}

.ldsags-progress-step.active .ldsags-step-label {
    color: #691D33;
    font-weight: 700;
}

.ldsags-progress-step.completed .ldsags-step-label {
    color: #28a745;
}

.ldsags-progress-track {
    height: 4px;
    background: #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
}

.ldsags-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #691D33, #7d2440);
    border-radius: 4px;
    transition: width 0.4s ease;
    width: 0%;
}

/* =============================================
   Scholarship Application — Badges
   ============================================= */
.ldsags-app-badge {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.badge-draft {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.badge-submitted {
    background-color: #FFF5F8;
    color: #691D33;
    border: 1px solid #FFD1E1;
}

.badge-under-review {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.badge-approved {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.badge-denied {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.badge-endorsement-not-sent {
    background-color: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.badge-endorsement-pending {
    background-color: #fff3e0;
    color: #e65100;
    border: 1px solid #ffe0b2;
}

.badge-endorsement-received {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* =============================================
   Scholarship Application — Endorsement Status
   ============================================= */
.ldsags-endorsement-status {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 16px 20px;
}

/* =============================================
   Scholarship Application — Word Counter
   ============================================= */
.ldsags-word-count {
    font-size: 12px;
    color: #888;
    font-weight: 500;
}

.ldsags-essay {
    resize: vertical;
    min-height: 120px;
}

/* =============================================
   Scholarship Application — Review (Step 9)
   ============================================= */
.ldsags-review-section {
    padding: 16px 0;
    border-bottom: 1px solid #e8e8e8;
    text-align: left;
}

.ldsags-review-section:last-of-type {
    border-bottom: none;
}

.ldsags-review-heading {
    color: #691D33;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 8px;
    margin-left: 0;
    margin-right: 0;
    text-align: left;
}

.ldsags-review-edit {
    background-color: transparent;
    color: #691D33;
    border: 1px solid #691D33;
    border-radius: 6px;
    padding: 7px 16px;
    font-size: 14px;
    font-weight: 600;
}

.ldsags-review-edit:hover {
    background-color: #691D33;
    color: #fff;
}

.ldsags-review-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 20px;
}

.ldsags-review-row {
    font-size: 15px;
    line-height: 1.6;
}

.ldsags-review-label {
    color: #888;
    font-weight: 500;
}

.ldsags-review-value {
    color: #333;
}

.ldsags-review-essay {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 200px;
    overflow-y: auto;
}

/* =============================================
   Scholarship — Form Check Accent
   ============================================= */
.ldsags-app-step .form-check-input:checked {
    background-color: #691D33;
    border-color: #691D33;
}

/* =============================================
   Scholarship — Responsive
   ============================================= */
@media (max-width: 768px) {
    .ldsags-progress-steps {
        gap: 2px;
    }

    .ldsags-step-label {
        font-size: 9px;
    }

    .ldsags-step-circle {
        width: 26px;
        height: 26px;
        font-size: 11px;
    }

    .ldsags-review-grid {
        grid-template-columns: 1fr;
    }

    .ldsags-app-nav {
        flex-direction: column;
        gap: 10px;
    }

    .ldsags-app-nav > div {
        display: flex;
        gap: 8px;
        width: 100%;
    }

    .ldsags-app-nav > div .btn {
        flex: 1;
    }

    #btn-prev {
        width: 100%;
    }
}

/* Email Broadcast */
.email-search-dropdown {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1050;
    max-height: 250px;
    overflow-y: auto;
}

.email-search-item {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f0f0f0;
}

.email-search-item:last-child {
    border-bottom: none;
}

.email-search-item:hover {
    background-color: #FFF5F8;
}
