/* ========== 2026 RESOLUTIONS PAGE STYLES ========== */

/* Resolutions Page Container */
#resolutions-page {
    padding: 16px 0;  /* Remove horizontal padding - rely on .app-container */
}

/* Resolutions Container */
.resolutions-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Owner Section */
.owner-section {
    background: white;
    border-radius: 8px;
    padding: 12px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

/* Owner Header (Collapsible) */
.owner-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
    user-select: none;
}

.owner-header:hover {
    background-color: rgba(197, 174, 240, 0.1);
}

.owner-header h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.section-arrow {
    font-size: 1rem;
    color: #666;
    transition: transform 0.3s;
}

.section-arrow.collapsed {
    transform: rotate(-90deg);
}

/* Owner Resolutions Container */
.owner-resolutions {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.owner-resolutions.collapsed {
    max-height: 0;
    margin-top: 0;
}

/* Resolution Card */
.resolution-card {
    background: #f9f9f9;
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    transition: background-color 0.2s, box-shadow 0.2s;
    border: 1px solid #eee;
}

.resolution-card:hover {
    background-color: #f5f5f5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

/* Resolution Header */
.resolution-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.resolution-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px 0;
}

.resolution-summary {
    font-size: 0.75rem;
    color: #666;
    margin: 0;
}

.resolution-arrow {
    font-size: 0.9rem;
    color: #666;
    transition: transform 0.3s;
    flex-shrink: 0;
}

.resolution-card.collapsed .resolution-arrow {
    transform: rotate(-90deg);
}

/* Expanded Resolution Card */
.resolution-details {
    margin-top: 12px;
    display: none;
}

.resolution-card:not(.collapsed) .resolution-details {
    display: block;
}

/* Log Entry Button */
.log-entry-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #c5aef0 0%, #eb7093 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    margin-bottom: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.log-entry-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.log-entry-btn:active {
    transform: translateY(0);
}

.resolution-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.time-period-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background-color: rgba(197, 174, 240, 0.2);
    border-radius: 12px;
    font-size: 0.75rem;
    color: #666;
}

.progress-section {
    margin-top: 10px;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(135deg, #c5aef0 0%, #eb7093 100%);
    transition: width 0.3s ease;
}

.entry-count {
    font-size: 0.75rem;
    color: #666;
    text-align: right;
}

/* Backlog Section */
.backlog-section {
    margin-top: 12px;
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 6px;
}

.backlog-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    border-radius: 6px;
    transition: background-color 0.2s;
    user-select: none;
}

.backlog-toggle:hover {
    background-color: rgba(197, 174, 240, 0.1);
}

.backlog-toggle-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
}

.backlog-toggle-arrow {
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.3s;
}

.backlog-toggle-arrow.collapsed {
    transform: rotate(-90deg);
}

.backlog-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.backlog-list.collapsed {
    max-height: 0;
    margin-top: 0;
}

.backlog-item {
    background: #fafafa;
    border-radius: 4px;
    padding: 6px;
    font-size: 0.8rem;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    margin: 4px 0;
}

.backlog-item.used .backlog-item-text {
    color: #999;
}

.backlog-item.used .backlog-item-text::after {
    content: " ✓";
    color: #4caf50;
    font-size: 0.75rem;
    margin-left: 4px;
}

.backlog-item-text {
    flex: 1;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    min-width: 0;
}

.backlog-item-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.backlog-item-log {
    background: white;
    border: 1px solid #e0e0e0;
    color: #eb7093;
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: background-color 0.2s, border-color 0.2s;
}

.backlog-item-log:hover {
    background-color: #fef5f8;
    border-color: #eb7093;
}

.backlog-item-delete {
    background: none;
    border: none;
    color: #999;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}

.backlog-item-delete:hover {
    color: #eb7093;
}

.add-idea-btn {
    width: 100%;
    padding: 8px;
    background: white;
    color: #666;
    border: 1px dashed #ccc;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    margin-top: 8px;
    transition: border-color 0.2s, color 0.2s;
}

.add-idea-btn:hover {
    border-color: #c5aef0;
    color: #c5aef0;
}

/* Entries Section */
.entries-section {
    margin-top: 12px;
    border-top: 1px solid #eee;
    padding-top: 12px;
}

.entries-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    border-radius: 6px;
    transition: background-color 0.2s;
    user-select: none;
}

.entries-toggle:hover {
    background-color: rgba(197, 174, 240, 0.1);
}

.entries-toggle-text {
    font-size: 0.85rem;
    font-weight: 600;
    color: #666;
}

.entries-toggle-arrow {
    font-size: 0.8rem;
    color: #666;
    transition: transform 0.3s;
}

.entries-toggle-arrow.collapsed {
    transform: rotate(-90deg);
}

.entries-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.entries-list.collapsed {
    max-height: 0;
    margin-top: 0;
}

