/* Admin Form Pages Styles - Add/Edit Pages */

/* Page Header */
.form-page-header {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    border-radius: 12px;
    padding: 30px 35px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0, 123, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.form-page-header .header-content {
    flex: 1;
}

.form-page-header h3 {
    color: white;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    letter-spacing: -0.3px;
}

.form-page-header h3 i {
    font-size: 26px;
}

.form-page-header p {
    color: rgba(255, 255, 255, 0.95);
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

/* Form Card */
.form-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 30px;
}

.form-card-header {
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.1), rgba(0, 86, 179, 0.1));
    padding: 20px 30px;
    border-bottom: 2px solid #e9ecef;
}

.form-card-header h3 {
    color: #2c3e50;
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-card-header h3 i {
    color: #007bff;
    font-size: 18px;
}

.form-card-header p {
    color: #6c757d;
    font-size: 14px;
    margin: 0;
}

.form-card-body {
    padding: 30px;
}

/* Form Groups */
.form-group-modern {
    margin-bottom: 25px;
}

.form-group-modern label {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.35rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
    max-width: 100%;
}

.form-group-modern label i {
    flex-shrink: 0;
}

.form-group-modern label .text-danger,
.form-group-modern label .label-required {
    color: #dc3545;
    margin-left: 0;
    white-space: nowrap;
}

.form-group-modern .form-control {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 15px;
    transition: all 0.3s ease;
    width: 100%;
    color: #495057;
}

.form-group-modern .form-control:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    background-color: #fff;
}

.form-group-modern .form-control::placeholder {
    color: #adb5bd;
}

.form-control-modern {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px 15px;
    font-size: 15px;
    transition: all 0.3s ease;
    width: 100%;
    color: #495057;
    background-color: #fff;
}

.form-control-modern:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    background-color: #fff;
}

.form-control-modern::placeholder {
    color: #adb5bd;
}

.form-group-modern select.form-control,
.form-group-modern select.form-control-modern {
    cursor: pointer;
    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;
    appearance: none;
}

/* Validation Messages */
.text-danger {
    color: #dc3545;
    font-size: 13px;
    margin-top: 5px;
    display: block;
}

/* Checkbox Styles */
.form-check-modern {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.form-check-modern:hover {
    border-color: #007bff;
    background: #fff;
}

.form-check-input-modern {
    width: 22px;
    height: 22px;
    margin-right: 12px;
    cursor: pointer;
    accent-color: #007bff;
}

.form-check-label-modern {
    font-weight: 500;
    color: #2c3e50;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 15px;
}

.form-check-label-modern strong {
    font-weight: 600;
}

.form-check-label-modern small {
    display: block;
    margin-top: 5px;
    font-weight: normal;
    color: #6c757d;
}

.form-text {
    font-size: 13px;
    color: #6c757d;
    margin-top: 5px;
    display: block;
}

/* Form Footer — dismissive left, primary right (see .cursor/rules/form-action-buttons.mdc) */
.form-card-footer,
.standard-form-actions,
.card-footer-modern {
    background: #f8f9fa;
    padding: 20px 30px;
    border-top: 2px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.standard-form-actions {
    border-top: none;
    padding-left: 0;
    padding-right: 0;
    background: transparent;
}

/* Buttons */
.btn-save {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
}

.btn-save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%);
    color: white;
}

.btn-save:active {
    transform: translateY(0);
}

.btn-cancel {
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.2);
}

.btn-cancel:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
    background: #5a6268;
    color: white;
    text-decoration: none;
}

button.btn-cancel {
    border: none;
}

/* Modal footers — cancel left, primary action right */
.modal-footer.standard-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid #dee2e6;
}

.modal-footer.standard-form-footer .btn-cancel,
.modal-footer.standard-form-footer .btn-save,
.modal-footer.standard-form-footer .btn-danger-action {
    padding: 0.65rem 1.35rem;
    font-size: 0.95rem;
}

.modal-footer.standard-form-footer .btn-danger-action {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.25);
}

.modal-footer.standard-form-footer .btn-danger-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.35);
    color: white;
}

.modal-footer.standard-form-footer .btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.65rem 1.35rem;
    font-weight: 600;
}

.modal-footer.standard-form-footer:has(.btn-cancel:only-child),
.modal-footer.standard-form-footer:has(.btn-save:only-child) {
    justify-content: flex-end;
}

.btn-back {
    background: white;
    color: #007bff;
    border: 2px solid #007bff;
    border-radius: 8px;
    padding: 10px 20px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.2);
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
    background: #007bff;
    color: white;
    text-decoration: none;
}

