/* LatePoint Notes Admin CSS */

/* Main admin wrapper */
.latepoint-notes-admin {
    margin: 20px 0;
}

.latepoint-notes-admin .wp-heading-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 30px;
    font-size: 24px;
    color: #23282d;
}

.latepoint-notes-admin .wp-heading-inline .dashicons {
    font-size: 24px;
}

/* Layout */
.lpn-admin-container {
    display: flex;
    gap: 30px;
    max-width: 1400px;
}

.lpn-main-content {
    flex: 1;
    min-width: 0;
}

.lpn-sidebar {
    width: 300px;
    flex-shrink: 0;
}

/* Cards */
.lpn-card {
    background: #fff;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    margin-bottom: 20px;
}

.lpn-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.lpn-card-header h2,
.lpn-card-header h3 {
    margin: 0;
    font-size: 18px;
    color: #23282d;
}

.lpn-card-body {
    padding: 20px;
}

/* Fields List */
.lpn-fields-list {
    min-height: 100px;
}

.lpn-field-item {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 15px;
    transition: all 0.2s ease;
}

.lpn-field-item:hover {
    border-color: #c3c4c7;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.lpn-field-item.lpn-field-new {
    border-color: #00a0d2;
    box-shadow: 0 0 0 1px #00a0d2;
}

/* Field Header */
.lpn-field-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #e0e0e0;
    cursor: default;
}

.lpn-drag-handle {
    cursor: move;
    color: #8c8f94;
    padding: 4px;
    border-radius: 2px;
    display: flex;
    align-items: center;
}

.lpn-drag-handle:hover {
    background: #e0e0e0;
    color: #50575e;
}

.lpn-field-header .field-title {
    flex: 2;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
}

.lpn-field-header .field-type {
    flex: 1;
    min-width: 140px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.lpn-field-toggle,
.lpn-field-delete {
    background: none;
    border: none;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.lpn-field-toggle {
    color: #50575e;
}

.lpn-field-toggle:hover {
    background: #e0e0e0;
    color: #135e96;
}

.lpn-field-delete {
    color: #d63638;
}

.lpn-field-delete:hover {
    background: #f0e7e7;
    color: #d63638;
}

/* Field Body */
.lpn-field-body {
    padding: 20px;
}

.lpn-field-settings {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.lpn-field-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lpn-field-row label {
    font-weight: 500;
    color: #23282d;
    font-size: 14px;
}

.lpn-field-row input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.lpn-field-row input[type="text"]:focus {
    border-color: #00a0d2;
    outline: none;
    box-shadow: 0 0 0 1px #00a0d2;
}

/* Checkboxes */
.checkboxes-row {
    display: flex;
    flex-direction: row !important;
    gap: 20px !important;
    flex-wrap: wrap;
}

.lpn-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal !important;
    margin: 0;
    font-size: 14px;
}

.lpn-checkbox-label input[type="checkbox"] {
    margin: 0;
}

/* Options Management */
.lpn-options-container {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 15px;
}

.lpn-options-list {
    margin-bottom: 12px;
}

.lpn-option-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.lpn-option-item input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.lpn-option-remove {
    background: #d63638;
    color: white;
    border: none;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.lpn-option-remove:hover {
    background: #be2426;
}

.add-option {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #00a0d2;
    color: white !important;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.2s;
}

.add-option:hover {
    background: #135e96;
}

/* Actions Bar */
.lpn-actions-bar {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 20px;
}

#save-all-fields {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #00a0d2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
}

#save-all-fields:hover:not(:disabled) {
    background: #135e96;
}

#save-all-fields:disabled {
    background: #8c8f94;
    cursor: not-allowed;
}

#save-all-fields.has-changes {
    background: #ff8f00;
}

#save-all-fields.has-changes:hover {
    background: #f57c00;
}

.lpn-save-status {
    font-size: 14px;
    font-weight: 500;
}

/* Empty State */
.lpn-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #8c8f94;
}

.lpn-empty-state .dashicons {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.lpn-empty-state h3 {
    margin: 0 0 8px 0;
    font-size: 18px;
    color: #50575e;
}

.lpn-empty-state p {
    margin: 0;
    font-size: 14px;
}

/* Sidebar */
.lpn-help-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lpn-help-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    line-height: 1.5;
}

.lpn-help-list li:last-child {
    border-bottom: none;
}

.lpn-help-list strong {
    color: #135e96;
}

/* Sortable Placeholder */
.lpn-field-placeholder {
    height: 60px;
    background: #f0f8ff;
    border: 2px dashed #00a0d2;
    border-radius: 6px;
    margin-bottom: 15px;
    position: relative;
}

.lpn-field-placeholder::before {
    content: "Drop here";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00a0d2;
    font-weight: 500;
}

/* Animations */
@keyframes spinning {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.spinning {
    animation: spinning 1s linear infinite;
}

/* PDF Settings Specific */
.pdf-background-upload {
    margin-top: 10px;
}

.pdf-background-upload .preview-image {
    margin: 15px 0;
    max-width: 300px;
}

.pdf-background-upload .preview-image img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pdf-background-upload .button {
    margin-right: 10px;
}

/* Responsive Design */
@media screen and (max-width: 1200px) {
    .lpn-admin-container {
        flex-direction: column;
    }

    .lpn-sidebar {
        width: 100%;
    }
}

@media screen and (max-width: 768px) {
    .lpn-field-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .lpn-field-header .field-title,
    .lpn-field-header .field-type {
        flex: 1 1 100%;
        min-width: auto;
    }

    .checkboxes-row {
        flex-direction: column !important;
        gap: 10px !important;
    }

    .lpn-actions-bar {
        flex-direction: column;
        align-items: stretch;
    }

    #save-all-fields {
        justify-content: center;
    }
}

/* Focus States */
input:focus,
select:focus {
    outline: none;
    border-color: #00a0d2;
    box-shadow: 0 0 0 1px #00a0d2;
}

/* Button Styles */
.button.button-primary {
    background: #00a0d2;
    border-color: #00a0d2;
    color: white;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.button.button-primary:hover {
    background: #135e96;
    border-color: #135e96;
}

/* Original styles for compatibility */
.note-fields-container {
    margin-top: 20px;
    max-width: 800px;
}

.add-field-button {
    margin: 20px 0;
}

.field-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.field-row input.field-title {
    flex: 2;
    min-width: 200px;
}

.field-row select.field-type {
    flex: 1;
    min-width: 150px;
}

.field-row button {
    margin-left: 5px !important;
}

.field-row .delete-field {
    color: #dc3232;
}

#fields-list {
    margin-top: 20px;
}

/* Notes Buttons Shortcode Styles */
.os-notes-buttons {
    display: flex;
    gap: 10px;
    margin: 10px 0;
}

.os-notes-buttons .latepoint-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
}

.os-notes-buttons .latepoint-btn-secondary {
    background-color: #f0f0f0;
    color: #666;
    border: 1px solid #ddd;
}

.os-notes-buttons .latepoint-btn-secondary:hover {
    background-color: #e4e4e4;
    color: #333;
}

.os-notes-buttons .latepoint-icon {
    font-size: 16px;
}

.os-notes-buttons .os-notes-count {
    position: absolute;
    top: -8px;
    right: -8px;
    color: #0b7b57;
    background-color: #e5fff3;
    border: 1px solid #33cb8e;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 11px;
    min-width: 16px;
    text-align: center;
    line-height: 1;
    font-weight: bold;
}

.os-notes-error {
    color: #e35b5b;
    font-size: 14px;
    padding: 5px 0;
}