/* Saved Info Page Styles - Matching Settings Page */

/* Import CSS Custom Properties from Modern UI System */
:root {
    /* Colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #2a2a2a;
    --bg-modal: #1a1a1a;
    --bg-card: #242424;
    --bg-input: #1e1e1e;
    --bg-button: #2d2d2d;
    --bg-button-hover: #3a3a3a;
    --bg-accent: #D9D9D950;
    --bg-accent-hover: #03a3b1;
    --bg-success: #4a9eff;
    --bg-danger: #ee2e24;
    --bg-warning: #fdb714;

    /* Text Colors - Unified with EEFDF9 */
    --text-primary: #EEFDF9;
    --text-secondary: #EEFDF9;
    --text-muted: #9ca3af;
    --text-accent: #4a9eff;
    --text-on-accent: #ffffff;

    /* Borders */
    --border-primary: #3a3a3a;
    --border-secondary: #2a2a2a;
    --border-accent: #03a3b1;
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;

    /* Modal specific colors - Unified with EEFDF9 */
    --modal-text-white: #EEFDF9;
    --modal-element-bg: #EEFDF910;
    --modal-element-bg-hover: #EEFDF950;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;

    /* Typography */
    --font-family: "Inter", sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 16px;
    --font-size-md: 16px;
    --font-size-lg: 24px;
    --font-size-xl: 24px;
    --font-size-2xl: 24px;
    --font-size-3xl: 36px;
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.75;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
}

/* Reset body styles */
body {
    background-color: #1a1a1a !important;
    color: #e5e7eb !important;
    font-family: "Inter", sans-serif !important;
    overflow: auto !important;
    height: auto !important;
    display: block !important;
    flex-direction: unset !important;
    justify-content: unset !important;
    align-items: unset !important;
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Main content area */
main {
    padding: 24px;
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: 0;
    /* Footer height removed */
    /* Safe area support for iPhone notch/Dynamic Island */
    padding-top: calc(24px + env(safe-area-inset-top, 0px));
    padding-left: calc(32px + env(safe-area-inset-left, 0px));
    padding-right: calc(32px + env(safe-area-inset-right, 0px));
    /* Scrollbar styling to match home.css */
    scrollbar-width: thin;
    scrollbar-color: var(--bg-tertiary) var(--bg-modal);
}

/* Notes Header Styling */
.notes-header {
    position: relative;
    margin-top: 75px;
    margin-left: 16px;
    margin-bottom: 40px;
    padding-top: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
}

.notes-title {
    font-family: "Inter", sans-serif;
    font-size: 36px;
    font-weight: 600;
    color: #f9fafb;
    margin-left: 4px;
    display: inline-block;
}

/* Help wrapper for positioning */
.notes-help-wrapper {
    position: relative;
    display: inline-block;
    margin-left: 20px;
    margin-top: 8px;
}

.notes-help-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #333333;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Inter", sans-serif;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.notes-help-icon:hover {
    background-color: #444444;
}

/* Help container tooltip */
.notes-help-container {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    width: 280px;
    max-width: 90vw;
    background-color: #1a1a1a;
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 12px;
    line-height: 1.4;
    color: #ffffff;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: none;
    font-family: "Inter", sans-serif;
}

.notes-help-container.visible {
    display: block;
}

/* Ensure help container appears above other elements */
.notes-help-container::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #1a1a1a;
}

.notes-edit-btn {
    font-family: "Inter", sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #f9fafb;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    margin-left: auto;
    margin-right: 35px;
    transition: opacity 0.2s ease;
}

.notes-edit-btn:hover {
    opacity: 0.7;
}

/* Button Styles - Matching settings.css */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-skilltrees-add {
    background-color: #03a3b1;
    color: #ffffff;
}

.btn-skilltrees-add:hover:not(:disabled) {
    background-color: #04bfce;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(3, 163, 177, 0.3);
}

.btn-skilltrees-add:disabled {
    background-color: #5a6878;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-skilltrees-secondary {
    background-color: #5a6878;
    color: #ffffff;
}

.btn-skilltrees-secondary:hover:not(:disabled) {
    background-color: #6b7a8c;
    transform: translateY(-1px);
}

/* Notes Container */
.notes-container {
    padding: 30px;
    border-radius: 12px;
    min-height: 400px;
    position: relative;
}

/* Notes Add Button Container */
.notes-add-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
}