.entry-item {
    background: #fafafa;
    border-left: 2px solid #eb7093;
    border-radius: 4px;
    padding: 8px;
    font-size: 0.8rem;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.entry-title {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.entry-date {
    font-size: 0.7rem;
    color: #999;
    white-space: nowrap;
    margin-left: 8px;
}

.entry-notes {
    font-size: 0.75rem;
    color: #666;
    font-style: italic;
    margin-top: 4px;
}

/* Empty State */
.owner-resolutions .empty-message {
    text-align: center;
    color: #999;
    font-size: 0.8rem;
    padding: 20px 10px;
    font-style: italic;
}

.entries-list .empty-message {
    text-align: center;
    color: #999;
    font-size: 0.75rem;
    padding: 12px;
    font-style: italic;
}

/* Backlog Selection in Modal */
.backlog-selection-section {
    margin-bottom: 16px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e8e8e8;
}

.backlog-selection-label {
    font-size: 0.75rem;
    color: #999;
    margin: 0 0 8px 0;
}

.backlog-selection-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.backlog-selection-item {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 8px;
    font-size: 0.8rem;
    color: #333;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.backlog-selection-item:hover {
    background-color: #fef5f8;
    border-color: #eb7093;
}

.backlog-selection-item.selected {
    background-color: #fef5f8;
    border-color: #eb7093;
    border-width: 2px;
    padding: 7px; /* Adjust for thicker border */
}

/* Modal Adjustments for Resolutions */

/* Reduce modal padding for Resolutions modals only (not site-wide) */
#addResolutionModal .add-goal-modal-content,
#logEntryModal .add-goal-modal-content,
#addIdeaModal .add-goal-modal-content {
    padding: 20px !important;
}

/* Reduce title margin for Resolutions modals only */
#addResolutionModal h2,
#logEntryModal h2,
#addIdeaModal h2 {
    margin-bottom: 16px;
}

/* Reduce button margin for Resolutions modals only */
#addResolutionModal .save-goal-btn,
#logEntryModal .save-goal-btn,
#addIdeaModal .save-goal-btn {
    margin-top: 16px;
}

/* Reduce form group spacing for New Resolution modal */
#addResolutionModal .form-group {
    margin-bottom: 12px;
}

/* Reduce form group spacing for Log Entry modal */
#logEntryModal .form-group {
    margin-bottom: 12px;
}

/* Reduce backlog selection section padding (Log Entry modal only) */
#logEntryModal .backlog-selection-section {
    padding: 6px;
}

/* Reduce backlog selection item padding (Log Entry modal only) */
#logEntryModal .backlog-selection-item {
    padding: 6px;
}

/* Form row layout for side-by-side fields */
#addResolutionModal .form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

#addResolutionModal .form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Stack form rows vertically on very small screens */
@media (max-width: 360px) {
    #addResolutionModal .form-row {
        flex-direction: column;
        gap: 0;
    }

    #addResolutionModal .form-row .form-group {
        margin-bottom: 12px;
    }
}

/* ===== TYPOGRAPHY CONSISTENCY FOR LOG ENTRY MODAL ===== */

/* Match Log Entry labels to New Resolution style */
#logEntryModal .modal-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

/* Match Log Entry inputs to New Resolution style */
#logEntryModal .input-field {
    padding: 10px;
    font-size: 0.85rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    height: auto;
}

/* Match Log Entry textarea to New Resolution style */
#logEntryModal textarea.input-field {
    padding: 10px;
    font-size: 0.85rem;
    border-radius: 6px;
    min-height: 80px;
}

/* Fix backlog selection label to match other form labels */
#logEntryModal .backlog-selection-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

/* ===== BACKLOG SECTION OVERFLOW FIXES ===== */

/* Fix backlog item text wrapping to prevent horizontal overflow */
.backlog-selection-item,
#logEntryModal .backlog-selection-item {
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
    max-width: 100%;
}

/* Make backlog list scrollable with max height */
#logEntryModal .backlog-list,
#logEntryModal .backlog-selection-list {
    max-height: 250px;          /* ADJUSTABLE - easy to change later */
    overflow-y: auto;            /* Shows scrollbar only when needed */
    overflow-x: hidden;          /* Prevent horizontal scroll */
}

/* Thin, styled scrollbar for better UX */
#logEntryModal .backlog-list::-webkit-scrollbar,
#logEntryModal .backlog-selection-list::-webkit-scrollbar {
    width: 6px;
}

#logEntryModal .backlog-list::-webkit-scrollbar-thumb,
#logEntryModal .backlog-selection-list::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

#logEntryModal .backlog-list::-webkit-scrollbar-thumb:hover,
#logEntryModal .backlog-selection-list::-webkit-scrollbar-thumb:hover {
    background: #bbb;
}

#addResolutionModal .modal-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 6px;
}

#addResolutionModal .input-field {
    width: 100%;
    padding: 10px;
    font-size: 0.85rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-sizing: border-box;
}

#addResolutionModal .input-field:focus {
    outline: none;
    border-color: #c5aef0;
}

/* Responsive Design */
@media (min-width: 768px) {
    #resolutions-page {
        padding: 20px 0;  /* Remove horizontal padding - rely on .app-container */
    }

    .owner-header h3 {
        font-size: 1.1rem;
    }

    .resolution-title {
        font-size: 1rem;
    }

    .resolutions-container {
        gap: 20px;
    }
}
