/* Settings Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    color: #333;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    color: #111;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #888;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1;
}

.settings-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 10px 20px;
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn.active {
    color: #007bff;
    border-bottom: 2px solid #007bff;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
}

.setting-group {
    margin-bottom: 20px;
}

.setting-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.setting-group input,
.setting-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
}

.setting-group small {
    display: block;
    margin-top: 5px;
    color: #777;
    font-size: 0.8rem;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    background: #fcfcfc;
    border-radius: 0 0 16px 16px;
}

/* Modern Button Styles */
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-action {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Footer "Save Changes" Button - Styled consistently with app */
.save-btn-primary {
    background: white;
    color: #333;
    padding: 10px 24px;
    font-size: 0.95rem;
    border-radius: 8px;
    font-weight: 600;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
}

.save-btn-primary:hover {
    background: #f0f4f8;
    border-color: #bbb;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.2);
}

.btn-secondary:hover {
    background: rgba(0, 123, 255, 0.15);
}

.btn-danger {
    background: rgba(244, 67, 54, 0.1);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.btn-danger:hover {
    background: rgba(244, 67, 54, 0.15);
}

.add-btn {
    width: 100%;
    margin-top: 10px;
    background: rgba(0, 123, 255, 0.05);
    border: 2px dashed rgba(0, 123, 255, 0.3);
    color: #007bff;
    padding: 12px;
}

.add-btn:hover {
    background: rgba(0, 123, 255, 0.1);
    border-color: #007bff;
}

/* Family List Styles */
.family-member-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    display: flex;
    gap: 20px;
}

.member-photo-section {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.member-photo-preview {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #f0f0f0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #eee;
}

.member-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.member-info-section {
    flex-grow: 1;
}

.member-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

.member-row-full {
    margin-bottom: 15px;
}

.remove-member-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1.2rem;
    color: #ccc;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.remove-member-btn:hover {
    color: #f44336;
}

/* Checkbox group styling */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 500;
}

/* Calendar List Styling */
.calendar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 8px;
    background: #fafafa;
    transition: background 0.15s ease;
}

.calendar-item:hover {
    background: #f0f4f8;
}

.calendar-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    accent-color: #007bff;
}

.calendar-item label {
    cursor: pointer;
    font-size: 0.95rem;
    line-height: normal;
    font-weight: 500;
}

/* Checkbox group styling */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Image Preview Box */
.image-preview-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    margin-bottom: 15px;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #eee;
}

.image-preview-box img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.action-buttons-row {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
}

/* Ensure buttons don't stretch */
.action-buttons-row .btn-secondary,
.action-buttons-row .btn-danger,
.action-buttons-row label.btn-secondary {
    flex: 0 0 auto;
    min-width: 100px;
    max-width: 140px;
    box-sizing: border-box;
}

.setting-description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

/* Character Tile Preview */
.tile-preview-container {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px dashed #eee;
}

.tile-preview-container h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: #333;
}

.tile-preview-message {
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 15px;
}

#character-tile-preview {
    max-width: 100%;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: none;
    /* Hidden by default until generated */
}