.notes-add-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #1a1a1a;
    border: none;
    color: #ffffff;
    font-size: 32px;
    font-weight: 300;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 1;
    pointer-events: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.notes-add-btn:hover {
    background-color: #000000;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

/* Edit Mode Styles */
.notes-help-icon.edit-mode-delete {
    width: auto !important;
    padding: 4px 12px !important;
    border-radius: 20px !important;
    background-color: #ef4444 !important;
    color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: background-color 0.2s ease, transform 0.1s ease !important;
}

.notes-help-icon.edit-mode-delete:hover {
    background-color: #dc2626 !important;
    transform: scale(1.05) !important;
}

.notes-edit-btn.cancel-mode {
    color: #ef4444 !important;
}

.notes-edit-btn.cancel-mode:hover {
    color: #dc2626 !important;
}

.section-title-skilltrees {
    font-size: 24px;
    font-weight: 600;
    color: #f9fafb;
    margin: 32px 0 20px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

/* Message Styles */
#loading-message,
#error-message,
#info-limit-message {
    text-align: center;
    margin: 24px 0;
    font-size: 16px;
    padding: 12px 16px;
    border-radius: 8px;
}

.text-muted {
    color: #a0aec0;
}

.text-error {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.text-info {
    color: #03a3b1;
    background: rgba(3, 163, 177, 0.1);
    border: 1px solid rgba(3, 163, 177, 0.3);
}

/* Saved Info List */
#saved-info-list,
#saved-info-list-earlier {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Individual List Items - Matching configuration cards */
.saved-info-item {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    gap: 16px;
}

.saved-info-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.item-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.item-content {
    color: #e5e7eb;
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    word-break: break-word;
    white-space: pre-wrap;
}

.item-category {
    display: inline-block;
    background-color: #03a3b1;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    width: fit-content;
}

.item-source-indicator {
    font-size: 12px;
    color: #757575;
    font-style: italic;
    margin-top: 4px;
}

/* Options Button (3 dots) */
.options-btn {
    flex-shrink: 0;
    background-color: transparent;
    border: transparent;
    color: #a0aec0;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.options-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #e5e7eb;
    border-color: #4f5251;
}

/* Options Menu Dropdown */
.options-menu {
    position: absolute;
    background-color: #2a2a2a;
    border: transparent;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.35);
    min-width: 120px;
    z-index: 100;
    overflow: hidden;
    top: 40px;
    right: 0;
}

.options-item {
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    color: #e5e7eb;
    text-align: left;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.2s ease;
    display: block;
}

.options-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.options-item-danger {
    color: #ef4444;
}

.options-item-danger:hover {
    background: rgba(239, 68, 68, 0.1);
}


/* Modal Form Elements - Keep the specific styling for the add-edit modal form */
.modal-question {
    margin-bottom: var(--spacing-lg);
}

.modal-question label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
    font-family: var(--font-family);
}

#char-count {
    display: block;
    text-align: right;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    margin-top: var(--spacing-sm);
    font-family: var(--font-family);
}

#modal-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--border-radius);
    color: #ef4444;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    text-align: center;
    font-size: var(--font-size-xs);
    font-family: var(--font-family);
    display: none;
}

#modal-error.visible {
    display: block;
}

/* Examples Modal Styles */
#examples-modal .modal-content {
    max-width: 700px;
    width: 95%;
}

.example-item {
    background-color: var(--modal-element-bg);
    border: 1px solid var(--modal-element-bg);
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-md);
    transition: all var(--transition-fast);
}

.example-item:hover {
    background-color: var(--modal-element-bg-hover);
    border-color: var(--modal-element-bg-hover);
}

.example-content {
    flex-grow: 1;
}

.example-text {
    color: var(--text-primary);
    font-size: var(--font-size-md);
    line-height: var(--line-height-normal);
    margin: 0 0 var(--spacing-sm) 0;
    font-family: var(--font-family);
}

.example-category {
    display: inline-block;
    background-color: #03a3b1;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.example-add-btn {
    background-color: #03a3b1;
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.example-add-btn:hover {
    background-color: #04bfce;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(3, 163, 177, 0.3);
}

.example-add-btn:disabled {
    background-color: #5a6878;
    color: #ffffff;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive Design */
@media (max-width: 968px) {
    .notes-edit-btn {
        margin-right: 24px;
    }

    .notes-container {
        margin: 0 24px;
    }
}

.notes-edit-btn {
    margin-left: auto;
    margin-right: 35px;
}

.saved-info-item {
    padding: 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
}

.options-btn {
    align-self: flex-end;
}

.example-item {
    flex-direction: column;
    align-items: stretch;
}

.example-add-btn {
    margin-top: 8px;
    align-self: flex-start;
}

@media (max-width: 480px) {
    .notes-container {
        margin: 0 16px;
        padding: 4px;
    }

    .saved-info-item {
        padding: 16px;
    }

    .notes-add-container {
        bottom: 20px;
        right: 20px;
    }

}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.text-center {
    text-align: center;
}

/* Animation for adding items */
@keyframes slideInItem {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.saved-info-item.new-item {
    animation: slideInItem 0.3s ease;
}

/* Visual distinctions for different item types */
.saved-info-item.user-created {
    border-left: 4px solid #c2c2c2;
}

.saved-info-item.auto-accepted {
    border-left: 4px solid #666;
    opacity: 0.9;
}

.item-source-indicator {
    font-size: 12px;
    color: #999;
    font-style: italic;
    margin-left: 8px;
}