/* Existing Items List (for City pages) */
.existing-items-card {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-top: 30px;
}

.existing-items-card h4 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.existing-items-card h4 i {
    color: #007bff;
}

.existing-items-card .list-group {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 6px;
}

.existing-items-card .list-group-item {
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 8px;
    background: white;
    transition: all 0.2s ease;
}

.existing-items-card .list-group-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.existing-items-card .list-group-item:last-child {
    margin-bottom: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-page-header {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
    }

    .form-page-header .header-content {
        width: 100%;
    }

    .form-card-body {
        padding: 20px;
    }

    .form-card-footer,
    .standard-form-actions,
    .card-footer-modern {
        flex-direction: column;
        align-items: stretch;
        padding: 15px 20px;
    }

    .form-card-footer .btn-save,
    .form-card-footer .btn-cancel,
    .standard-form-actions .btn-save,
    .standard-form-actions .btn-cancel,
    .card-footer-modern .btn-save,
    .card-footer-modern .btn-cancel,
    .card-footer-modern .btn-send {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .form-page-header h3 {
        font-size: 24px;
    }

    .form-page-header p {
        font-size: 14px;
    }

    .form-card-header {
        padding: 15px 20px;
    }

    .form-card-header h3 {
        font-size: 18px;
    }

    .form-card-body {
        padding: 15px;
    }

    .form-group-modern {
        margin-bottom: 20px;
    }
}

/* Summernote Rich Text Editor Styles */
.summernote-editor {
    min-height: 250px;
}

.note-editor.note-frame {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.note-editor.note-frame:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.note-editor .note-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 10px;
}

/* jQuery UI datepicker — readable on admin forms (AdminLTE can wash out day text) */
.ui-datepicker {
    z-index: 9999 !important;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #dee2e6;
    font-family: inherit;
    padding: 0;
}

.ui-datepicker-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    border-radius: 8px 8px 0 0;
}

.ui-datepicker-title {
    color: #fff;
}

/* Prev/next use jQuery UI sprite icons — force white, high-contrast controls */
.ui-datepicker .ui-datepicker-prev,
.ui-datepicker .ui-datepicker-next {
    top: 0.35em;
    width: 1.85em;
    height: 1.85em;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    cursor: pointer;
}

.ui-datepicker .ui-datepicker-prev:hover,
.ui-datepicker .ui-datepicker-next:hover,
.ui-datepicker .ui-datepicker-prev:focus,
.ui-datepicker .ui-datepicker-next:focus,
.ui-datepicker .ui-datepicker-prev.ui-state-hover,
.ui-datepicker .ui-datepicker-next.ui-state-hover {
    top: 0.35em;
    border: none;
    background: rgba(255, 255, 255, 0.38);
}

.ui-datepicker .ui-datepicker-prev .ui-icon,
.ui-datepicker .ui-datepicker-next .ui-icon {
    left: 50%;
    top: 50%;
    margin: 0;
    transform: translate(-50%, -50%);
    filter: brightness(0) invert(1);
    opacity: 1;
}

/* Public site CSS sets select { width: 100% }, which crushes month/year dropdowns */
.ui-datepicker .ui-datepicker-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    margin: 0 2.1em;
    line-height: 1.2;
}

.ui-datepicker select.ui-datepicker-month,
.ui-datepicker select.ui-datepicker-year {
    display: inline-block;
    width: auto;
    max-width: none;
    min-width: 4.25em;
    margin: 0;
    padding: 0.15rem 0.35rem;
    line-height: 1.3;
    font-size: 0.9rem;
    font-weight: 600;
    color: #212529;
    border: 1px solid rgba(255, 255, 255, 0.65);
    border-radius: 4px;
    background-color: #fff;
    background-image: none;
    appearance: auto;
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
}

.ui-datepicker-calendar th {
    color: #495057;
    font-weight: 600;
}

.ui-datepicker td span,
.ui-datepicker td a {
    color: #495057;
    text-align: center;
}

.ui-widget-content .ui-state-default {
    color: #495057;
    background: #fff;
    border: 1px solid transparent;
    border-radius: 4px;
}

.ui-widget-content .ui-state-hover,
.ui-widget-content .ui-state-focus {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.ui-widget-content .ui-state-active,
.ui-widget-content .ui-state-active:hover {
    background: #0056b3;
    color: #fff;
}

.note-editor .note-editable {
    padding: 15px;
    min-height: 250px;
    font-size: 15px;
    line-height: 1.6;
    color: #495057;
}

.note-editor .note-editable:focus {
    outline: none;
}

.note-editor .note-statusbar {
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

