/* Edit Phase Page - Brutalist Design System */

/* ===== PAGE LAYOUT ===== */
.edit-phase-section {
    background: transparent;
    border: none;
    margin-bottom: 0;
    padding: 0;
}

.edit-phase-content {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xl);
    max-width: 1200px;
    margin: 0 auto;
}

/* ===== TWO COLUMN LAYOUT ===== */
.edit-phase-row {
    display: flex;
    gap: var(--spacing-xl);
    align-items: stretch; /* Changed from flex-start to stretch for equal height */
}

.edit-phase-col {
    flex: 1;
    min-width: 0; /* Prevent flex overflow */
    display: flex; /* Added to enable flex layout */
    flex-direction: column; /* Stack children vertically */
    padding: var(--spacing-lg); /* Added padding for visual separation */
}

.edit-phase-col--form {
    flex: 0 0 45%; /* Left column: 45% width */
}

.edit-phase-col--tiles {
    flex: 0 0 50%; /* Right column: 50% width */
}

/* ===== FORM MODULE STYLING ===== */
.edit-phase-form-module {
    background: var(--color-light-purple); /* Fixed variable name */
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-brutalist);
    padding: var(--spacing-lg);
    flex: 1; /* Added to fill available height */
    display: flex; /* Added flex layout */
    flex-direction: column; /* Stack form elements vertically */
}

.edit-phase-title {
    font-family: var(--font-family);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-2xl);
    color: var(--color-secondary);
    line-height: 1.2;
    margin: 0 0 var(--spacing-lg) 0;
}

/* ===== FORM FIELDS ===== */
.edit-phase-field {
    margin-bottom: var(--spacing-md);
}

.edit-phase-date-field {
    margin-bottom: var(--spacing-md);
}

.edit-phase-field-label {
    display: block;
    font-family: var(--font-family);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    color: var(--color-secondary);
    margin-bottom: var(--spacing-sm);
}

.required-asterisk {
    color: var(--color-primary);
    font-weight: var(--font-weight-bold);
}

.edit-phase-date-row {
    display: flex;
    gap: var(--spacing-md);
}

.edit-phase-date-col {
    flex: 1;
}

/* ===== FORM ACTIONS ===== */
.edit-phase-actions {
    display: flex;
    justify-content: flex-start; /* Changed from flex-end to flex-start for left alignment */
    gap: var(--spacing-md);
    margin-top: auto; /* Changed to auto to push to bottom */
    padding-top: var(--spacing-lg);
    border-top: 1px solid #e5e5e5;
}

/* ===== TILES MODULE STYLING ===== */
.edit-phase-tiles-module {
    background: var(--color-light-purple); /* Fixed variable name */
    border: var(--border-width) solid var(--border-color);
    box-shadow: var(--shadow-brutalist);
    padding: var(--spacing-lg);
}

.edit-phase-tiles-title {
    font-family: var(--font-family);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-lg);
    color: var(--color-secondary);
    margin: 0 0 var(--spacing-md) 0;
}

.edit-phase-tiles-subtitle {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-sm);
    color: #606060;
    margin: 0 0 var(--spacing-lg) 0;
}

/* ===== PHASE TILES GRID ===== */
.edit-phase-tiles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
}

.edit-phase-tile {
    background: var(--color-white);
    border: var(--border-width) solid var(--border-color);
    box-shadow: 2px 2px 0px 0px var(--color-black);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.edit-phase-tile:hover {
    opacity: 0.9;
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0px 0px var(--color-black);
}

.edit-phase-tile.selected {
    border-color: var(--color-primary);
    box-shadow: 2px 2px 0px 0px var(--color-primary);
}

.edit-phase-tile-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.edit-phase-tile-icon {
    font-size: 16px;
    color: var(--color-secondary);
}

.edit-phase-tile-title {
    font-family: var(--font-family);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-sm);
    color: var(--color-secondary);
    line-height: 1.2;
    margin: 0;
}

.edit-phase-tile-description {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-xs);
    color: #606060;
    line-height: 1.3;
    margin: 0;
}

/* ===== TILE INTERACTION STATES ===== */
.edit-phase-tile.selected {
    background: var(--color-light-purple);
    border-color: var(--color-primary);
    transform: translateY(-2px);
}

.edit-phase-tile:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-hover);
}

.edit-phase-tile:active {
    transform: translateY(0);
}

/* ===== MODAL SPECIFIC STYLES ===== */
/* Remove rounded corners from modal content */
#editPhaseModal .modal-content {
    border-radius: 0 !important;
}

/* Remove default modal body padding to make content extend to edges */
#editPhaseModal .modal-body {
    padding: 0 !important;
}

/* Make modal title and icon blue */
#editPhaseModalLabel {
    color: var(--color-secondary) !important;
}

#editPhaseModalLabel .material-symbols-outlined {
    color: var(--color-secondary) !important;
}

/* Delete Confirmation Modal Styles */
#deleteConfirmModal .modal-content {
    border-radius: 0 !important;
}

#deleteConfirmModalLabel {
    color: var(--color-secondary) !important;
}

#deleteConfirmModalLabel .material-symbols-outlined {
    color: var(--color-secondary) !important;
}

/* Make delete confirmation modal title and icon blue */
#deleteConfirmModalLabel {
    color: var(--color-secondary) !important;
}

#deleteConfirmModalLabel .material-symbols-outlined {
    color: var(--color-secondary) !important;
}

/* ===== ADD METHOD MODAL STYLES ===== */
/* Remove rounded corners from add method modal */
#addMethodModal .modal-content {
    border-radius: 0 !important;
}

/* Remove default modal body padding */
#addMethodModal .modal-body {
    padding: 0 !important;
}

/* Make modal title and icon blue */
#addMethodModalLabel {
    color: var(--color-secondary) !important;
}

#addMethodModalLabel .material-symbols-outlined {
    color: var(--color-secondary) !important;
}

/* Category filter grid styling */
.category-filters-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
    margin-top: var(--spacing-sm);
}

.category-filter-item {
    position: relative;
    /* Removed redundant border - border is now on the label */
    box-shadow: 2px 2px 0px 0px var(--color-black);
}

.category-filter-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.category-filter-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-white);
    border: 1.5px solid var(--color-black); /* Fixed: using --color-black instead of --color-dark */
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    border-radius: 0;
}

.category-filter-label:hover {
    background: var(--color-light-purple);
}

.category-filter-item input:checked + .category-filter-label {
    background: var(--color-secondary);
    color: var(--color-white);
}

.category-filter-item input:checked + .category-filter-label .material-symbols-outlined {
    color: var(--color-white);
}

/* Search results container */
.search-results-container {
    margin-top: var(--spacing-md);
    /* Removed max-height and overflow to extend modal naturally */
}

/* Add Method Modal Additional Styles */
#addMethodModal .mt-3 {
    color: var(--color-secondary) !important;
}

#addMethodModal .card-title {
    color: var(--color-secondary) !important;
}

#addMethodModal .card {
    border-radius: 0 !important;
}

#addMethodModal .card-body {
    border-radius: 0 !important;
}

#addMethodModal .btn-sm {
    border-radius: 0 !important;
}

/* Add spacing between list items in search results */
#addMethodModal .list-group-item {
    margin-bottom: var(--spacing-sm);
}

#addMethodModal .list-group-item:last-child {
    margin-bottom: 0;
}

/* Add blue border to specific list items */
#addMethodModal .list-group-item.d-flex.justify-content-between.align-items-center {
    border: 1.5px solid var(--color-secondary);
}

/* Style for Add buttons - Material Icons handled in HTML */
#addMethodModal .btn-sm {
    font-weight: 500;
}

/* Suggestion Modal (Swap Method) Additional Styles */
#suggestionModal .modal-title {
    color: var(--color-secondary) !important;
}

#suggestionModal .modal-title .material-symbols-outlined {
    color: var(--color-secondary) !important;
}

#suggestionModal .mt-3 {
    color: var(--color-secondary) !important;
}

#suggestionModal .card-title {
    color: var(--color-secondary) !important;
}

#suggestionModal .card {
    border: none !important;
    border-radius: 0 !important;
}

#suggestionModal .card-body {
    border: 1.5px solid var(--color-secondary) !important;
    border-radius: 0 !important;
}

#suggestionModal .btn-sm {
    border-radius: 0 !important;
}

/* Add spacing between list items in search results */
#suggestionModal .list-group-item {
    margin-bottom: var(--spacing-sm);
}

#suggestionModal .list-group-item:last-child {
    margin-bottom: 0;
}

/* Add blue border to specific list items */
#suggestionModal .list-group-item.d-flex.justify-content-between.align-items-center {
    border: 1.5px solid var(--color-secondary);
}

/* Ensure modal is wide enough for two columns on tablets */
@media (min-width: 576px) {
    #editPhaseModal .modal-dialog {
        max-width: 90vw;
        margin: 1.75rem auto;
    }
}

@media (min-width: 768px) {
    #editPhaseModal .modal-dialog {
        max-width: 80vw;
        margin: 1.75rem auto;
    }
}

@media (min-width: 1200px) {
    #editPhaseModal .modal-dialog {
        max-width: 1140px;
        margin: 1.75rem auto;
    }
}

/* Mobile modal adjustments */
@media (max-width: 575px) {
    #editPhaseModal .modal-dialog {
        max-width: calc(100vw - 2rem);
        margin: 1rem;
    }
    
    #editPhaseModal .modal-content {
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
    }
}

/* ===== RESPONSIVE DESIGN ===== */
/* Tablet and larger: Keep two columns side by side */
@media (min-width: 576px) {
    .edit-phase-row {
        flex-direction: row;
        gap: var(--spacing-xl);
    }
    
    .edit-phase-col--form {
        flex: 0 0 45%;
    }
    
    .edit-phase-col--tiles {
        flex: 0 0 50%;
    }
    
    /* Adjust tiles grid for iPad Mini */
    .edit-phase-tiles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-sm);
    }
}

/* Better handling for smaller tablets (iPad Mini) */
@media (min-width: 576px) and (max-width: 768px) {
    .edit-phase-tiles-grid {
        gap: var(--spacing-xs);
    }
    
    .edit-phase-tile {
        padding: var(--spacing-sm);
    }
    
    .edit-phase-tile-title {
        font-size: var(--font-size-xs);
    }
    
    .edit-phase-tile-description {
        font-size: var(--font-size-xs);
        line-height: 1.2;
    }
}

/* Mobile: Single column layout */
@media (max-width: 575px) {
    .edit-phase-row {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .edit-phase-col--form,
    .edit-phase-col--tiles {
        flex: 1;
    }
    
    .edit-phase-col {
        padding: var(--spacing-md);
    }
    
    .edit-phase-tiles-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-sm);
    }
    
    .edit-phase-tiles-title {
        font-size: var(--font-size-lg);
        margin-bottom: var(--spacing-sm);
    }
    
    .edit-phase-tiles-subtitle {
        font-size: var(--font-size-xs);
        margin-bottom: var(--spacing-md);
    }
    
    .edit-phase-tile {
        padding: var(--spacing-sm);
    }
    
    .edit-phase-date-row {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .edit-phase-actions {
        justify-content: stretch;
        flex-direction: column;
    }
    
    .edit-phase-content {
        gap: var(--spacing-md);
    }
    
    .edit-phase-form-module,
    .edit-phase-tiles-module {
        padding: var(--spacing-sm);
    }
}

/* ===== METHOD SELECTION MODAL SPECIFIC STYLES ===== */
#editProfileMethodsModal .modal-body {
    padding: 0 !important;
}

#editProfileMethodsModalLabel {
    color: var(--color-secondary) !important;
}

#editProfileMethodsModalLabel .material-symbols-outlined {
    color: var(--color-secondary) !important;
}

/* Selected Methods Display */
.selected-methods-counter {
    font-family: var(--font-family);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-md);
    color: var(--color-secondary);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-sm);
    background: var(--color-white);
    border: var(--border-width) solid var(--color-secondary);
    text-align: center;
}

.selected-methods-container {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    max-height: 300px;
    overflow-y: auto;
}

.no-methods-selected {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-sm);
    color: #666;
    text-align: center;
    padding: var(--spacing-lg);
    background: #f9f9f9;
    border: 1px dashed #ccc;
}

.selected-method-chip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--color-white);
    border: var(--border-width) solid var(--color-secondary);
    box-shadow: 2px 2px 0px 0px var(--color-black);
}

.method-chip-name {
    font-family: var(--font-family);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    color: var(--color-secondary);
    flex: 1;
}

.method-chip-remove {
    background: var(--color-white);
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    padding: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.method-chip-remove:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

/* Search Results */
.search-results-container {
    margin-top: var(--spacing-md);
    max-height: 400px;
    overflow-y: auto;
}

.no-search-results {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-sm);
    color: #666;
    text-align: center;
    padding: var(--spacing-lg);
    background: #f9f9f9;
    border: 1px dashed #ccc;
}

.method-search-card {
    background: var(--color-white);
    border: var(--border-width) solid var(--color-secondary);
    margin-bottom: var(--spacing-sm);
    box-shadow: 2px 2px 0px 0px var(--color-black);
}

.method-card-content {
    padding: var(--spacing-sm);
}

.method-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

/* Remove bottom margin specifically in the method selection modal */
#editProfileMethodsModal .method-card-header {
    margin-bottom: 0;
}

.method-card-title {
    font-family: var(--font-family);
    font-weight: var(--font-weight-bold);
    font-size: var(--font-size-md);
    color: var(--color-secondary);
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.method-add-button {
    background: var(--color-white);
    color: var(--color-primary);
    border: var(--border-width) solid var(--color-primary);
    padding: 4px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font-family);
    font-weight: var(--font-weight-medium);
    font-size: var(--font-size-sm);
    box-shadow: 2px 2px 0px 0px var(--color-black);
    white-space: nowrap;
}

.method-add-button:hover:not(:disabled) {
    background: var(--color-primary);
    color: var(--color-white);
}

.method-add-button--selected {
    background: var(--color-success);
    color: var(--color-white);
    border-color: var(--color-success);
    cursor: default;
}

.method-card-description {
    font-family: var(--font-family);
    font-weight: var(--font-weight-regular);
    font-size: var(--font-size-sm);
    color: #666;
    line-height: 1.4;
    margin: 0;
}

/* Search Icon */
.starfish-input-field .search-icon {
    position: absolute;
    right: var(--spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    pointer-events: none;
    font-size: 20px;
}
